This project has been archived by its maintainers, and is no longer receiving any updates.
cazart
Flask + schema = cazart!
cazart is a small helper for writing schematized JSON endpoints with Flask. It rolls
schema into Flask's route decorator, allowing
for one-shot route and schema specification.
Installation
cazart requires Python 3.6 or newer.
pip3 install cazart
Usage
To use cazart, just swap your Flask instance out for a Cazart one:
from cazart import Cazart
app = Cazart(__name__)
You can access all of Flask's baseline functionality (including non-validated routes)
via app.flask.
Then, use app.route to specify a combination route and schema:
from cazart import Cazart
from schema import Schema, Or
app = Cazart(__name__)
@app.route("/cazart", schema=Schema({"name": Or("alice", "bob", "mary")}))
def cazart(res):
print(f"my verified payload is {res}!")
return ("ok", 200)
See the examples for full usage examples, including custom error handling and dispatching to different schemas on a route based on HTTP method.
Metadata
Release files for cazart 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cazart-0.0.5.tar.gz | 3.6 kB | Without provenance | Details |
Release files / cazart-0.0.5.tar.gz
| Download URL | cazart-0.0.5.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ecb88195ca4eb9dadd47b4d06186dec1d5cee2032c9955f1abdc398bbda648ac
|
|
BLAKE2b-256 checksum How to use checksums |
4d194aea453d4dab74cabec96347aee4288dfa15dd9beafb93aaa2d87c761af2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|
Security for cazart 0.0.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.