Mastodon.py

github.com/halcy/Mastodon.py Fediverse Open-source projectOpen source

Call the Mastodon API from Python with Mastodon.py, a wrapper for the service’s API.

github.com/halcy/Mastodon.py
Mastodon.py homepage screenshot

About Mastodon.py

Mastodon.py is an open source Python library that wraps the Mastodon API, so Python code can interact with Mastodon servers. The README describes it as feature complete for the public API as of Mastodon version 4.5.8. It is installed from PyPI with pip.

The README shows the basic workflow: register an application once per server, log in through an OAuth authorization code, then create an API instance with the saved access token to post a status. Full documentation and basic usage examples are hosted on Read the Docs, and more extensive examples are in a separate GitHub repository. The library is released under the MIT license.

Key features

  • Python wrapper for the Mastodon API
  • Covers the public API, as of Mastodon version 4.5.8
  • App registration and OAuth login with saved credential files
  • Posts a status with a single method call
  • Installable from PyPI using pip
  • Basic docs on Read the Docs and extended examples in a separate repository
Best for: Python developers who want to automate Mastodon tasks or build their own Mastodon clients.
Good for
  • Open source and released under the MIT license
  • Includes basic documentation and separate extended usage examples
  • Provides contact channels for questions and bug reports
Watch out for
  • Python 2 support is no longer a goal
  • Support for Python 3.7 and later is a stated aim, not a guarantee
  • Feature completeness is stated for the public API only

Mastodon.py at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 6, 2026 · Online when checked
Listed
Oct 5, 2026

Mastodon.py alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

Popular in Fediverse

Well-known listings from the same topic.

All 113

Mastodon.py FAQ

How is Mastodon.py installed?
The README says it can be installed from PyPI with the command pip install Mastodon.py.
Does Mastodon.py support Python 2?
No. The README states that Python 2 support is no longer a goal.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing