Skip to main content

Parsing and Validation Library for RIOS Files

Project description

https://github.com/prometheusresearch/rios.core/workflows/Test/badge.svg https://readthedocs.org/projects/rioscore/badge/?version=stable 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:

$ python -m venv rios
$ cd rios
$ . bin/activate
$ git clone git@github.com:prometheusresearch/rios.core.git
$ cd rios.core
$ pip install -e .
$ pip install -r requirements.txt
$ pytest

Project details


Download files

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

Source Distribution

rios_core-0.10.0.tar.gz (72.6 kB view details)

Uploaded Source

Built Distribution

rios.core-0.10.0-py2.py3-none-any.whl (34.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file rios_core-0.10.0.tar.gz.

File metadata

  • Download URL: rios_core-0.10.0.tar.gz
  • Upload date:
  • Size: 72.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for rios_core-0.10.0.tar.gz
Algorithm Hash digest
SHA256 6e88d28b0a230159523ca653a81a56f99f2c25db68e88640c2b153d6adfaa81e
MD5 fd4a4315689c22d260ed9732f955bea3
BLAKE2b-256 876dd67dd25d8ae435637bfcdf4517458e2020200cf02db52fdf7eb421075c7c

See more details on using hashes here.

File details

Details for the file rios.core-0.10.0-py2.py3-none-any.whl.

File metadata

  • Download URL: rios.core-0.10.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for rios.core-0.10.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f024692b0ce89f1a9ee2166e56e418bd2c35fdfe0922396512639ada295446a0
MD5 1e2447569a40710d61bdc25a3e320477
BLAKE2b-256 7eefbbdb22035aa9171f6b54259da32898d1f50cb992110027225ada23e612c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page