From f44fbdc5f25847dfbda7b84adec629d196cc0530 Mon Sep 17 00:00:00 2001 From: halcy Date: Thu, 1 Dec 2022 01:51:49 +0200 Subject: Clean up some docs stuff --- README.rst | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'README.rst') diff --git a/README.rst b/README.rst index 59414d8..df3b6d8 100644 --- a/README.rst +++ b/README.rst @@ -1,37 +1,35 @@ Mastodon.py =========== Python wrapper for the Mastodon ( https://github.com/mastodon/mastodon/ ) API. -Feature complete for public API as of Mastodon version 3.4.0 and easy to get started with: +Feature complete for public API as of Mastodon version 3.5.5 and easy to get started with: .. code-block:: python - # Register your app! This only needs to be done once. Uncomment the code and substitute in your information. - from mastodon import Mastodon + # Register your app! This only needs to be done once (per server, or when + # distributing rather than hosting an application, most likely per device and server). + # Uncomment the code and substitute in your information: + ''' Mastodon.create_app( - 'pytooterapp', - api_base_url = 'https://mastodon.social', - to_file = 'pytooter_clientcred.secret' + 'pytooterapp', + api_base_url = 'https://mastodon.social', + to_file = 'pytooter_clientcred.secret' ) ''' - # Then login. This can be done every time, or use persisted. - - from mastodon import Mastodon - - mastodon = Mastodon(client_id = 'pytooter_clientcred.secret') + # Then, log in. This can be done every time your application starts (e.g. when writing a + # simple bot), or you can use the persisted information: + mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',) mastodon.log_in( - 'my_login_email@example.com', - 'incrediblygoodpassword', + 'my_login_email@example.com', + 'incrediblygoodpassword', to_file = 'pytooter_usercred.secret' ) - # To post, create an actual API instance. - - from mastodon import Mastodon - + # Note that this won't work when using 2FA - you'll have to use OAuth, in that case. + # To post, create an actual API instance: mastodon = Mastodon(access_token = 'pytooter_usercred.secret') mastodon.toot('Tooting from Python using #mastodonpy !') @@ -42,9 +40,8 @@ You can install Mastodon.py via pypi: # Python 3 pip3 install Mastodon.py -Note that Python 2.7 is now no longer officially supported. It will still -work for a while, and we will fix issues as they come up, but we will not -be testing specifically for Python 2.7 any longer. +We currently try to support Python 3.7 and above, and try to at least not break Python 3 versions +below that. Python 2 support is no longer a goal. Full documentation and basic usage examples can be found at https://mastodonpy.readthedocs.io/en/stable/ -- cgit v1.2.3