Full-duplex RESTful APIs for asyncio web applications
Project description
TBone makes it easy to develop full-duplex RESTful APIs on top of your asyncio web application or webservice. It uses a nonblocking asynchronous web server and provides the neccesary infrastructure to build asynchronous web apps and services. TBone is web-server agnostic and can be added on top of your Sanic or Aiohttp app.
TBone is comprised of 4 major modules:
Data Structure - an ODM-like modeling mechanism for schema declaration, data validation and serialization
Data Persistency - Persistency mixin classes for document stores with a full implementation over MongoDB
Resources - Mechanism for creating full-duplex RESTful APIs over HTTP and Websockets
Dispatch - Classes for managing internal and external events.
Combining the usage of these 4 modules makes it extremely easy to build full-duplex RESTful APIs on top of your MongoDB datastore.
Disclaimer
TBone is currently in Alpha stage. It may still have some bugs in the code, and some typos in the documentation. The APIs may change before an official release is made.
Example
The following example demonstrates the creation of a model schema and the corresponding RESTful resource
class Book(Model, MongoCollectionMixin):
_id = ObjecIdField(primary_key=True)
title = StringField(required=True)
author = StringField(required=True)
publication_date = DateTimeField()
class BookResource(AioHttpResource, MongoResource):
class Meta:
object_class = Book
Nonblocking
TBone was designed to develop asynchorous web applications and web services. The entire infrastructure was built around coroutines. TBone utilizes only asynchronous 3rd party components to make sure that your app is truly nonblocking.
Requirements
TBone uses the async/await syntax and is limited to Python version 3.5 and up.
Furthermore, TBone has some very few basic requirements. However, depending on its usage requires additional packages may be required.
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file tbone-0.5.0.4.tar.gz
.
File metadata
- Download URL: tbone-0.5.0.4.tar.gz
- Upload date:
- Size: 39.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84a9172ffc39821cddf1535cd32f50a654e44859344ee5aa4c9e7b6d14a5e042 |
|
MD5 | d820ef7903db416591d7c42618ea0b33 |
|
BLAKE2b-256 | 27771b68f1001a098438f618a4b9db283eb923769d640b4f1145e13c9d082940 |