kopia lustrzana https://github.com/halcy/Mastodon.py
Clean up some docs stuff
rodzic
e483d16014
commit
f44fbdc5f2
33
README.rst
33
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',
|
||||
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/
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue