Skip to main content

Python microservice framework

Project description

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

Project hompage: https://github.com/palankai/pyrs-schema

Documentation: http://pyrs-schema.readthedocs.org/

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)
writer.validate(data) # raise exception if it someting bad happen
jsonstring = writer.write(data) # The validation also happens
jsonschemastr = writer.writeschema()

Features

  • Easy schema definition

  • Schema validation

  • Decoupled serialisation

  • Extensibe 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 JSONSchema 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!

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

pyrs-schema-0.5.4.tar.gz (20.9 kB view details)

Uploaded Source

File details

Details for the file pyrs-schema-0.5.4.tar.gz.

File metadata

  • Download URL: pyrs-schema-0.5.4.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyrs-schema-0.5.4.tar.gz
Algorithm Hash digest
SHA256 bdb373b8925021762197993473ca9262999d9f6a3a0a26e73c3c69bc9cd677c0
MD5 d83ae0b997e5f85f39f9c41f8ca7b1c4
BLAKE2b-256 36d1af4e8dadc5e9cfc8b3733103e58688bd17797997e580855f0fbd431fad9a

See more details on using hashes here.

Supported by

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