Skip to main content

Datasette plugin that adds a .atom output format

Project description


PyPI CircleCI License

Datasette plugin that adds support for generating Atom feeds with the results of a SQL query.


Install this plugin in the same environment as Datasette to enable the .atom output extension.

$ pip install datasette-atom


To create an Atom feed you need to define a custom SQL query that returns a required set of columns:

  • atom_id - a unique ID for each row. This article has suggestions about ways to create these IDs.
  • atom_title - a title for that row.
  • atom_updated - an RFC 3339 timestamp representing the last time the entry was modified in a significant way. This can usually be the time that the row was created.

The following columns are optional:

  • atom_content - content that should be shown in the feed. This will be treated as a regular string, so any embedded HTML tags will be escaped when they are displayed.
  • atom_content_html - content that should be shown in the feed. This will be treated as an HTML string, and will be sanitized using Bleach to ensure it does not have any malicious code in it before being returned as part of a <content type="html"> Atom element. If both are provided, this will be used in place of atom_content.
  • atom_link - a URL that should be used as the link that the feed entry points to.

A query that returns these columns can then be returned as an Atom feed by adding the .atom extension.


Here is an example SQL query which generates an Atom feed for new entries on

  ',' || substr(created, 0, 11) || ':' || id as atom_id,
  name as atom_title,
  created as atom_updated,
  '' || id as atom_link,
    '<img src="' || photo_url || '?w=800&amp;h=400&amp;fit=crop&amp;auto=compress">',
  ) || '<p>' || description || '</p>' as atom_content_html
order by
  created desc

You can try this query by pasting it in here - then click the .atom link to see it as an Atom feed.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for datasette-atom, version 0.4
Filename, size File type Python version Upload date Hashes
Filename, size datasette_atom-0.4-py3-none-any.whl (7.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page