All Projects → schematics → Schematics

schematics / Schematics

Licence: other
Project documentation: https://schematics.readthedocs.io/en/latest/

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Schematics

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 (-94.96%)
Mutual labels:  schema, validation, serialization, deserialization
Marshmallow
A lightweight library for converting complex objects to and from simple Python datatypes.
Stars: ✭ 5,857 (+137.99%)
Mutual labels:  schema, validation, serialization, deserialization
Marshmallow Jsonapi
JSON API 1.0 (https://jsonapi.org/) formatting with marshmallow
Stars: ✭ 203 (-91.75%)
Mutual labels:  validation, serialization, deserialization
serde
🚝 (unmaintained) A framework for defining, serializing, deserializing, and validating data structures
Stars: ✭ 49 (-98.01%)
Mutual labels:  serialization, schema, deserialization
hapic
Input/Output/Error management for your python controllers with Swagger doc generation
Stars: ✭ 18 (-99.27%)
Mutual labels:  serialization, validation, deserialization
Colander
A serialization/deserialization/validation library for strings, mappings and lists.
Stars: ✭ 408 (-83.42%)
Mutual labels:  validation, 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 (-98.9%)
Mutual labels:  serialization, schema, deserialization
Typesystem
Data validation, serialization, deserialization & form rendering. 🔢
Stars: ✭ 416 (-83.1%)
Mutual labels:  validation, serialization, deserialization
Strictyaml
Type-safe YAML parser and validator.
Stars: ✭ 836 (-66.03%)
Mutual labels:  schema, validation, serialization
Beeschema
Binary Schema Library for C#
Stars: ✭ 46 (-98.13%)
Mutual labels:  schema, serialization, deserialization
Typical
Typical: Fast, simple, & correct data-validation using Python 3 typing.
Stars: ✭ 111 (-95.49%)
Mutual labels:  validation, serialization, deserialization
Flatsharp
Fast, idiomatic C# implementation of Flatbuffers
Stars: ✭ 133 (-94.6%)
Mutual labels:  serialization, deserialization
Pandasschema
A validation library for Pandas data frames using user-friendly schemas
Stars: ✭ 135 (-94.51%)
Mutual labels:  schema, validation
Framework
Strongly-typed JavaScript object with support for validation and error handling.
Stars: ✭ 136 (-94.47%)
Mutual labels:  schema, validation
Pyjson tricks
Extra features for Python's JSON: comments, order, numpy, pandas, datetimes, and many more! Simple but customizable.
Stars: ✭ 131 (-94.68%)
Mutual labels:  serialization, deserialization
Deku
Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization
Stars: ✭ 136 (-94.47%)
Mutual labels:  serialization, deserialization
Node Convict
Featureful configuration management library for Node.js
Stars: ✭ 1,855 (-24.62%)
Mutual labels:  schema, validation
Nope Validator
A small, simple and fast JS validator. Like, wow thats fast. 🚀
Stars: ✭ 142 (-94.23%)
Mutual labels:  schema, validation
Orjson
Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy
Stars: ✭ 2,595 (+5.44%)
Mutual labels:  serialization, deserialization
Borer
Efficient CBOR and JSON (de)serialization in Scala
Stars: ✭ 131 (-94.68%)
Mutual labels:  serialization, deserialization

Schematics

Python Data Structures for Humans™.

Build Status Coverage

About

Project documentation: https://schematics.readthedocs.io/en/latest/

Schematics is a Python library to combine types into structures, validate them, and transform the shapes of your data based on simple descriptions.

The internals are similar to ORM type systems, but there is no database layer in Schematics. Instead, we believe that building a database layer is easily made when Schematics handles everything except for writing the query.

Schematics can be used for tasks where having a database involved is unusual.

Some common use cases:

Example

This is a simple Model.

>>> from schematics.models import Model
>>> from schematics.types import StringType, URLType
>>> class Person(Model):
...     name = StringType(required=True)
...     website = URLType()
...
>>> person = Person({'name': u'Joe Strummer',
...                  'website': 'http://soundcloud.com/joestrummer'})
>>> person.name
u'Joe Strummer'

Serializing the data to JSON.

>>> import json
>>> json.dumps(person.to_primitive())
{"name": "Joe Strummer", "website": "http://soundcloud.com/joestrummer"}

Let's try validating without a name value, since it's required.

>>> person = Person()
>>> person.website = 'http://www.amontobin.com/'
>>> person.validate()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "schematics/models.py", line 231, in validate
    raise DataError(e.messages)
schematics.exceptions.DataError: {'name': ['This field is required.']}

Add the field and validation passes.

>>> person = Person()
>>> person.name = 'Amon Tobin'
>>> person.website = 'http://www.amontobin.com/'
>>> person.validate()
>>>

Testing & Coverage support

Run coverage and check the missing statements.

$ coverage run --source schematics -m py.test && coverage report
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].