Atom feed generator for CKAN. This extension provides paginated Atom feeds for datasets, allowing users and applications to subscribe to dataset updates filtered by tags, groups, organizations, or custom search queries.
- General feed —
/feeds/dataset.atomshows all recently updated datasets - Custom search feed —
/feeds/custom.atomsupportsq,fq,sort, andfiltersparameters - Tag feeds —
/feeds/tag/<id>.atomfor datasets with a specific tag - Group feeds —
/feeds/group/<id>.atomfor datasets in a specific group - Organization feeds —
/feeds/organization/<id>.atomfor datasets owned by a specific organization - Pagination — Feeds include first, last, previous, and next links
- JSON enclosures — Each feed entry includes a link to the CKAN
package_showAPI - Extensible — Plugins can customize feed generation via the
IFeedinterface
Feed links are automatically added to group and organization pages.
This extension is compatible with CKAN 2.12 and later.
Compatibility with core CKAN versions:
| CKAN version | Compatible? |
|---|---|
| 2.11 and earlier | no |
| 2.12 | yes |
To install ckanext-feedgen:
-
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate -
Clone the source and install it on the virtualenv
git clone https://github.com/CKAN/ckanext-feedgen.git cd ckanext-feedgen pip install -e . pip install -r requirements.txt
-
Add
feedgento theckan.pluginssetting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini). -
Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
The following configuration options are available:
# Feed author name (optional, falls back to ckan.site_id)
ckan.feeds.author_name = My CKAN Site
# Feed author link (optional, falls back to ckan.site_url)
ckan.feeds.author_link = https://example.com
# Publisher domain for tagURIs (optional, falls back to ckan.site_url)
ckan.feeds.authority_name = https://example.com
# Date string for tagURI generation (optional, e.g. 2012-03-22)
ckan.feeds.date = 2012-03-22
# Number of items per feed page (optional, default: 20)
ckan.feeds.limit = 50To install ckanext-feedgen for development, activate your CKAN virtualenv and do:
git clone https://github.com/CKAN/ckanext-feedgen.git
cd ckanext-feedgen
pip install -e .
pip install -r dev-requirements.txtTo run the tests, do:
pytest --ckan-ini=test.iniOther plugins can customize feed behavior by implementing the IFeed interface:
from ckanext.feedgen.interfaces import IFeed
from ckan.plugins import implements
class MyFeedPlugin(p.SingletonPlugin):
implements(IFeed)
def get_feed_class(self):
# Return a custom feed generator class
return MyCustomFeed
def get_item_additional_fields(self, dataset_dict):
# Return additional fields to add to each feed item
return {
'contributor': dataset_dict.get('maintainer'),
}If ckanext-feedgen should be available on PyPI you can follow these steps to publish a new version:
-
Update the version number in the
pyproject.tomlfile. See PEP 440 for how to choose version numbers. -
Tag the new release of the project on GitHub with the version number from the
pyproject.tomlfile. For example if the version number is v0.0.1 then do:git tag v0.0.1 git push --tags