Skip to main content
Marshmallow Factory
===================


Inspired by [Voluptuous](https://github.com/alecthomas/voluptuous).

It's sometimes inconvenient to define named
[Marshmallow](https://github.com/marshmallow-code/marshmallow)
Schemas, especially when those schemas are deeply nested.

Example:

```
class InnerSchema(Schema):
inner_bool = Boolean()


class MiddleSchema(Schema):
middle_int = Integer()
middle_nested = Nested(InnerSchema)


class OuterSchema(Schema):
outer_str = String()
outer_nested = Nested(MiddleSchema)


schema_instance = OuterSchema()
schema_instance.validate(input_)
```

So, this library provides a convenient syntax for defining
deeply nested Schemas.

```
from marshmallow_factory import schema

OuterSchema = schema({
'outer_str': String(),
'outer_nested': Nested(schema({
'middle_int': Integer(),
'middle_nested': Nested(schema({
'inner_bool': Boolean()
}))
}))
})

schema_instance = OuterSchema()
schema_instance.validate(input_)
```


Support For Meta Options
------------------------

Meta options are supported using the following syntax:

```
class Meta:
strict = True # or your other options

my_schema = schema({
'Meta': Meta,
'str': String()
})
```


Alternative Syntax
------------------

Schema factory arguments can also be supplied as keyword
arguments rather than a dictionary.

```
my_schema = schema(Meta=Meta, str=String())
```

For nested Schemas, plain dictionary literals can be provided
instead of Nested(schema({...}).

```
from marshmallow_factory import schema

OuterSchema = schema({
'outer_str': String(),
'outer_nested': {
'middle_int': Integer(),
'middle_nested': {
'inner_bool': Boolean()
}
}
})

schema_instance = OuterSchema()
schema_instance.validate(input_)
```


Metadata

Release files for marshmallow-factory 0.1.0

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

Source distribution (sdist)

Source distribution for marshmallow-factory 0.1.0
File Size Uploaded Provenance Actions
marshmallow_factory-0.1.0.tar.gz 2.9 kB Without provenance Details for marshmallow_factory-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for marshmallow-factory 0.1.0
File Interpreter ABI Platform Actions
marshmallow_factory-0.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for marshmallow_factory-0.1.0-py2.py3-none-any.whl

Total release size: 7.1 kB

Release files / marshmallow_factory-0.1.0.tar.gz

Download URL marshmallow_factory-0.1.0.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
33959508dfa0b26713b08eec4dcaace5bf02fdc5a7a38b1b0ef0ceeae519071a
BLAKE2b-256 checksum
How to use checksums
cc975162ba4fa100fe2218e9f1d77b0b497df287dfb8fd70c9e206d8efb6bd33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / marshmallow_factory-0.1.0-py2.py3-none-any.whl

Download URL marshmallow_factory-0.1.0-py2.py3-none-any.whl
Size 4.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
85e93720ec6ac310fc38abfd58cd2fb0ed18b6715cdb72562d020641984c5842
BLAKE2b-256 checksum
How to use checksums
93254806405f7e053c1ed9753095716bdc316cda5976ccef62c6e841fbb8aa00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for marshmallow-factory 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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