A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/encode/typesystem below:

encode/typesystem: Data validation, serialization, deserialization & form rendering. 🔢

Documentation: https://www.encode.io/typesystem/

TypeSystem is a comprehensive data validation library that gives you:

Python 3.6+

$ pip3 install typesystem

If you'd like you use the form rendering using jinja2:

$ pip3 install typesystem[jinja2]

If you'd like you use the YAML tokenization using pyyaml:

$ pip3 install typesystem[pyyaml]
import typesystem

artist_schema = typesystem.Schema(
    fields={
        "name": typesystem.String(max_length=100)
    }
)

definitions = typesystem.Definitions()
definitions["Artist"] = artist_schema

album_schema = typesystem.Schema(
    fields={
        "title": typesystem.String(max_length=100),
        "release_date": typesystem.Date(),
        "artist": typesystem.Reference("Artist", definitions=definitions)
    }
)

album = album_schema.validate({
    "title": "Double Negative",
    "release_date": "2018-09-14",
    "artist": {"name": "Low"}
})

print(album)
# {'title': 'Double Negative', 'release_date': '2018-09-14', 'artist': {'name': 'Low'}}

There are plenty of other great validation libraries for Python out there, including Marshmallow, Schematics, Voluptuous, Pydantic and many others.

TypeSystem exists because I want a data validation library that offers first-class support for:

— ⭐️ —

TypeSystem is BSD licensed code. Designed & built in Brighton, England.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4