Skip to main content

💧 nwss-data-standard

A marshmallow schema for the National Wastewater Surveillance System.

Usage

Installation

# 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 .

See Data dictionary version compatibility for historical versions of the schema.

Data dictionary version compatibility

The CDC uses semantic versioning to track changes to the expected format for DCIPHER uploads. This table maps versions of the nwss Python package to versions of the data dictionary.

Package version CDC version
1.0.0 2.0.2
1.0.1 2.0.3

You can retrieve the CDC version from the nwss module for use in your scripts:

>>> import nwss
>>> print(nwss.CDC_VERSION)
'2.0.2'

Demo

On the web

Head to https://datamade.github.io/nwss-data-standard/ to validate a file against the standard!

In 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!')

Development

Patches and pull requests

Your patches are welcome. Here's our suggested workflow:

  • Fork the project.
  • Create a new branch, then make your feature addition or bug fix.
  • Send us a pull request with a description of your work.

Python Schema

Install the app locally.

git clone https://github.com/datamade/nwss-data-standard.git && cd nwss-data-standard
pip install -e .[dev]

Make your changes, then run the tests.

pytest

JSON Schema

nwss comes with a Python implementation of the NWSS schema, as well as a convenience script to translate it to a JSON schema:

python3 -m nwss.dump_to_jsonschema > schema.json

Much of the JSON schema is determined by the marshmallow schema, however some conditional validation is written into the convenience script. You may need to update the script to make your desired change.

Demo

Run a local server and auto-bundle your scripts:

npm run develop

Navigate to the app: http://localhost:8000/docs/

Errors and bugs

If something is not behaving intuitively, it is a bug and should be reported. Report it here by creating an issue: https://github.com/datamade/nwss-data-standard/issues

Help us fix the problem as quickly as possible by following Mozilla's guidelines for reporting bugs.

Copyright (c) 2021 DataMade. Released under the MIT License.

Metadata

Release files for nwss 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nwss 1.0.1
File Size Uploaded
nwss-1.0.1.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nwss 1.0.1
File Interpreter ABI Platform
nwss-1.0.1-py2-none-any.whl Python 2 none any Details

Total release size: 22.7 kB

Release files / nwss-1.0.1.tar.gz

Download URL nwss-1.0.1.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e505d72207e6a8613ba22a23802906198a878acb33d207c2da1fc3ecc376c7f5
BLAKE2b-256 checksum
How to use checksums
32d68e50f410a114f65aecaf0053231a3973fb1a67f232c52b9339ceb6d455af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/2.7.17

Release files / nwss-1.0.1-py2-none-any.whl

Download URL nwss-1.0.1-py2-none-any.whl
Size 11.5 kB
Tags Python 2
SHA-256 checksum
How to use checksums
3326ec9991f746ef64394b55b9f1b866dadc16869bdcf3098fe469bfa8a651c9
BLAKE2b-256 checksum
How to use checksums
02c5a0271dc4386071b28bef05368ceb231eadbc54d908cd6876428f231c5bae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/2.7.17

Release history Release notifications | RSS feed

2.0.2

1 release file

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page