Skip to content

okfn/ckanext-iati-generator

Repository files navigation

Tests CKAN 2.10 Tests CKAN 2.11

IATI generator

CKAN extension for generating data in IATI format. It was developed by BCIE (Banco Centroamericano de Integración Económica) and the Open Knowledge Foundation (OKFN).

Use-cases

Useful extension to transform CKAN resources into IATI XML format.

Sample screenshots

IATI conversion

Requirements

This CKAN extension relies on the okfn_iati Python library

Compatibility with core CKAN versions:

CKAN version Compatible?
2.10 Yes
2.11 Yes

Installation

  1. Activate your CKAN virtual environment, for example:
pip install git+https://github.com/okfn/ckanext-iati-generator.git
  1. Install the extension requirements:
pip install -r https://raw.githubusercontent.com/okfn/ckanext-iati-generator/refs/heads/main/requirements.txt
  1. Add iati_generator to the ckan.plugins setting in your CKAN configuration file.
ckan.plugins = ... iati_generator
  1. Run the database migration:
ckan db upgrade -p iati_generator

Config settings

These are the configuration settings that can be set in your ckan.ini file:

# rows_limit is the maximum number of rows to be processed in a single IATI generation request.
ckanext.iati_generator.rows_limit = 50000 # default is 50000

# max_allowed_failures is the maximum number of failures in rows before canceling the IATI generation request.
ckanext.iati_generator.max_allowed_failures = 10 # default is 10

Extra fields: Revisar documentacion completa AQUI

This extension requires resource extras:

  • iati_namespace: If you plan to expose more than one IATI file group, define a custom namespace per each IATI file. If you plan to have only one IATI file group (organization + activities files), leave this empty
  • iati_file_type A selector for the specific IATI file type (e.g., base organization file, names file, org documents file, etc)

Using the scheming extension

If you are using the scheming extension, add this to your schema yaml file

...

resource_fields:
  ...

  # --- IATI fields ---
  - field_name: iati_namespace
    label:
      en: IATI namespace
      es: Espacio de nombres IATI
    help_text:
      en: Leave empty for a single IATI file environment.
      es: Dejar vacío para un entorno con un solo archivo IATI.
    form_placeholder: eg. XM-DAC-46002 or my-org
    validators: ignore_missing

  - field_name: iati_file_type
    label:
      en: IATI file type
      es: Tipo de archivo IATI
    preset: select
    # Helper exposed by this extension that returns [{'value','label'}, ...]
    choices_helper: iati_file_type
    validators: ignore_missing

Without scheming (classic CKAN)

If you are not using the scheming extension: TODO update the schema manually. We will fix/document this in a future version

License

AGPL

About

CKAN extension to generate IATI XML files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages