We're concentrating on Kuha2 nowdays, see https://bitbucket.org/tietoarkisto/workspace/projects/KUH
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.
Example:
# my_config.ini
metadata_provider_class =
kuha.importer.ddi_file_provider:DdiFileProvider
metadata_provider_args =
my.organization.org
/srv/metadata
# ...
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 http://127.0.0.1:6543/oai?verb=Identify.
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.