14.1. Welcome to reschema’s documentation!¶
reschema
is a library for parsing reschema service definition
objects that describe a REST API. The service defintion format is
described in fully in Service Definition Specification. The package includes
tools for load and processing service definitions, generating API
documentation, and validating data according to schemas defined in the
service defintion.
Quick example:
# Load a service definition for a 'Bookstore' service
>>> bookstore_def = ServiceDef.create_from_file('bookstore.yaml')
# Get the 'author' resource
>>> author_res = bookstore_def.resources['author']
# Define an author and validate that the format is correct
>>> author = dict(id=5, name='John Doe')
>>> author_res.validate(author)
This Python module is useful for processing service definition files,
but it is frequently used in conjunction with sleepwalker
, another
module that provides a simple interface for interacting with servers
that implement services according to a reschema-based service definition.