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 +++++++++++++++++-------------------- docs/index.rst | 4 ++-- 2 files changed, 19 insertions(+), 22 deletions(-) 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/ diff --git a/docs/index.rst b/docs/index.rst index 6141557..5b1fe3a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -32,7 +32,7 @@ Then, log in. This can be done every time your application starts (e.g. when wri to_file = 'pytooter_usercred.secret' ) -To post, create an actual API instance: +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: .. code-block:: python @@ -49,7 +49,7 @@ every aspect. This is a simple Python wrapper for that API, provided as a single Python module. Mastodon.py aims to implement the complete public Mastodon API. As -of this time, it is feature complete for Mastodon version 3.5.3. The +of this time, it is feature complete for Mastodon version 3.5.5. The Mastodon compatible API layers of various other pieces of software as well as forks, while not an official target, should also be basically compatible, and Mastodon.py does make some allowances for behaviour that isn't -- cgit v1.2.3