Skip to content

Commit

Permalink
Clean up some docs stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
halcy authored and halcy committed Nov 30, 2022
1 parent e483d16 commit f44fbdc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
37 changes: 17 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
@@ -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 !')
Expand All @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f44fbdc

Please sign in to comment.