Python wrapper for the Mastodon ( ) API.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Lorenz Diener 9225072cc8
Merge pull request #298 from crd477/master
3 months ago
.circleci Disable 3.6 test (missing crypto module) 4 months ago
docs add missing closing brace to media dicts section 3 months ago
mastodon refactor: use f-strings without bug 4 months ago
tests refactor: use f-strings 4 months ago
.gitignore Update .gitignore to ignore pytest cache 4 years ago
CHANGELOG.rst Bump version 4 months ago Add reactions to changelog 3 years ago
LICENSE Update LICENSE to reflect that this is not a single person project 4 years ago Update 5 years ago
Pipfile Update Pipfile 3 years ago
README.rst nit 4 months ago Bump version 4 months ago
setup.cfg add coverage reports to tests 5 years ago Bump version 4 months ago
tox.ini Sunset 2.7 4 years ago

Python wrapper for the Mastodon ( ) API.
Feature complete for public API as of Mastodon version 3.5.5 and easy to get started with:

.. code-block:: python

    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:
        api_base_url = '',
        to_file = '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',)
        to_file = 'pytooter_usercred.secret'

    # 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 !')

You can install via pypi:

.. code-block:: Bash

   # Python 3
   pip3 install

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

---------------- contains work by a large amount of contributors, many of which have
put significant work into making it a better library. You can find some information
about who helped with which particular feature or fix in the changelog.

.. image::
.. image::