Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/caxiam/model-api
For modeling remote APIs in an ORM fashion.
https://github.com/caxiam/model-api
Last synced: 2 months ago
JSON representation
For modeling remote APIs in an ORM fashion.
- Host: GitHub
- URL: https://github.com/caxiam/model-api
- Owner: caxiam
- License: other
- Created: 2016-03-22T06:31:26.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-08T18:31:19.000Z (over 8 years ago)
- Last Synced: 2024-08-03T17:09:23.311Z (6 months ago)
- Language: Python
- Size: 43 KB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-python-models - model-api - For modeling remote APIs in an ORM fashion. (Model, Schema)
README
REST ORM
========
.. image:: https://readthedocs.org/projects/model-api/badge/?version=latest
:target: http://model-api.readthedocs.org/en/latest/?badge=latest
:alt: Documentation StatusREST ORM is a library for interacting with structured data sources.
.. code-block:: python
from bogus import http # http client of your choice
from rest_orm import fields, modelsclass GoogleModel(models.AdaptedModel):
id = fields.AdaptedInteger('[path][to][id]')
first_item = fields.AdaptedString('[items][0]')def make_request(self, id):
body = http.client.get('google.com/some/endpoint/{}'.format(id)).content
return body # {'path': {'to': {'id': id}}, 'items': ['some value!']}model = GoogleModel().connect(15)
assert model.id == 15
assert model.first_item == 'some value!'=============
Documentation
=============Full documentation is available at: http://model-api.readthedocs.org/en/latest/
============
Installation
============.. code-block:: bash
$ pip install git+git://github.com/caxiam/model-api.git
============
Requirements
============
Tested on Python 2.7.REST ORM does not require any external dependencies.
=======
License
=======
MIT