Python

From IndieWeb

Python is an open source programming language and web server runtime environment used for many IndieWeb projects.

Why

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.

IndieWeb Examples

Examples of indieweb community members who are using Python on their personal sites (alphabetical order):

Bear

Bear's uses Kaku, a Python based static site generator, to run his personal site bearlog and uses the following Python projects:

capjamesg

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 Dealmeida

Beto uses Nefelibata, a Python based static generator to run his weblog Tao &c.

fluffy

fluffy uses Publ, a Python based web publishing system, to run beesbuzz.biz.

Kartik Prabhu

Kartik Prabhu's personal site Parallel Transport runs on Bundle and uses the following Python IndieWeb projects:

  • ronkyuu
  • mf2py
  • mf2util

Kyle Mahan

Kyle Mahan uses Red Wind (written in Python) to run his personal site http://kylewm.com/ with the following Python projects:

David Reeve

David Reeve's site Lancey Space uses Red Wind with the following Python projects:

Libraries

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.

Third-party Libraries

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.

Projects

IndieWeb projects built with Python:

Hosting

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)
  • Webfaction
  • Heroku (Flask, Django)
  • VPS running a WSGI server like uWSGI or gunicorn.

See Also

Open Source IndieWeb related projects and tools
Topics Why open source? β€’ How to open source a project β€’ Open for contributions β€’ IndieWeb Principles
PHP b2evolution β€’ CASSIS β€’ Known β€’ Falcon (portions) β€’ p3k β€’ stapibas β€’ dobrado β€’ Grav β€’ Miniflux-legacy β€’ processwire β€’ Reader Self β€’ Textpattern β€’ tt-rss β€’ Twyne β€’ TYPO3
WordPress (PHP) Indieweb Plugin β€’ Webmention β€’ Semantic Linkbacks β€’ Micropub β€’ IndieAuth β€’ Post Kinds β€’ Syndication Links β€’ WebSub plugins β€’ See Template:WordPress for others.
Python Bridgy Fed β€’ BeautifulSoup β€’ Bleach β€’ Bundle β€’ django CMS β€’ IndieWeb Search β€’ IndieWeb Utils β€’ kaku β€’ mf2util β€’ Nefelibata β€’ ninka β€’ Publ β€’ python-indieweb β€’ Red Wind β€’ Requests β€’ ronkyuu β€’ Woodwind
Ruby Dark Matter β€’ Feedbin β€’ FrancisCMS β€’ Micropublish β€’ Publify β€’ Ruby on Rails β€’ Sinatra β€’ Singulus β€’ Transformative β€’ webmention.io β€’ Jekyll
JavaScript AerosolCMS β€’ CASSIS β€’ Ghost β€’ Camel β€’ IndieKit β€’ Eleventy
Others Hugo (Go) β€’ Firefox β€’ NetNewsWire