diff options
-rw-r--r-- | README.rst | 37 | ||||
-rw-r--r-- | docs/index.rst | 4 |
2 files changed, 19 insertions, 22 deletions
@@ -1,37 +1,35 @@ | |||
1 | Mastodon.py | 1 | Mastodon.py |
2 | =========== | 2 | =========== |
3 | Python wrapper for the Mastodon ( https://github.com/mastodon/mastodon/ ) API. | 3 | Python wrapper for the Mastodon ( https://github.com/mastodon/mastodon/ ) API. |
4 | Feature complete for public API as of Mastodon version 3.4.0 and easy to get started with: | 4 | Feature complete for public API as of Mastodon version 3.5.5 and easy to get started with: |
5 | 5 | ||
6 | .. code-block:: python | 6 | .. code-block:: python |
7 | 7 | ||
8 | # Register your app! This only needs to be done once. Uncomment the code and substitute in your information. | ||
9 | |||
10 | from mastodon import Mastodon | 8 | from mastodon import Mastodon |
11 | 9 | ||
10 | # Register your app! This only needs to be done once (per server, or when | ||
11 | # distributing rather than hosting an application, most likely per device and server). | ||
12 | # Uncomment the code and substitute in your information: | ||
13 | |||
12 | ''' | 14 | ''' |
13 | Mastodon.create_app( | 15 | Mastodon.create_app( |
14 | 'pytooterapp', | 16 | 'pytooterapp', |
15 | api_base_url = 'https://mastodon.social', | 17 | api_base_url = 'https://mastodon.social', |
16 | to_file = 'pytooter_clientcred.secret' | 18 | to_file = 'pytooter_clientcred.secret' |
17 | ) | 19 | ) |
18 | ''' | 20 | ''' |
19 | 21 | ||
20 | # Then login. This can be done every time, or use persisted. | 22 | # Then, log in. This can be done every time your application starts (e.g. when writing a |
21 | 23 | # simple bot), or you can use the persisted information: | |
22 | from mastodon import Mastodon | 24 | mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',) |
23 | |||
24 | mastodon = Mastodon(client_id = 'pytooter_clientcred.secret') | ||
25 | mastodon.log_in( | 25 | mastodon.log_in( |
26 | '[email protected]', | 26 | '[email protected]', |
27 | 'incrediblygoodpassword', | 27 | 'incrediblygoodpassword', |
28 | to_file = 'pytooter_usercred.secret' | 28 | to_file = 'pytooter_usercred.secret' |
29 | ) | 29 | ) |
30 | 30 | ||
31 | # To post, create an actual API instance. | 31 | # Note that this won't work when using 2FA - you'll have to use OAuth, in that case. |
32 | 32 | # To post, create an actual API instance: | |
33 | from mastodon import Mastodon | ||
34 | |||
35 | mastodon = Mastodon(access_token = 'pytooter_usercred.secret') | 33 | mastodon = Mastodon(access_token = 'pytooter_usercred.secret') |
36 | mastodon.toot('Tooting from Python using #mastodonpy !') | 34 | mastodon.toot('Tooting from Python using #mastodonpy !') |
37 | 35 | ||
@@ -42,9 +40,8 @@ You can install Mastodon.py via pypi: | |||
42 | # Python 3 | 40 | # Python 3 |
43 | pip3 install Mastodon.py | 41 | pip3 install Mastodon.py |
44 | 42 | ||
45 | Note that Python 2.7 is now no longer officially supported. It will still | 43 | We currently try to support Python 3.7 and above, and try to at least not break Python 3 versions |
46 | work for a while, and we will fix issues as they come up, but we will not | 44 | below that. Python 2 support is no longer a goal. |
47 | be testing specifically for Python 2.7 any longer. | ||
48 | 45 | ||
49 | Full documentation and basic usage examples can be found | 46 | Full documentation and basic usage examples can be found |
50 | at https://mastodonpy.readthedocs.io/en/stable/ | 47 | 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 | |||
32 | to_file = 'pytooter_usercred.secret' | 32 | to_file = 'pytooter_usercred.secret' |
33 | ) | 33 | ) |
34 | 34 | ||
35 | To post, create an actual API instance: | 35 | 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: |
36 | 36 | ||
37 | .. code-block:: python | 37 | .. code-block:: python |
38 | 38 | ||
@@ -49,7 +49,7 @@ every aspect. This is a simple Python wrapper for that API, provided | |||
49 | as a single Python module. | 49 | as a single Python module. |
50 | 50 | ||
51 | Mastodon.py aims to implement the complete public Mastodon API. As | 51 | Mastodon.py aims to implement the complete public Mastodon API. As |
52 | of this time, it is feature complete for Mastodon version 3.5.3. The | 52 | of this time, it is feature complete for Mastodon version 3.5.5. The |
53 | Mastodon compatible API layers of various other pieces of software as well | 53 | Mastodon compatible API layers of various other pieces of software as well |
54 | as forks, while not an official target, should also be basically | 54 | as forks, while not an official target, should also be basically |
55 | compatible, and Mastodon.py does make some allowances for behaviour that isn't | 55 | compatible, and Mastodon.py does make some allowances for behaviour that isn't |