Skip to content
A simple lifestream creator written in python (Ankh is a river in the Discworld novels: "A water so full of life can't be bad for health")
Python HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

##Ankh Ankh hooks up jinja2 to feedparser so that you can create your own simple feed pages. In addition to all the things jinja2 can do Ankh adds some custom functions and filters.


pip install git+

##Functions and filters get_entries() - for generating a list from a url:

{% for entry in get_entries('') %}
    <a href="{{}}">{{entry.title}}</a>
    <a class="comment" href="{{entry.comments}}">
      <i class="icon-comment"></i>
{% endfor %}

The entry is a feedparser object so anything available to feedparser is available here.

entry.description|find_link(1) - for finding a url that is in embedded within some text. It takes in a parameter for which link to return (0-indexed)

time_sort() - Takes a list of urls, fetches the newest entry from each url, and then sorts them all together from most recent to oldest.

{% for entry in time_sort([
  '']) %}

 {{entry.time_length}} {{entry.time_unit}} {{entry.title}}

{% endfor %}

Entries for time_sort() are also feedparser objects, it has four additional attributes:

  • entry.time_length - an integer
  • entry.time_unit - either hour(s), day(s) or month(s) or New!
  • entry.time_raw - the raw time value used to sort
  • entry.feed_title - the title of the feed for the current entry

get_weather() - takes a list of latitudes, longitude pairs and will return an object for reading the weather (uses NOAA dwml).

{% for weather in get_weather([
  (37.91583, -122.03583),
  (45.52, -122.6819),
  (43.6167, -116.2),
  (38.7453, -94.8292)
]) %}
  <li title="{{ weather.condition() }}">
    {{ weather.temp() }}&deg; in {{ weather.forecast_location() }}
{% endfor %}


Suggested use: ankh my.template.html index.html

Other flags:

  • -c - read and/or write cache files for each feed parsed (useful when developing a template)
  • --cache-path path - specify the cache path, defaults to .ankh_cahe
  • -v - verbose, more details about what is going on

Also works great in a cron :)


  1. git clone
  2. make a virtualenv
  3. pip install -e .
  4. submit a pull request
You can’t perform that action at this time.