Skip to main content

nadia: create marshmallow Schemas OpenAPI 3 objects.

License: MIT Build Status Documentation Status codecov

nadia is a small and lightweight library for creating marshmallow Schemas from schemas defined in your OpenAPI spec.

Basic usage

import yaml
import nadia.api

with open('petstore.yaml') as petstore:
    data = yaml.load(petstore)

builder = nadia.api.SchemaBuilder.create()
schema = builder.build(data['components']['schemas']['Pet'])

valid_pet = {'id': 100, 'name': 'Doggo', 'tag': 'sometag'}
invalid_pet = {'id': 'foo', 'name': 'Lessie', 'tag': ['tag1', 'tag2']}

print('Validation errors for Doggo: {}'.format(schema.validate({'content': valid_pet})))
print('Validation errors for Lessie: {}'.format(schema.validate({'content': invalid_pet})))

Documentation

Documentation can be found at http://nadia.readthedocs.io/en/latest/

Feature overview

Currently nadia supports all of the OpenAPI 3 data types, except allOf/anyOf fields. Most of the options like required, nullable, etc. are also supported.

Metadata

Release files for nadia 0.1.5

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

Source distribution (sdist)

Source distribution for nadia 0.1.5
File Size Uploaded Provenance
nadia-0.1.5.tar.gz 12.8 kB Without provenance Details

Release files / nadia-0.1.5.tar.gz

Download URL nadia-0.1.5.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
991c90196caac23e78459fa248d1114c8976ad3da3a180686c6d65f973120087
BLAKE2b-256 checksum
How to use checksums
383b2dda8883d5804081fa0d4fe1453c16f961dff145c26faba30a4093dd900c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for nadia 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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