Skip to main content

Parsing and Validation Library for RIOS Files

Project description

Build Status API Documentation https://img.shields.io/pypi/v/rios.core.svg https://img.shields.io/pypi/l/rios.core.svg

RIOS.CORE Overview

RIOS.CORE is a Python package that provides basic validation and formatting functionality for data structures that adhere to the RIOS specifications (formally known as PRISMH).

Example Usage

This package exposes a handful of simple functions for validating and formatting the standard RIOS data structures:

>>> from rios.core import validate_instrument, get_instrument_json

>>> instrument = {"foo": "bar", "id": "urn:my-instrument", "title": "An Instrument Title", "record": [{"id": "field1","type": "text"}], "version": "1.0"}
>>> validate_instrument(instrument)
Traceback (most recent call last):
    ...
colander.Invalid: {'': u'Unrecognized keys in mapping: "{\'foo\': \'bar\'}"'}

>>> del instrument['foo']
>>> validate_instrument(instrument)

>>> print get_instrument_json(instrument)
{
  "id": "urn:my-instrument",
  "version": "1.0",
  "title": "An Instrument Title",
  "record": [
    {
      "id": "field1",
      "type": "text"
    }
  ]
}

For more information on the available functionality, please read the API documentation.

Contributing

Contributions and/or fixes to this package are more than welcome. Please submit them by forking this repository and creating a Pull Request that includes your changes. We ask that you please include unit tests and any appropriate documentation updates along with your code changes.

This project will adhere to the Semantic Versioning methodology as much as possible, so when building dependent projects, please use appropriate version restrictions.

A development environment can be set up to work on this package by doing the following:

$ virtualenv rios
$ cd rios
$ . bin/activate
$ hg clone ssh://hg@bitbucket.org/prometheus/rios.core
$ cd rios.core
$ pip install -e .
$ pip install -r requirements.txt
$ nosetests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rios.core, version 0.8.3
Filename, size File type Python version Upload date Hashes
Filename, size rios.core-0.8.3-py2.py3-none-any.whl (41.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size rios.core-0.8.3.tar.gz (84.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page