A tool for quickly creating REST/HATEOAS/Hypermedia APIs in python

Related tags

Web Frameworksripozo
Overview

ripozo

test status test coverage Documentation Status python versions stars

Ripozo is a tool for building RESTful/HATEOAS/Hypermedia apis. It provides strong, simple, and fully qualified linking between resources, the ability to expose available actions and necessary parameters on a resource, and exposing multiple REST protocols (i.e. SIREN and HAL). Finally, ripozo is highly extensible. It is able to integrate with any web framework or database and you can easily roll out your own REST protocols.

Why use ripozo?

  • Strong support for inter-resource linking (HATEOAS/Hypermedia)
  • Flexible (can be used with any web framework, database, or response protocol)
  • Fast development (especially when using the extensions, such as flask-ripozo or django-ripozo)
  • Ability to expose actions on resource from the web api (self-discoverability)

Examples

You'll need to create a dispatcher using one of the dispatchers included in the framework extensions. You can find a list of framework extensions in The ripozo ecosystem section. If it's not there you can always roll out your own.

Minimal

from ripozo import apimethod, adapters, ResourceBase
# import the dispatcher class for your preferred webframework

class MyResource(ResourceBase):
    @apimethod(methods=['GET'])
    def say_hello(cls, request):
        return cls(properties=dict(hello='world'))

# initialize the dispatcher for your framework
# e.g. dispatcher = FlaskDispatcher(app)
dispatcher.register_adapters(adapters.SirenAdapter, adapters.HalAdapter)
dispatcher.register_resources(MyResource)

And just like that, you have an api that can return either Siren or Hal formatted responses. Pretty easy, right?

Full CRUD+L

On the other hand, if you wanted a full CRUD+L (Create, Retrieve, Update, Delete, and List), you could use one of the manager extensions (django-ripozo, ripozo-sqlalchemy, and ripozo-cassandra all include ready to use base managers). There are slight differences on creating Manager classes and instances in the different extensions but at a core they all follow this format.

from ripozo import restmixins
from fake_ripozo_extension import Manager
from myapp.models import MyModel # An ORM model for example a sqlalchemy or Django model.

class MyManager(Manager):
    fields = ('id', 'field1', 'field2',)
    model = MyModel

class MyResource(restmixins.CRUDL):
    manager = MyManager()
    pks = ('id',)

# Create your dispatcher and register the resource...

It is important to note that there are restmixins for each of the individual CRUD+L (i.e. restmixins.Create, restmixins.Retrieve, etc.) actions that can be mixed and matched to your pleasure.

Links

The coolest part of ripozo is the ability to easily create fully qualified links between resources.

from ripozo import restmixins, Relationship

class MyResource(restmixins.CRUDL):
    manager = MyManager()
    pks = ('id',)
    _relationships = [Relationship('related', relation='RelatedResource')]

class RelatedResource(restmixins.CRUDL)
    manager = RelatedManager()
    pks = ('id',)

Now whenever you request MyResource you'll get a link pointing to the related resource.

Documentation

ripozo documentation

The ripozo ecosystem

Currently, ripozo has integrations with Django, Flask, SQLAlchemy, and Cassandra (via cqlengine). The documentation links are provided below.

Frameworks Databases
flask-ripozo ripozo-sqlalchemy
django-ripozo ripozo-cassandra

Built an extension for ripozo? Let us know and we'll add it in here!

Helpful links

Installation

pip install ripozo

Versioning

Prior to version 1.0.0 ripozo versioning follows sentimental versioning. Releases after 1.0.0 follow a standard major.minor.patch style.

  • patch: forwards and backwards compatible
  • minor: backwards compatible
  • major: No guarantees

Contributing

Want to help out? We'd love it! Github will be the hub of development for ripozo. If you have any issues, comments, or complaints post them there. Additionally, we are definitely accepting pull requests (hint: we almost always love more tests and documentation). We do have just a few requests:

  • Every method, function, and class should have a thorough docstring
  • There should be at least one unit test for each function and method
  • Keep your pull requests to one issue. (Preferably open an issue on github first for record keeping)

Behind the name

Ripozo translates to "rest" in Esperanto. Esperanto was designed to be a universal language. Anyone, no matter their native language, can learn and use it easily. Similarly, ripozo is intended to be a universal ReST framework. No matter your preference of database, web framework, or protocol, ripozo makes it easy to build.

The Python micro framework for building web applications.

Flask Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to co

The Pallets Projects 61.5k Jan 06, 2023
CherryPy is a pythonic, object-oriented HTTP framework. https://docs.cherrypy.org/

Welcome to the GitHub repository of CherryPy! CherryPy is a pythonic, object-oriented HTTP framework. It allows building web applications in much the

CherryPy 1.6k Dec 29, 2022
Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Japronto! There is no new project development happening at the moment, but it's not abandoned either. Pull requests and new maintainers are welcome. I

Paweł Piotr Przeradowski 8.6k Dec 29, 2022
Phoenix LiveView but for Django

Reactor, a LiveView library for Django Reactor enables you to do something similar to Phoenix framework LiveView using Django Channels. What's in the

Eddy Ernesto del Valle Pino 526 Jan 02, 2023
Python implementation of the Javascript Object Signing and Encryption (JOSE) framework

Python implementation of the Javascript Object Signing and Encryption (JOSE) framework

Demonware 94 Nov 20, 2022
Swagger/OpenAPI First framework for Python on top of Flask with automatic endpoint validation & OAuth2 support

Connexion Connexion is a framework that automagically handles HTTP requests based on OpenAPI Specification (formerly known as Swagger Spec) of your AP

Zalando SE 4.2k Jan 07, 2023
Online Boutique is a cloud-native microservices demo application

Online Boutique is a cloud-native microservices demo application. Online Boutique consists of a 10-tier microservices application. The application is

Matt Reider 1 Oct 22, 2021
Sanic integration with Webargs

webargs-sanic Sanic integration with Webargs. Parsing and validating request arguments: headers, arguments, cookies, files, json, etc. IMPORTANT: From

Endurant Devs 13 Aug 31, 2022
A Python package to easily create APIs in Python.

API_Easy An Python Package for easily create APIs in Python pip install easy-api-builder Requiremnets: = python 3.6 Required modules -- Flask Docume

Envyre-Coding 2 Jan 04, 2022
Dockerized web application on Starlite, SQLAlchemy1.4, PostgreSQL

Production-ready dockerized async REST API on Starlite with SQLAlchemy and PostgreSQL

Artur Shiriev 10 Jan 03, 2023
Pretty tornado wrapper for making lightweight REST API services

CleanAPI Pretty tornado wrapper for making lightweight REST API services Installation: pip install cleanapi Example: Project folders structure: . ├──

Vladimir Kirievskiy 26 Sep 11, 2022
Asita is a web application framework for python based on express-js framework.

Asita is a web application framework for python. It is designed to be easy to use and be more easy for javascript users to use python frameworks because it is based on express-js framework.

Mattéo 4 Nov 16, 2021
APIFlask is a lightweight Python web API framework based on Flask and marshmallow-code projects

APIFlask APIFlask is a lightweight Python web API framework based on Flask and marshmallow-code projects. It's easy to use, highly customizable, ORM/O

Grey Li 705 Jan 04, 2023
Endpoints is a lightweight REST api framework written in python and used in multiple production systems that handle millions of requests daily.

Endpoints Quickest API builder in the West! Endpoints is a lightweight REST api framework written in python and used in multiple production systems th

Jay Marcyes 30 Mar 05, 2022
Bablyon 🐍 A small ASGI web framework

A small ASGI web framework that you can make asynchronous web applications using uvicorn with using few lines of code

xArty 8 Dec 07, 2021
A very simple asynchronous wrapper that allows you to get access to the Oracle database in asyncio programs.

cx_Oracle_async A very simple asynchronous wrapper that allows you to get access to the Oracle database in asyncio programs. Easy to use , buy may not

36 Dec 21, 2022
An abstract and extensible framework in python for building client SDKs and CLI tools for a RESTful API.

django-rest-client An abstract and extensible framework in python for building client SDKs and CLI tools for a RESTful API. Suitable for APIs made wit

Certego 4 Aug 25, 2022
A shopping list and kitchen inventory management app.

Flask React Project This is the backend for the Flask React project. Getting started Clone this repository (only this branch) git clone https://github

11 Jun 03, 2022
Containers And REST APIs Workshop

Containers & REST APIs Workshop Containers vs Virtual Machines Ferramentas Podman: https://podman.io/ Docker: https://www.docker.com/ IBM CLI: https:/

Vanderlei Munhoz 8 Dec 16, 2021
The Modern And Developer Centric Python Web Framework. Be sure to read the documentation and join the Slack channel questions: http://slack.masoniteproject.com

NOTE: Masonite 2.3 is no longer compatible with the masonite-cli tool. Please uninstall that by running pip uninstall masonite-cli. If you do not unin

Masonite 1.9k Jan 04, 2023