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.9.0.tar.gz (72.8 kB view details)

Uploaded Source

Built Distribution

rios.core-0.9.0-py2.py3-none-any.whl (34.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file rios.core-0.9.0.tar.gz.

File metadata

  • Download URL: rios.core-0.9.0.tar.gz
  • Upload date:
  • Size: 72.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

File hashes

Hashes for rios.core-0.9.0.tar.gz
Algorithm Hash digest
SHA256 8b60ab4b2348a919ed9b02b704def57d97b035e446f4849375afed0f89caf1f0
MD5 1b333ebfd9271a35f7352d10dce825d7
BLAKE2b-256 c82a6f99c15fe8ede80f32188c3abc95e850b3b50dc687ba7139dadbbb4dc6ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rios.core-0.9.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 34.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

File hashes

Hashes for rios.core-0.9.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0522a965b871b3243cb70b416ea128678cc6257bcdf8f378191f7fcc7a2617ac
MD5 7b835c94c3a649257e5dd4ae051b8df9
BLAKE2b-256 23fc4a455681218d81027b6be10c7890c567ce0985e384abc5643378932bcd87

See more details on using hashes here.

Supported by

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