Learn Python with Talk Python's 270 hours of courses

Mastodon for Python Devs

Episode #390, published Tue, Nov 15, 2022, recorded Mon, Nov 14, 2022

Wondering what Mastodon is all about? More importantly, what does it offer Python developers and other open source folks compared to Twitter? There is a huge amount of interest in the tech community about what's happening at Twitter and whether they should expand to or even move to a new location. So I decided to put together a set of experienced Python developers who have been Mastodon inhabitants for a long time to discuss what this unexpected shift means for one of our important online watering holes.

On this episode you'll meet Gina Häußge, Simon Willison, and Juan Luis Cano Rodríguez. We're going to have a great time talking about the technology and the culture of Mastodon from this Python perspective.

Watch this episode on YouTube
Play on YouTube
Watch the live stream version

Episode Deep Dive

Guests Introduction and Background

  • Carol Willing: Carol is a seasoned Python core developer and a contributor to the Jupyter ecosystem. She has extensive experience managing community-driven open source projects and currently works in deep engineering at Notable.
  • Gina Häuske: Gina is the creator and maintainer of OctoPrint, a popular 3D printing monitoring and control software. She has been active on Twitter since 2009 and joined Mastodon in early 2020, bringing a perspective as a longtime open source maintainer.
  • Juan Luis Cano: Juan is a Python developer and advocate originally from Spain, with a background in space engineering. He has worked in advocacy roles where social media presence is an essential part of the job. Juan joined Mastodon a year and a half ago, exploring alternative communities and free, open platforms.
  • Simon Willison: Simon is the creator of Datasette and a longtime contributor to the open-source world. He has been on Twitter for 16 years and even built a startup using Twitter’s API. Having seen Twitter’s evolution firsthand, he is now exploring Mastodon, including running his own self-hosted instance.

What to Know If You're New to Python

If you are just starting your Python journey and want to get the most out of discussions about Mastodon, open source, and APIs, here are a few resources to help you get comfortable:

  • Make sure you understand basic HTTP concepts—this will help you if you explore Mastodon’s API or build integrations.
  • Familiarize yourself with the command line (creating virtual environments, installing packages). Being able to install and run libraries like toot (a Mastodon CLI) is much easier when you have this foundation.

Key Points and Takeaways

  1. Why People Are Exploring Mastodon Mastodon has risen in popularity in response to uncertainty over Twitter’s management and future. Guests note that Twitter, historically a crucial hub for developer communities, feels unstable now. Mastodon offers a new social home, especially for open source and Python developers.
  2. Decentralization via Federated Instances A central theme of Mastodon is its decentralized nature. Instead of a single platform, Mastodon is split into thousands of servers (instances) that talk to one another through open protocols. This approach prevents “single-owner” takeovers while allowing communities to self-moderate.
  3. Welcoming Culture and Community Norms The panel highlights that Mastodon has a more relaxed, friendly culture compared to mainstream social networks. Features like limited search and the lack of quote-tweets were intentionally designed to reduce harassment and increase direct conversation rather than viral callouts.
    • Links / Tools:
      • Mastodon code of conduct (example from Mastodon.social): https://mastodon.social/about
  4. The ActivityPub Protocol Mastodon runs on top of ActivityPub, a W3C standard that defines how servers exchange messages, like following, posting, and sharing. This means other projects, such as PeerTube for video or PixelFed for images, can seamlessly interconnect with Mastodon.
  5. Verification via rel=me Instead of centralized checkmarks, Mastodon’s verification relies on proving you own another domain or website. By adding a rel="me" link from your site back to your Mastodon profile, you demonstrate site ownership, creating a distributed “verification” process.
    • Links / Tools:
      • Mastodon docs on verification: https://docs.joinmastodon.org/user-profile/verification/
  6. Financial Model and Sustainability Because Mastodon isn’t ad-driven, each instance must fund itself. Many servers use open, transparent funding through Patreon or other platforms. Participants estimate the server costs to be quite low on a per-user basis—often just a few cents or a few dollars per month.
  7. Hosting Your Own Instance Advanced Python devs with sysadmin skills can host their own Mastodon instance, either fully self-managed or via specialized hosting. This gives total control over moderation, user policies, and community focus. You can also ban malicious servers, ensuring a safe environment.
  8. Mastodon for Developers: APIs and Automation From building bots to writing scripts for cross-posting, Mastodon’s API is straightforward and supportive of open source innovation. Python wrappers and libraries like toot or direct HTTP calls let you manage authentication, posting, or streaming updates for real-time apps.
    • Links / Tools:
      • Toot CLI: https://pypi.org/project/toot/
      • Mastodon.py library: https://github.com/halcy/Mastodon.py
      • Simon’s streaming script sample: https://gist.github.com/simonw (search for Mastodon or streaming references)
  9. Scaling and Performance of Federated Servers With the flood of new users, many servers had to scale infrastructure quickly. Guests point to Mastodon’s underlying sidekiq-based queue system (in Ruby) and the flurry of optimization projects, like Andrew Godwin’s Takahe in Python. They see exciting challenges for performance tuning.
    • Links / Tools:
      • Takahe: https://github.com/andrewgodwin/takahe
  10. Challenges and The Future of Mastodon While the culture and tech are welcoming, new users can be confused by “pick a server” and other federation concepts. There’s ongoing work to improve onboarding, UX, and bridging communities. Nevertheless, guests are optimistic about Mastodon’s long-term growth and resilience.

Interesting Quotes and Stories

  • “It feels a bit like the internet used to feel” – Gina Häuske on finding smaller, friendlier communities through Mastodon.
  • “Mastodon is an overnight success, five years in the making” – Simon Willison, underscoring the long development work behind ActivityPub and the Mastodon ecosystem.
  • “You should talk *with* people, not *about* people” – Gina referencing the lack of quote-tweets in Mastodon and how it fosters direct conversation.
  • “It’s the first time we’re really trying this idea of a massive, decentralized social network for everyone” – Juan Luis Cano highlighting Mastodon’s unique position in mainstream adoption.

Key Definitions and Terms

  • Federation: The concept of independent servers (instances) communicating via a common protocol, enabling users on different servers to interact seamlessly.
  • Instance: A specific Mastodon server or community with its own domain, user base, and rules. Users choose an instance to join but still communicate across Mastodon’s network.
  • ActivityPub: A W3C social networking protocol that powers Mastodon, PixelFed, PeerTube, and more. It defines how servers publish and subscribe to content from each other.
  • rel=me Verification: A decentralized form of verification where a personal website must link to your Mastodon profile, confirming ownership of that domain.

Learning Resources

Here are a few resources to help you dive deeper into Python, web technologies, and building your own integrations with Mastodon:

Overall Takeaway

Mastodon’s decentralized architecture, open-source ethos, and vibrant Python community offer an appealing alternative to centralized social networks. While the technology behind it can be complex—requiring multiple servers, moderation, and user choice—Mastodon fosters deeper collaboration, friendlier culture, and a sense that you’re part of a true community. As Python developers, there are countless opportunities to contribute, automate, and build creative tools around Mastodon’s transparent APIs.

Links from the show

Gina on Mastodon: chaos.social/@foosel
Juan on Mastodon: social.juanlu.space/@astrojuanlu
Simon on Mastodon: simonwillison.net/@simon
Carol on Mastodon: @willingc@hachyderm.io
Michael on Mastodon: fosstodon.org/@mkennedy
Talk Python on Mastodon: fosstodon.org/@talkpython
Mastodon: joinmastodon.org
Fosstodon: fosstodon.org
Mastodon is just blogs article: simonwillison.net
C-Suite Folks Resign at Twitter: twitter.com
The Importance of Choosing the Correct Mastodon Instance: carlchenet.com
Wizard to choose your instance: instances.social
Here’s how a Twitter engineer says it will break in the coming weeks: technologyreview.com
Dealing with unwanted content: docs.joinmastodon.org
Twitter poll on moving to Mastodon: twitter.com
Toot package: pypi.org
Takahe server: github.com
Validating your Github account on your Mastodon profile: mastodon.social
Twitter’s potential collapse could wipe out vast records of recent human history: technologyreview.com
Simon's Streaming API: gist.github.com
Mastodon 4.0 is out (day after recording): mastodon.social
Watch this episode on YouTube: youtube.com
Episode transcripts: talkpython.fm

--- Stay in touch with us ---
Subscribe to Talk Python on YouTube: youtube.com
Talk Python on Bluesky: @talkpython.fm at bsky.app
Talk Python on Mastodon: talkpython
Michael on Bluesky: @mkennedy.codes at bsky.app
Michael on Mastodon: mkennedy

Talk Python's Mastodon Michael Kennedy's Mastodon