Skip to main content

Marshmallow plugin

Marshmallow plugin for bottle

installation

Via pip: pip install bottle-marshmallow

Or clone: git clone https://github.com/agalera/bottle-marshmallow.git

example:

from bottle import post, install, run
from bottle_marshmallow import MarshmallowPlugin
from marshmallow import Schema, fields


class ExampleSchema(Schema):
    name = fields.Str()


class QuerySchema(Schema):
    name = fields.Str()


@post('/marshmallow/<ex>', schemas={'body': ExampleSchema,
                                    'query_string': QuerySchema})
def test_marshmallow(validated, ex):
    print(validated)

install(MarshmallowPlugin())
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

marshmallow: http://marshmallow.readthedocs.io

Release files for bottle-marshmallow 1.0.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 bottle-marshmallow 1.0.5
File Size Uploaded
bottle-marshmallow-1.0.5.tar.gz 2.6 kB Details

Release files / bottle-marshmallow-1.0.5.tar.gz

Download URL bottle-marshmallow-1.0.5.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
deb91abd582d83d24e91b77fab74ac3c136a680097d9095f3353adf1c3dec836
BLAKE2b-256 checksum
How to use checksums
d7fa0c5ca13841d7b0d85fbc73bbd11f5eaf4cdee1ca56382d9f16763328fb20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release history Release notifications | RSS feed

This release

1.0.5 This release

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

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