Some toolkits for RESTful API development in Pyramid.
Project description
A toolkit for RESTful API development in Pyramid.
That includes:
JSON renderer
HTTP Auth Policy (Basic, Digest)
Some utilities to work with SQLAlchemy, CQLEngine
API
To use it, just
This will do those jobs:
Add JSON as default renderer with some default adapters. You can access it through pyramid_restful_toolkit.default_renderer
Add some error handlers for common validators library such as: formencode, colander, schema.
If you want all uncaught exception has return as JSON text. Just include tween pyramid_restful_toolkit.jsonize_uncaught_exception_tween_factory. This is normally used in production.ini.
HTTP Auth Policy
To use this package, in the app function, just include it.
config.include(“pyramid_restful_toolkit.auth”)
In you development.ini
pyramid_restful_toolkit.auth.get_user_callback = ‘path to get user function’
You can use built-in model:
For SQLAlchemy
config.include(“pyramid_restful_toolkit.auth.models.sqlalchemy”)
with development.ini
pyramid_restful_toolkit.auth.dbsession = app.models.DBSession
Use pyramid_restful_toolkit.auth.models.sqlalchemy.RESTfulUser to manage your users. Its table name is rest_user.
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
Hashes for pyramid_restful_toolkit-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5db3a2dc7d52938a831b9ff07aa6df7f7b2565f81468da8c078fcb38a1a1b0b4 |
|
MD5 | 53818c75eb466545c0df2667d51fb2e2 |
|
BLAKE2b-256 | 87f365b80e2240ea6c4bc51d8a912d8b1f5dfba63f7eea83e24c6d63908367e2 |