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.

News search API developed for the purposes of the ColdCase Project.

Saxion - Cold Case - News Search API Setup Local – Linux/MacOS Make sure you have python 3.9 and pip 21 installed. This project uses a MySQL database,

Dimitar Rangelov 3 Jul 01, 2021
Try to create a python mircoservice framework.

Micro current_status: prototype. ... Python microservice framework. More in Document. You should clone this project and run inv docs. Install Not now.

修昊 1 Dec 07, 2021
Sierra is a lightweight Python framework for building and integrating web applications

A lightweight Python framework for building and Integrating Web Applications. Sierra is a Python3 library for building and integrating web applications with HTML and CSS using simple enough syntax. Y

83 Sep 23, 2022
Goblet is an easy-to-use framework that enables developers to quickly spin up fully featured REST APIs with python on GCP

GOBLET Goblet is a framework for writing serverless rest apis in python in google cloud. It allows you to quickly create and deploy python apis backed

Austen 78 Dec 27, 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
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
Django Ninja - Fast Django REST Framework

Django Ninja is a web framework for building APIs with Django and Python 3.6+ type hints.

Vitaliy Kucheryaviy 3.8k Jan 02, 2023
Free & open source Rest API for YTDislike

RestAPI Free & open source Rest API for YTDislike, read docs.ytdislike.com for implementing. Todo Add websockets Installation Git clone git clone http

1 Nov 25, 2021
Flask-Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine

Flask-Potion Description Flask-Potion is a powerful Flask extension for building RESTful JSON APIs. Potion features include validation, model resource

DTU Biosustain 491 Dec 08, 2022
Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Tornado Web Server Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. By using non-blocking ne

20.9k Jan 01, 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
Djask is a web framework for python which stands on the top of Flask and will be as powerful as Django.

Djask is a web framework for python which stands on the top of Flask and will be as powerful as Django.

Andy Zhou 27 Sep 08, 2022
Chisel is a light-weight Python WSGI application framework built for creating well-documented, schema-validated JSON web APIs

chisel Chisel is a light-weight Python WSGI application framework built for creating well-documented, schema-validated JSON web APIs. Here are its fea

Craig Hobbs 2 Dec 02, 2021
🦍 The Cloud-Native API Gateway

Kong or Kong API Gateway is a cloud-native, platform-agnostic, scalable API Gateway distinguished for its high performance and extensibility via plugi

Kong 33.8k Jan 09, 2023
Microservice example with Python, Faust-Streaming and Kafka (Redpanda)

Microservices Orchestration with Python, Faust-Streaming and Kafka (Redpanda) Example project for PythonBenin meetup. It demonstrates how to use Faust

Lé 3 Jun 13, 2022
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
Flask Sugar is a web framework for building APIs with Flask, Pydantic and Python 3.6+ type hints.

Flask Sugar is a web framework for building APIs with Flask, Pydantic and Python 3.6+ type hints. check parameters and generate API documents automatically. Flask Sugar是一个基于flask,pyddantic,类型注解的API框架

162 Dec 26, 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
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
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