From 1704965f6dfa5e0df0ee7729943e8dd2a88085ce Mon Sep 17 00:00:00 2001 From: halcy Date: Tue, 29 Nov 2022 01:00:59 +0200 Subject: Fix some nits --- docs/index.rst | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'docs/index.rst') diff --git a/docs/index.rst b/docs/index.rst index d5a7e88..a333433 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,45 +3,53 @@ Mastodon.py .. py:module:: mastodon .. py:class: Mastodon +Usage +----- Register your app! This only needs to be done once. Uncomment the code and substitute in your information: .. code-block:: python - from mastodon import Mastodon + from mastodon import Mastodon - ''' - Mastodon.create_app( + ''' + Mastodon.create_app( 'pytooterapp', api_base_url = 'https://mastodon.social', to_file = 'pytooter_clientcred.secret' - ) - ''' + ) + ''' Then login. This can be done every time, or you can use the persisted information: .. code-block:: python - from mastodon import Mastodon + from mastodon import Mastodon - mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',) - mastodon.log_in('my_login_email@example.com', 'incrediblygoodpassword', to_file = 'pytooter_usercred.secret') + mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',) + mastodon.log_in( + 'my_login_email@example.com', + 'incrediblygoodpassword', + to_file = 'pytooter_usercred.secret' + ) To post, create an actual API instance: .. code-block:: python - from mastodon import Mastodon + from mastodon import Mastodon - mastodon = Mastodon(access_token = 'pytooter_usercred.secret') - mastodon.toot('Tooting from Python using #mastodonpy !') + mastodon = Mastodon(access_token = 'pytooter_usercred.secret') + mastodon.toot('Tooting from Python using #mastodonpy !') +Introduction +------------ `Mastodon`_ is an ActivityPub-based Twitter-like federated social network node. It has an API that allows you to interact with its 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.0. The +of this time, it is feature complete for Mastodon version 3.5.3. 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 @@ -85,4 +93,3 @@ about who helped with which particular feature or fix in the changelog. 14_contributing 15_everything - \ No newline at end of file -- cgit v1.2.3