All Projects → encode → Typesystem

encode / Typesystem

Licence: bsd-3-clause
Data validation, serialization, deserialization & form rendering. 🔢

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Typesystem

Colander
A serialization/deserialization/validation library for strings, mappings and lists.
Stars: ✭ 408 (-1.92%)
Mutual labels:  validation, serialization, deserialization, forms
Marshmallow Jsonapi
JSON API 1.0 (https://jsonapi.org/) formatting with marshmallow
Stars: ✭ 203 (-51.2%)
Mutual labels:  validation, serialization, deserialization
Marshmallow
A lightweight library for converting complex objects to and from simple Python datatypes.
Stars: ✭ 5,857 (+1307.93%)
Mutual labels:  validation, serialization, deserialization
hapic
Input/Output/Error management for your python controllers with Swagger doc generation
Stars: ✭ 18 (-95.67%)
Mutual labels:  serialization, validation, deserialization
Typical
Typical: Fast, simple, & correct data-validation using Python 3 typing.
Stars: ✭ 111 (-73.32%)
Mutual labels:  validation, serialization, 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 (-70.19%)
Mutual labels:  validation, serialization, deserialization
Schematics
Project documentation: https://schematics.readthedocs.io/en/latest/
Stars: ✭ 2,461 (+491.59%)
Mutual labels:  validation, serialization, deserialization
react-form-validation-demo
React Form Validation Demo
Stars: ✭ 88 (-78.85%)
Mutual labels:  validation, forms
valid8
Valid8 - Super Simple Bootstrap Form Valiation
Stars: ✭ 17 (-95.91%)
Mutual labels:  validation, forms
AvroConvert
Apache Avro serializer for .NET
Stars: ✭ 44 (-89.42%)
Mutual labels:  serialization, deserialization
js-form-validator
Javascript form validation. Pure JS. No jQuery
Stars: ✭ 38 (-90.87%)
Mutual labels:  validation, forms
dataconf
Simple dataclasses configuration management for Python with hocon/json/yaml/properties/env-vars/dict support.
Stars: ✭ 40 (-90.38%)
Mutual labels:  serialization, deserialization
jzon
A correct and safe JSON parser.
Stars: ✭ 78 (-81.25%)
Mutual labels:  serialization, deserialization
amq-protocol
AMQP 0.9.1 protocol serialization and deserialization implementation for Ruby (2.0+)
Stars: ✭ 47 (-88.7%)
Mutual labels:  serialization, deserialization
reflective-rapidjson
Code generator for serializing/deserializing C++ objects to/from JSON using Clang and RapidJSON
Stars: ✭ 26 (-93.75%)
Mutual labels:  serialization, deserialization
Maat
Validation and transformation library powered by deductive ascending parser. Made to be extended for any kind of project.
Stars: ✭ 27 (-93.51%)
Mutual labels:  serialization, validation
moonwlker
Jackson JSON without annotation.
Stars: ✭ 14 (-96.63%)
Mutual labels:  serialization, deserialization
React Hook Form
📋 React Hooks for form state management and validation (Web + React Native)
Stars: ✭ 24,831 (+5868.99%)
Mutual labels:  validation, forms
Inquiry Deprecated
[DEPRECATED]: Prefer Room by Google, or SQLDelight by Square.
Stars: ✭ 264 (-36.54%)
Mutual labels:  serialization, deserialization
Handyjson
A handy swift json-object serialization/deserialization library
Stars: ✭ 3,913 (+840.63%)
Mutual labels:  serialization, deserialization

TypeSystem

Build Status Coverage Package version


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


TypeSystem is a comprehensive data validation library that gives you:

  • Data validation.
  • Object serialization & deserialization.
  • Form rendering.
  • Marshaling validators to/from JSON schema.
  • Tokenizing JSON or YAML to provide positional error messages.
  • 100% type annotated codebase.
  • 100% test coverage.
  • Zero hard dependencies.

Requirements

Python 3.6+

Installation

$ pip3 install typesystem

If you'd like you use the form rendering you'll also want to install jinja2.

$ pip3 install jinja2

If you'd like you use the YAML tokenization you'll also want to install pyyaml.

$ pip3 install pyyaml

Quickstart

import typesystem

class Artist(typesystem.Schema):
    name = typesystem.String(max_length=100)

class Album(typesystem.Schema):
    title = typesystem.String(max_length=100)
    release_date = typesystem.Date()
    artist = typesystem.Reference(Artist)

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

print(album)
# Album(title='Double Negative', release_date=datetime.date(2018, 9, 14), artist=Artist(name='Low'))

print(album.release_date)
# datetime.date(2018, 9, 14)

print(album['release_date'])
# '2018-09-14'

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

Alternatives

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:

  • Rendering validation classes into HTML forms.
  • Marshaling to/from JSON Schema.
  • Obtaining positional errors within JSON or YAML documents.

— ⭐️ —

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

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].