Skip to main content

Decorator syntax for marshmallow meta attributes (with inheritance)

Project description

marshmallow-meta

decorator syntax for marshmallow meta attributes (with inheritance)

Decorators communicate that the behavior of a class is being modified and are more concise when only a few meta attributes are needed. Making inheritance the default further reduces the boilerplate needed to make minor changes to a subclass.

Install

pip install marshmallow-meta
from marshmallow_meta import meta

API

@meta(*kwargs)

Build a meta class that inherits attributes from the base schema's meta class.

@meta(unknown=INCLUDE)
class Test(Schema):
    foo = fields.String()

@meta(*bases, **kwargs)

Inherit and extend specific meta classes.

@meta(Test.Meta, many=True)
class CopyCats(Schema):
   bar = fields.String()

Or clear the inherited meta class.

@meta(Schema.Meta)
class Fresh(CopyCats):
   buzz = fields.String()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marshmallow_meta-1.0.0a1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

marshmallow_meta-1.0.0a1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file marshmallow_meta-1.0.0a1.tar.gz.

File metadata

  • Download URL: marshmallow_meta-1.0.0a1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0rc2

File hashes

Hashes for marshmallow_meta-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 015e4dae825134cb23846a04d01971d617622ef5c6ee8b48930f1896685daed2
MD5 d4b44ddb7236876bb908035ec11acf69
BLAKE2b-256 a13c75a495f1d3e8f1f81ca71ef9233be5a15059f022de311084cf55dfb08e1b

See more details on using hashes here.

File details

Details for the file marshmallow_meta-1.0.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for marshmallow_meta-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 c91ec86bec8eddbe8b56cf13f713b653bb85f66370924fba546ff5a4e9b1dd52
MD5 6d677978193d3672e9da850fdf4d4be4
BLAKE2b-256 56aa4e8f23bc36f92edfe99e816129660b4e1386ae7a48f0e865e894894a1e7d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page