Mastodon.py
Python wrapper for the Mastodon API
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. Install it if you need to automate or integrate with Mastodon servers from Python. The main gotcha is the OAuth setup requirement, but that is a one-time configuration step documented in the library.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires OAuth setup: you must first call Mastodon.create_app() to register your application and obtain credentials before you can authenticate and use the API.
- Low install friction with only three common runtime dependencies (requests, python-dateutil, decorator).
- Actively maintained with a recent release 11 days ago and 957 repository stars.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing use in commercial and private projects with minimal restrictions.
last release 2026-08-03 (11 days) · last repo commit 2026-08-03 · 957 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 306,627 downloads/mo, #7,786 on PyPI
Alternatives
Verify before relying
pip install Mastodon.py
from mastodon import Mastodon
mastodon = Mastodon(access_token='pytooter_usercred.secret')
mastodon.toot('Tooting from Python using #mastodonpy !')- Whether feature completeness for Mastodon 4.5.8 extends to all current server versions or only that specific version.
- Python 3.7 support status and whether versions below 3.7 are actively tested or merely not intentionally broken.
What it is and what it does
Mastodon.py is a Python client library that wraps the Mastodon API, enabling you to interact with Mastodon servers programmatically. It handles OAuth authentication, token management, and provides methods to read timelines, search, post toots, and manage your account. The library depends on requests for HTTP calls, python-dateutil for timestamp handling, and decorator for utility functions.
You use it by first registering your application once per server to get client credentials, then authenticating with user credentials to obtain an access token. After that, you can perform API operations like posting, fetching timelines, and managing followers. The library is feature-complete for the public API as of Mastodon version 4.5.8 and is actively maintained with recent updates.
Use it for
- Build a bot that monitors a hashtag and reposts matching toots to another account.
- Create a backup tool that periodically exports your toots and media to local storage.
- Automate posting scheduled content to Mastodon on a timer.
- Aggregate timelines from multiple Mastodon accounts into a single feed.
- Analyze Mastodon social graphs or engagement metrics for research.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. Install it if you need to automate or integrate with Mastodon servers from Python. The main gotcha is the OAuth setup requirement, but that is a one-time configuration step documented in the library.
Install
mastodon-py on PyPI
Before you install
Low install friction with only three common runtime dependencies (requests, python-dateutil, decorator). Actively maintained with a recent release 11 days ago and 957 repository stars.
Requires OAuth setup: you must first call Mastodon.create_app() to register your application and obtain credentials before you can authenticate and use the API.
License in practice
MIT license is permissive, allowing use in commercial and private projects with minimal restrictions.
Quickstart
pip install Mastodon.py
from mastodon import Mastodon
mastodon = Mastodon(access_token='pytooter_usercred.secret')
mastodon.toot('Tooting from Python using #mastodonpy !')
Verify before relying
- Whether feature completeness for Mastodon 4.5.8 extends to all current server versions or only that specific version.
- Python 3.7 support status and whether versions below 3.7 are actively tested or merely not intentionally broken.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesrequestspython-dateutildecorator |
| Maintenance | Actively maintained 11 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 306,627 / month, #7,786 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Communications |
Evidence: mastodon_py-2.2.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “mastodon api python client”
- Mastodon.pyPython wrapper for the Mastodon API that lets you authenticate, read…
- snscrapeScrapes user profiles, posts, hashtags, and searches from multiple…
- twentyc.rpcA client library for consuming 20c's RESTful API, built on top of the…
Give your agent the search over MCP, or paste the wish link into any chat.
More Communications packages
Pyasn1 encodes and decodes ASN.1 data structures using BER, CER, DER, and native Python codecs, allowing you to serialize complex data for network protocols and file formats.
Install it if you need to work with ASN.1-based protocols or formats; it is the standard library for this in Python and has no known vulnerabilities.
Provides a collection of ASN.1 data structures expressed as Python classes, built on the pyasn1 library, for working with ASN.1-based protocols and standards.
Kombu is a messaging library that provides a high-level Python interface to AMQP and other message brokers, supporting pluggable transports for RabbitMQ, Redis, MongoDB, Amazon SQS, and others.
Install it if you are building any distributed system that requires reliable message passing.
Formats and parses numbers, file sizes, timespans, and other values into human-readable text; provides terminal interaction utilities including ANSI text styling and user prompts.
Adds colored output to Python's standard logging module using ANSI escape sequences, with automatic fallback support for Windows terminals.
However, it is abandoned and receives no maintenance, so it will not adapt to future Python changes or platform updates.
Parse, validate, format, and analyze international phone numbers across all countries, with support for extracting geographic, carrier, and timezone information from phone number data.
See also tweepy · twython · requests-oauthlib · python-youtube · social-auth-app-django · requests-oauth · social-auth-core · jellyfin-apiclient-python · django-allauth · quipclient