Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

ckanext-odatabcn - CKAN extension for Open Data BCN customizations

ckanext-odatabcn provides Open Data BCN its custom appearance as well as some new functionalities. It contains two different plugins.



Includes all custom templates, translations, CSS and jQuery to adapt the CKAN interface to Barcelona's City Council style guide.

It also provides additional functionalities:

  • Load drupal comments system into datasets. This was adapted from ckan-canada so it inserts Drupal nodes on package creation instead of executing commands periodically.
  • Obtaining the number of downloads per resource
  • Calculating monthly added and deactivated datasets
  • Dataset catalogue download in CSV format. This CSV can be accessed from the URL /cataleg.csv of your CKAN installation.


This plugin also enables console commands that are executed through cron jobs:

  • paster odatabcn update-tracking: update resource ids on the tracking_summary table
  • paster odatabcn update-dataset-total: update the number of datasets published and deactivated last month on the odb_dataset_total custom table
  • paster odatabcn get-new-tags: check all active tags against the i18n "es" language file to check for missing translations and e-mail the list to the account added on the "email_to" configuration option.
  • paster odatabcn submit-resource-to-datapusher: submits a resource identified by "resource_id" to the datastore through datapusher. Adapted from ckan/ckanext/datapusher/ _submit method which only allows all resources from a dataset to be submitted instead of a single one.

The shell scripts that are included on crontab can be found inside the scripts folder.


Hides internal use dataset fields to non-authenticated users.

This plugin also includes extra fields for each dataset's related organization and its parent provided by ckanext-hierarchy on dataset search actions. This is required to avoid executing API calls for each dataset returned in order to print its organization, as it conducts to a huge performance loss.


This extension requires CKAN version 2.7. It hasn't been tested on previous or later versions.

The dataset commenting system requires a Drupal 7 installation with the opendata_package module installed and access to the drupal database from CKAN.

It also requires the following CKAN extensions along with their requirements:

  • stats
  • ckanext-scheming
  • ckanext-fluent
  • ckanext-qa


To install ckanext-odatabcn:

  1. Execute the following SQL

  2. Activate your CKAN virtual environment, for example: . /usr/lib/ckan/default/bin/activate cd /usr/lib/ckan/default/src

  3. Install the ckanext-odatabcn Python package into your virtual environment: pip install -e "git+"

  4. Add odatabcn and editfields to the ckan.plugins setting in your CKAN config file (by default the config file is located at /etc/ckan/default/production.ini).

  5. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu: sudo service apache2 reload



Connection URL to Drupal database. Required to save datasets as nodes in Drupal and enable dataset comments.


You are welcome to contribute to this repository, but please read the CONTRIBUTING guidelines.


This extension is published under the GNU Affero General Public License v3 (see LICENSE).


No description, website, or topics provided.







No releases published


No packages published

Contributors 4