Cerberus plugin
Cerberus plugin for bottle
installation
Via pip: pip install bottle-cerberus
Or clone: git clone https://github.com/agalera/bottle-cerberus.git
example:
from bottle import get, install, run
from bottle_cerberus import CerberusPlugin, Schema
class ExampleSchema(Schema):
def schema(self):
return {
'ex': {'type': 'integer'},
'url': {'ex': {'coerce': int}}
}
class QuerySchema(Schema):
def schema(self):
return {'ex': {'coerce': int}}
@get('/cerberus/<ex>', schemas={'body': ExampleSchema(),
'query_string': QuerySchema())
def test_cerberus(ex):
from bottle import request
print("query_string", request.query['ex'], type(request.query['ex']))
print("url", ex, type(ex))
print("body", request.json.get('ex'), type(request.json.get('ex')))
install(CerberusPlugin())
run(host="0.0.0.0", port="9988")
Schemas
Optional keys
body: schema for request.json
url: schema for url (no query string)
query_string: schema for query strings
Schema
Github Schema: https://github.com/nicolaiarocci/cerberus Doc schema: http://docs.python-cerberus.org/en/stable/
Metadata
Release files for bottle-cerberus 1.1.3
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 | Actions |
|---|---|---|---|---|
| bottle-cerberus-1.1.3.tar.gz | 2.9 kB | Without provenance | Details for bottle-cerberus-1.1.3.tar.gz |
Release files / bottle-cerberus-1.1.3.tar.gz
| Download URL | bottle-cerberus-1.1.3.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acab587437745187934372e3af5ab09cc47032749c8fa0350776d33f0c34ffc1
|
|
BLAKE2b-256 checksum How to use checksums |
ff8e5ad7ba2a2d497bd64376397937f2574936736aab41d10326339fcd91801a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for bottle-cerberus 1.1.3
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.