Helsinki Electronic Records Management Classification System
Python Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

helerm - Helsinki Electronic Records Management Classification System


  • Python 3.4+
  • PostgreSQL 9.1+


  • Setup and activate a virtualenv (virtualenvwrapper is a nice tool to handle virtualenvs)

  • Install required Python packages

pip install -r requirements.txt
  • Create file in the project root and use it to override settings as needed.

  • Create a database

sudo -u postgres createuser -L -R -S helerm
sudo -u postgres createdb -Ohelerm helerm
  • Create database tables etc.
python migrate
  • To enable Finnish translations, run
python compilemessages
  • You will probably need a superuser as well
python createsuperuser


  • pip-tools is used to ease requirement handling. To install development packages, run
pip-sync requirements.txt dev-requirements.txt
  • To start the development server, run
python runserver

Admin ui will be located at

API root will be located at


  • First you need to import classifications and create attributes
python import_classifications data/helsinki-functions.csv
python create_attributes
  • It is also possible to import attributes from an excel file
python import_attributes <excel file>
  • Temporary step: the old data model requires a function object for every available function code even when there is no actual data for the function. Those initial functions can be created based on current classification by running
python create_initial_functions
  • Actual data can then be imported by running
python import_data <data excel file>
  • To import a function template run
python import_template <data excel file> <sheet name> [template name]


  • All data can be exported to a XML file by running
python export_data <xml file>

Python XML Schema files and Python bindings

The export uses pyxb library and needs Python bindings to be generated from XSD schema files.

The repo contains two sets of JHS XML Schema files located in data directory. In addition to original ones, there are also HKI customized versions, which are in use at least for now.

Generated bindings are included in metarecord/binding/ so the export should work out of the box.

To generate new bindings from (HKI customized) JHS schema files run

pyxbgen -u Skeema_TOS_kooste_HKI_custom.xsd --module-prefix=metarecord.binding --schema-root=data -m jhs

By default the generated bindings contain unnecessary references to local files. If the bindings are shared to somewhere, put into the repo for example, it is a good idea to remove unnecessary references by

sed -i '' 's/pyxb.utils.utility.Location([^)]*)/None/' metarecord/binding/*