Giter Site home page Giter Site logo

tbone-framework / tbone Goto Github PK

View Code? Open in Web Editor NEW
35.0 2.0 3.0 623 KB

Full duplex RESTful API for your asyncio web apps

Home Page: http://tbone.io

License: MIT License

Python 100.00%
python3 asyncio restful-api rest rest-api mongodb websockets sanic aiohttp odm nonblocking async-await restful restful-webservices python tbone

tbone's Introduction

TBone

logo

Build Status PyPI version Python License: MIT Waffle.io - Issues in progress Gitter chat

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:

  1. Data Structure - an ODM-like modeling mechanism for schema declaration, data validation and serialization
  2. Data Persistency - Persistency mixin classes for document stores with a full implementation over MongoDB
  3. Resources - Mechanism for creating full-duplex RESTful APIs over HTTP and Websockets
  4. 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

Documentation can be found here

tbone's People

Contributors

amitnabarro avatar shlomif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tbone's Issues

test database fixture creation modification

TBone.testing.fixtures contains a fixture for creating a test database. Currently the database name is hardcoded. Convert this to a parameterised fixture to allow selection of test database name

Upgrade to Motor >=2.0

Upgrade MongoCollectionMixin and MongoResource to work with Motor >=2.0 removing deprecated apis

Embedded model validation fail

When creating an instance of a model subclass, which contains embedded models (at least one field is of ModelField) then validation fails when providing no data to the embedded model

API schema support

Add automatic schema declaration for ModelResource based on model's serialisation rules.
This is useful for clients who wish to declare their models and collections dynamically based on fields serialized in the resource

Model field exclusion

Add 'exclude' list to Model Options class, allowing subclassed models to omit fields from the base class

gis support

add specialised MongoDB fields for jeoJson support.
This is a prerequisite for implementing geospatial query support

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.