OAI-PHM server
Switch branches/tags
Nothing to show
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.
CHANGES.txt Initial commit. Jul 23, 2014
MANIFEST.in Initial commit. Jul 23, 2014
ez_setup.py Initial commit. Jul 23, 2014


We're concentrating on Kuha2 nowdays, see https://bitbucket.org/account/user/tietoarkisto/projects/KUH

Kuha OAI-PMH Server

Kuha is a lightweight OAI-PMH Data Provider implementation. It is written in Python with The Pyramid Web Framework.


  • All six OAI-PMH verbs
  • Support for many optional features, including
    • Deleted records
    • Resumption tokens
    • Set hierarchies
  • DDI Codebook to Dublin Core crosswalk


Set up a virtual environment (recommended).

$ virtualenv env
$ . env/bin/activate

Install the package and dependencies.

$ python setup.py install

Make a copy of the example configuration file and customize it. The available settings are documented in the example file.

$ cp example.ini my_config.ini
$ vim my_config.ini

Kuha comes with a simple module for converting DDI Codebook files to unqualified Dublin Core. You can configure Kuha to use this module by settings the metadata_provider_class option to kuha.importer.ddi_file_provider:DdiFileProvider. The module needs two arguments: a domain name for the OAI identifier and a path of the directory to scan. Set these in the metadata_provider_args setting.


# my_config.ini

metadata_provider_class =

metadata_provider_args =

# ...

See Extending for help on writing your own metadata provider.


Run the metadata import.

$ kuha_import my_config.ini

Start the OAI-PMH serverk

$ pserve my_config.ini

With the example configuration, you can get the identify page at


For most applications, a custom metadata provider is needed. Metadata provider classes should implement an interface similar to kuha.importer.skeleton_provider:SkeletonProvider and kuha.importer.ddi_file_provider:DdiFileProvider. See comments in those files for details.

To make Kuha use your custom metadata provider, set the metadata_provider_class setting to the Python name of the class (e.g. name.of.the.module:NameOfTheClass). The value of the metadata_provider_args setting is split at whitespace and the resulting parts are passed to the constructor of the class.