国家废水监测系统的 marshmallow 架构
项目描述
💧 nwss-data-standard
针对 国家废水监测系统 的 marshmallow
架构。
用法
安装
# Install from PyPI
pip install nwss
# Install local copy
git clone https://github.com/datamade/nwss-data-standard.git && cd nwss-data-standard
pip install .
有关该架构的历史版本,请参阅 数据字典版本兼容性。
数据字典版本兼容性
疾病控制中心使用语义版本控制来跟踪 DCIPHER上传预期格式 的更改。此表将 nwss
Python包的版本映射到数据字典的版本。
包版本 | CDC版本 |
---|---|
1.0.0 | 2.0.2 |
1.0.1 | 2.0.3 |
您可以从 nwss
模块中检索CDC版本,用于您的脚本
>>> import nwss
>>> print(nwss.CDC_VERSION)
'2.0.2'
演示
在网络上
前往 https://datamade.github.io/nwss-data-standard/ 以验证文件是否符合标准!
在Python中
from marshmallow import ValidationError
from nwss.schemas import WaterSampleSchema
sample_data = [
# array of dictionaries
]
schema = WaterSampleSchema(many=True)
try:
schema.load(sample_data)
except ValidationError as e:
print(e.messages)
else:
print('Data is valid!')
开发
补丁和拉取请求
欢迎您的补丁。以下是我们的建议工作流程
- 分支项目。
- 创建一个新的分支,然后添加您的功能或修复错误。
- 向我们发送包含您工作描述的拉取请求。
Python Schema
在本地安装应用程序。
git clone https://github.com/datamade/nwss-data-standard.git && cd nwss-data-standard
pip install -e .[dev]
进行更改,然后运行测试。
pytest
JSON Schema
nwss
随带 NWSS 架构的 Python 实现,以及一个方便的脚本,可以将它转换为 JSON 架构
python3 -m nwss.dump_to_jsonschema > schema.json
大部分 JSON 架构由 marshmallow
架构决定,但是一些条件验证被写入方便的脚本中。您可能需要更新脚本以实现所需更改。
演示
运行本地服务器并自动打包脚本
npm run develop
导航到应用程序: http://localhost:8000/docs/
错误和问题
如果某些内容不符合直观行为,则表示存在错误,应予以报告。请在此创建问题: https://github.com/datamade/nwss-data-standard/issues
通过遵循 Mozilla 的错误报告指南。
版权和归属
版权(c)2021 DataMade。在 MIT 许可证 下发布。
项目详情
下载文件
下载您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。
源分布
nwss-1.0.1.tar.gz (11.2 kB 查看哈希值)
构建分布
nwss-1.0.1-py2-none-any.whl (11.5 kB 查看哈希值)