prismh文件的解析和验证库

prismh.core的Python项目详细描述


Build StatusDocumentation Statushttps://img.shields.io/pypi/v/prismh.core.svghttps://img.shields.io/pypi/l/prismh.core.svg

小心!

此程序包已退出,取而代之的是rios.core。请尽快升级。

prismh.core概述

prismh.core是一个Python包,提供基本验证和 符合PRISMH的数据结构的格式化功能 规格。

示例用法

这个包公开了一些用于验证和 格式化标准prismh数据结构:

>>> 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"
    }
  ]
}

有关可用功能的更多信息,请阅读api 文档。

贡献

我们非常欢迎对此包的贡献和/或修复。请提交 通过分叉此存储库并创建一个包含 变化。我们要求您包括单元测试和任何适当的 文档更新以及代码更改。

这个项目将遵循Semantic Versioning方法,就像 可能,因此在生成依赖项目时,请使用适当的版本 限制。

通过执行 以下内容:

$ virtualenv prismh
$ cd prismh
$ . bin/activate
$ hg clone ssh://hg@bitbucket.org/prometheus/prismh.core
$ pip install -e ./prismh.core[dev]

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何为纯Java应用程序启用ProGuard缩小?   java决定在GitHub上上载哪些文件   java如何编写SQL查询以从两个表中获取数据   java无法初始化类org。springframework。aop。框架DefaultAOpproxy工厂   如何在安卓中将kotlin集转换为java   更改程序中的java字符串、子字符串和ifelse语句   java Spring自动添加“XTotalCount”头   在Java中获取日期范围内的所有星期五   javafx滚动窗格不允许请求聚焦于某个字段   java如何在并行flux内的同一线程中运行mono   线程“main”java中的安装启动4j异常。lang.NoClassDefFoundError:javax/mail/MessaginException   java从GWT CellTable获取所有对象   java按钮视图即使在将其可见性设置为true后也不可见   java Spring 3.0处理文件上载问题   java Chromedriver元素在点(xxx,yyy)处不可单击。其他元素将收到单击:   java系统。加载抛出NoSuchMethodError   在Java中打开文件时出错   java子类何时以及为什么要声明父类的静态实例成员?