Skip to main content

Parsing and Validation library for PRISMH Files

Project description

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

PRISMH.CORE Overview

PRISMH.CORE is a Python package that provides basic validation and formatting functionality for data structures that adhere to the PRISMH specifications.

Example Usage

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

>>> from prismh.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 prismh
$ cd prismh
$ . bin/activate
$ hg clone ssh://hg@bitbucket.org/prometheus/prismh.core
$ pip install -e ./prismh.core[dev]

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

prismh.core-0.1.1.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

prismh.core-0.1.1-py2.py3-none-any.whl (26.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file prismh.core-0.1.1.tar.gz.

File metadata

  • Download URL: prismh.core-0.1.1.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for prismh.core-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8494b952ff575001003499c56eb23594a32982596a3271f80345a41d52e85d97
MD5 a9db057bb7f7d4c77ebc7768e416383d
BLAKE2b-256 721febc5b79da51b13ece59e78249973d29bf994257d5877b5ca619db5faf030

See more details on using hashes here.

File details

Details for the file prismh.core-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for prismh.core-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d16341ee973146bc779c0a59dc03900d7b70cf60ca9f1856a25690cd8d81147f
MD5 d37af7c524a25c6c36ca886478cb098f
BLAKE2b-256 496b17a276a8236bf0553f6a523f506aaf110557f147e7e842d531ee07ab44a5

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