Python is a programming language and web server runtime environment used for many IndieWeb projects.
There are many reasons why you might want to use Python for an IndieWeb project, including:
- Python is an easy language to start learning.
- You can build applications quickly with Python.
- There are many frameworks that let you use your Python skills to build web applications.
- There are many IndieWeb applications built with Python which you can use as a source of inspiration and learning as you build your own tools.
- There are IndieWeb and Microformats libraries available for Python (i.e. IndieWeb_Utils, Flask_IndieAuth, mf2py and mf2util.
Examples of indieweb community members who are using Python on their personal sites (alphabetical order):
Bear's uses Kaku, a Python based static site generator, to run his personal site bearlog and uses the following Python projects:
capjamesg uses Python across his IndieWeb projects. His blog uses a custom-built static site generator called letsjam. He uses Python for his webmention receiver, Micropub endpoint, and other projects.
Beto uses Nefelibata, a Python based static generator to run his weblog Tao &c.
fluffy uses Publ, a Python based web publishing system, to run beesbuzz.biz.
Kartik Prabhu's personal site Parallel Transport runs on Bundle and uses the following Python IndieWeb projects:
Kyle Mahan uses Red Wind (written in Python) to run his personal site http://kylewm.com/ with the following Python projects:
David Reeve's site Lancey Space uses Red Wind with the following Python projects:
Generally useful libraries being developed by IndieWeb participants in Python.
- ronkyuu, a collection of tools for sending webmentions and verifying rel=me.
- webmention-tools, utilities to send webmentions and query Webmention.io
- mf2py, a microformats2 parser
- Bleeding-edge development currently being done on Kartik's fork. Will be folded into the master in the future.
- mf2util is a microformats2-specific parsing utility. Useful for reading the relevant properties for comments and reply-contexts. Also has some special handling for date/times that converts them into Python datetime or date objects.
- ninka is a small library to handle indieauth endpoint discovery and auth token validation
- python-indieweb is an example Flask app that implements IndieAuth, webmentions, micropub-endpoint and token-endpoint.
- granary fetches and converts silo data (Facebook, Flickr, Google+, Instagram, and Twitter via their APIs) to/from ActivityStreams, microformats2 HTML and JSON, Atom, and more. Also available as a REST service.
- indieweb-utils is a set of building blocks for implementing IndieWeb applications. indieweb-utils includes features such as a webmention discovery function, implementation of the Post Type Discovery specification, and a reply context generator.
Non-IndieWeb-specific libraries that may still be of interest.
- Requests: By far the best way to interact with any HTML endpoint.
- BeautifulSoup: sits of top of other HTML parsing libraries (lxml or html5lib) and provides a nice interface for wading through HTML, even horribly broken HTML.
- Bleach: sanitizer and autolinker. Useful for removing dangerous code from e.g., for displaying remote content. Excludes almost everything by default.
IndieWeb projects built with Python:
- Bridgy (open source) runs on Google AppEngine
- Red Wind
- IndieWeb Search
Python does not have PHP's ubiquity, and finding hosting can be a little bit more of a challenge. See web_hosting for more details.
- Google AppEngine (webapp, Django)
- Heroku (Flask, Django)
- VPS running a WSGI server like uWSGI or gunicorn.