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.

A Flask API REST to access words' definition

A Flask API to access words' definitions

Pablo Emídio S.S 9 Jul 22, 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
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
Pyrin is an application framework built on top of Flask micro-framework to make life easier for developers who want to develop an enterprise application using Flask

Pyrin A rich, fast, performant and easy to use application framework to build apps using Flask on top of it. Pyrin is an application framework built o

Mohamad Nobakht 10 Jan 25, 2022
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
Pulumi-checkly - Checkly Pulumi Provider With Python

🚨 This project is still in very early stages and is not stable, use at your own

Checkly 16 Dec 15, 2022
Asita is a web application framework for python.

What is Asita ? 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

Mattéo 4 Nov 16, 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
Distribution Analyser is a Web App that allows you to interactively explore continuous distributions from SciPy and fit distribution(s) to your data.

Distribution Analyser Distribution Analyser is a Web App that allows you to interactively explore continuous distributions from SciPy and fit distribu

Robert Dzudzar 46 Nov 08, 2022
A proof-of-concept CherryPy inspired Python micro framework

Varmkorv Varmkorv is a CherryPy inspired micro framework using Werkzeug. This is just a proof of concept. You are free to use it if you like, or find

Magnus Karlsson 1 Nov 22, 2021
Web3.py plugin for using Flashbots' bundle APIs

This library works by injecting a new module in the Web3.py instance, which allows submitting "bundles" of transactions directly to miners. This is done by also creating a middleware which captures c

Georgios Konstantopoulos 294 Jan 04, 2023
Dazzler is a Python async UI/Web framework built with aiohttp and react.

Dazzler is a Python async UI/Web framework built with aiohttp and react. Create dazzling fast pages with a layout of Python components and bindings to update from the backend.

Philippe Duval 17 Oct 18, 2022
The no-nonsense, minimalist REST and app backend framework for Python developers, with a focus on reliability, correctness, and performance at scale.

The Falcon Web Framework Falcon is a reliable, high-performance Python web framework for building large-scale app backends and microservices. It encou

Falconry 9k Jan 01, 2023
Lemon is an async and lightweight API framework for python

Lemon is an async and lightweight API framework for python . Inspired by Koa and Sanic .

Joway 29 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
A public API written in Python using the Flask web framework to determine the direction of a road sign using AI

python-public-API This repository is a public API for solving the problem of the final of the AIIJC competition. The task is to create an AI for the c

Lev 1 Nov 08, 2021
Fast, asynchronous and elegant Python web framework.

Warning: This project is being completely re-written. If you're curious about the progress, reach me on Slack. Vibora is a fast, asynchronous and eleg

vibora.io 5.7k Jan 08, 2023
A library that makes consuming a RESTful API easier and more convenient

Slumber is a Python library that provides a convenient yet powerful object-oriented interface to ReSTful APIs. It acts as a wrapper around the excellent requests library and abstracts away the handli

Sam Giles 597 Dec 13, 2022
FastAPI framework, high performance, easy to learn, fast to code, ready for production

FastAPI framework, high performance, easy to learn, fast to code, ready for production Documentation: https://fastapi.tiangolo.com Source Code: https:

Sebastián Ramírez 53k Jan 02, 2023
A framework that let's you compose websites in Python with ease!

Perry Perry = A framework that let's you compose websites in Python with ease! Perry works similar to Qt and Flutter, allowing you to create componen

Linkus 13 Oct 09, 2022