Skip to content

A high level Python library for easily interacting with django-orchestra REST API using object oriented concepts.

License

Notifications You must be signed in to change notification settings

glic3rinu/orchestra-orm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

orchestra-orm

Orchestra-orm (aka Orchestra Object REST Mapper or Orchestra Object Resource Mapper) is a high level Python library for easily interacting with django-orchestra REST API using object oriented concepts.

Installation

pip install orchestra-orm

Design Considerations

The main goal of this library is to provide fast and easy access to Orchestra REST API: Open a Python interpreter and start interacting right away.

To achieve this goal we have borrowed some ideas from traditional SQL object relational mappers and applied them to an hypermedia-driven resource-oriented architecture (Orchestra).

This library has been heavily inspired by Django's ORM implementation; also using an Active Record like pattern, plus concurrency based on asynchronous non-blocking I/O and caching based on Identity Mapping.

Orchestra-orm leverages the HATEOAS discoverability of Orchestra's API; rather than relying on a predefined knowledge, resources and methods are autodiscovered on the fly, while browsing the API.

Our hope is that you can use this library to produce brief, readable and efficient code in a fun and effortless way :)

Object Oriented Modeling

The following diagram illustrates the classes used to model Orchestra REST API and how they relate to each other.

  • Api is a good starting point for browsing. It represents the Base resource of an API and it has links to Manager and Action. These relations are discovered from the Link header of the HTTP response.
  • Manager is used for accessing linked Collections and Resources.
  • Actions are used to represent action-like endpoints (i.e. get-auth-token). Actions are special methods that are not expressed using HTTP verbs (POST, GET, etc).
  • Collection is a list of uniform resources; all resources share the same media type (i.e. all registered nodes). For convinience it maintains a link back to its manager in order to proxy its methods.
  • Resource is a local representation of a remote resource (i.e. a node), basically a Resource is an object with a URI. It may contain nested resources, or RelatedCollections.
  • RelatedCollection is a subcollection that all its resources are related to the same parent (i.e. all slivers of a particular node). A RelatedCollection is able to construct a lookup for discovering its related Manager, therefore it is able to proxy its methods.
  • ResourceSet is a set container that can be used to perform concurrent operations over a set of non-uniform resources.

About

A high level Python library for easily interacting with django-orchestra REST API using object oriented concepts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages