Skip to main content
https://travis-ci.org/palankai/pyrs-schema.svg?branch=master https://coveralls.io/repos/palankai/pyrs-schema/badge.svg?branch=master&service=github Documentation Status

What is this package for

I’ve used different python frameworks for data serialisation many times. Mostly when I had to implement an API for my work. I felt many times those frameworks did good job but not extensible enough. Also writing easily an API which is satisfy every expectations of projects, without coupled restrictions sometimes really hard.

Nutshell

from pyrs import schema

class UserSchema(schema.Object):
    version = schema.Version(version='1.0')
    username = schema.StringField(required=True)
    password = schema.StringField(required=True, tags=['writeonly'])
    email = schema.EmailField(title='Registered email address')

writer = schema.JSONWriter(UserSchema)
jsonstring = writer.write(data) # The validation also happen

schemawriter = schema.JSONSchemaWriter()
jsonschemastr = writer.write(UserSchema)

Features

  • Easy schema definition

  • Schema validation

  • Decoupled serialisation, validation

  • Extensible API

Installation

The code is tested with python 2.7, 3.3, 3.4.

$ pip install pyrs-schema

Dependencies

See requirements.txt. But The goal is less dependency as possible. The main dependency is the python jsonchema The validation is using that package.

Notice that even it’s a JSON schema validator this work still can be used for any (compatible) schema validation.

Important caveats

This code is in beta version. I working hard on write stable as possible API in the first place but while this code in 0.x version you should expect some major modification on the API.

The ecosystem

This work is part of pyrs framework. The complete framework follow the same intention to implement flexible solution.

Contribution

I really welcome any comments! I would be happy if you fork my code or create pull requests. I’ve already really strong opinions what I want to achieve and how, though any help would be welcomed.

Feel free drop a message to me!

Release files for pyrs-schema 0.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrs-schema 0.7.3
File Size Uploaded
pyrs-schema-0.7.3.tar.gz 13.7 kB Details

Release files / pyrs-schema-0.7.3.tar.gz

Download URL pyrs-schema-0.7.3.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bc178d237e3a398a599f85d6848ec468a438c071beab30e090e95ca31e19951a
BLAKE2b-256 checksum
How to use checksums
33885d64b0baa5befba84632dddacdc1f6e69bd37a393858f89b0226a5a45390
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.7.3 This release

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7

1 release file

0.6

1 release file

0.5.4

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5

1 release file

0.4.1

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page