Skip to main content
Restifier is a python library for creating and documenting RESTful APIs.
It includes a middleware component, a set of decorators, and a “forms” library for validating/documenting requests. The middle generates a Swagger compatible JSON specification for the APIs automatically.

Author

Jesse Lovelace jesse@hawatian.com

License

The MIT License

Usage

See tests.py for information on usage. In general, so create a payload validator construct a class like this:

class HelloMessage(Message):
    greeting = StringProperty(description="The greating.",
        validators=[regex(re.compile('^[A-Za-z]+$')), required()])

class HelloResponseMessage(Message):
    salutation = StringProperty(description="The response.")
    tags = StringProperty(repeated=True)
    request = StructuredProperty(HelloMessage)

Then decorate your handlers like this:

class HelloHandler(RequestHandler):

    @api(input=HelloMessage, output=HelloResponseMessage)
    def post(self, obj):
        return {'salutation':'You are the best.'}

Also, to auto-document, use the middleware:

routes = [
    ('/api/v1/hello', HelloHandler)
]

app = DocumentedMiddleware(
    WSGIApplication(routes),
    api_base="/api/v1",
    api_overview="This is a super important API that does a lot of stuff."
)

Metadata

Release files for restifier 1.0.4

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

Source distribution (sdist)

Source distribution for restifier 1.0.4
File Size Uploaded Provenance
restifier-1.0.4.tar.gz 15.0 kB Without provenance Details

Release files / restifier-1.0.4.tar.gz

Download URL restifier-1.0.4.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d8122e2a4950684358fc08b475cc5fe5799b327c4abbfdfc61820a94e8286cd0
BLAKE2b-256 checksum
How to use checksums
82be0a456fa73912ce287a05aa15aa28ae0aff8c53abbc5118900965f0b234c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for restifier 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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