All Projects → marshmallow-code → Marshmallow

marshmallow-code / Marshmallow

Licence: mit
A lightweight library for converting complex objects to and from simple Python datatypes.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Marshmallow

Schematics
Project documentation: https://schematics.readthedocs.io/en/latest/
Stars: ✭ 2,461 (-57.98%)
Mutual labels:  schema, validation, serialization, deserialization
Typical
Typical: Fast, simple, & correct data-validation using Python 3 typing.
Stars: ✭ 111 (-98.1%)
Mutual labels:  serde, validation, serialization, deserialization
serde
🚝 (unmaintained) A framework for defining, serializing, deserializing, and validating data structures
Stars: ✭ 49 (-99.16%)
Mutual labels:  serialization, schema, serde, deserialization
Awesome Python Models
A curated list of awesome Python libraries, which implement models, schemas, serializers/deserializers, ODM's/ORM's, Active Records or similar patterns.
Stars: ✭ 124 (-97.88%)
Mutual labels:  schema, validation, serialization, deserialization
Colander
A serialization/deserialization/validation library for strings, mappings and lists.
Stars: ✭ 408 (-93.03%)
Mutual labels:  validation, serialization, deserialization
Typesystem
Data validation, serialization, deserialization & form rendering. 🔢
Stars: ✭ 416 (-92.9%)
Mutual labels:  validation, serialization, deserialization
Marshmallow Jsonapi
JSON API 1.0 (https://jsonapi.org/) formatting with marshmallow
Stars: ✭ 203 (-96.53%)
Mutual labels:  validation, serialization, deserialization
Strictyaml
Type-safe YAML parser and validator.
Stars: ✭ 836 (-85.73%)
Mutual labels:  schema, validation, serialization
Beeschema
Binary Schema Library for C#
Stars: ✭ 46 (-99.21%)
Mutual labels:  schema, serialization, deserialization
avro-serde-php
Avro Serialisation/Deserialisation (SerDe) library for PHP 7.3+ & 8.0 with a Symfony Serializer integration
Stars: ✭ 43 (-99.27%)
Mutual labels:  serialization, serde, deserialization
har-rs
A HTTP Archive format (HAR) serialization & deserialization library, written in Rust.
Stars: ✭ 25 (-99.57%)
Mutual labels:  serialization, serde, deserialization
kafka-protobuf-serde
Serializer/Deserializer for Kafka to serialize/deserialize Protocol Buffers messages
Stars: ✭ 52 (-99.11%)
Mutual labels:  serialization, serde, deserialization
Jackson Module Kotlin
Module that adds support for serialization/deserialization of Kotlin (http://kotlinlang.org) classes and data classes.
Stars: ✭ 830 (-85.83%)
Mutual labels:  hacktoberfest, serialization, deserialization
avrow
Avrow is a pure Rust implementation of the avro specification https://avro.apache.org/docs/current/spec.html with Serde support.
Stars: ✭ 27 (-99.54%)
Mutual labels:  serialization, schema, deserialization
hapic
Input/Output/Error management for your python controllers with Swagger doc generation
Stars: ✭ 18 (-99.69%)
Mutual labels:  serialization, validation, deserialization
Schema Generator
PHP Model Scaffolding from Schema.org and other RDF vocabularies
Stars: ✭ 379 (-93.53%)
Mutual labels:  hacktoberfest, schema
Specs
Technical specifications and guidelines for implementing Frictionless Data.
Stars: ✭ 403 (-93.12%)
Mutual labels:  schema, validation
Handyjson
A handy swift json-object serialization/deserialization library
Stars: ✭ 3,913 (-33.19%)
Mutual labels:  serialization, deserialization
Ysoserial
A proof-of-concept tool for generating payloads that exploit unsafe Java object deserialization.
Stars: ✭ 4,808 (-17.91%)
Mutual labels:  serialization, deserialization
Flatcc
FlatBuffers Compiler and Library in C for C
Stars: ✭ 434 (-92.59%)
Mutual labels:  schema, serialization

marshmallow: simplified object serialization

Latest version Build status Documentation code style: black

marshmallow is an ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, to and from native Python datatypes.

from datetime import date
from pprint import pprint

from marshmallow import Schema, fields


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


class AlbumSchema(Schema):
    title = fields.Str()
    release_date = fields.Date()
    artist = fields.Nested(ArtistSchema())


bowie = dict(name="David Bowie")
album = dict(artist=bowie, title="Hunky Dory", release_date=date(1971, 12, 17))

schema = AlbumSchema()
result = schema.dump(album)
pprint(result, indent=2)
# { 'artist': {'name': 'David Bowie'},
#   'release_date': '1971-12-17',
#   'title': 'Hunky Dory'}

In short, marshmallow schemas can be used to:

  • Validate input data.
  • Deserialize input data to app-level objects.
  • Serialize app-level objects to primitive Python types. The serialized objects can then be rendered to standard formats such as JSON for use in an HTTP API.

Get It Now

$ pip install -U marshmallow

Documentation

Full documentation is available at https://marshmallow.readthedocs.io/ .

Requirements

  • Python >= 3.6

Ecosystem

A list of marshmallow-related libraries can be found at the GitHub wiki here:

https://github.com/marshmallow-code/marshmallow/wiki/Ecosystem

Credits

Contributors

This project exists thanks to all the people who contribute.

You're highly encouraged to participate in marshmallow's development. Check out the Contributing Guidelines to see how you can help.

Thank you to all who have already contributed to marshmallow!

Contributors

Backers

If you find marshmallow useful, please consider supporting the team with a donation. Your donation helps move marshmallow forward.

Thank you to all our backers! [Become a backer]

Backers

Sponsors

Support this project by becoming a sponsor (or ask your company to support this project by becoming a sponsor). Your logo will show up here with a link to your website. [Become a sponsor]

Sponsors Become a sponsor

Professional Support

Professionally-supported marshmallow is now available through the Tidelift Subscription.

Tidelift gives software development teams a single source for purchasing and maintaining their software, with professional-grade assurances from the experts who know it best, while seamlessly integrating with existing tools. [Get professional support]

Get supported marshmallow with Tidelift

Security Contact Information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Project Links

License

MIT licensed. See the bundled LICENSE file for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].