• Stars
    star
    213
  • Rank 185,410 (Top 4 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ”ฅ Fire up your API

Flama

Fire up your models with the flame ๐Ÿ”ฅ

Test And Publish workflow status Docker Push workflow status Package version PyPI - Python Version


Flama

Flama is a python library which establishes a standard framework for development and deployment of APIs with special focus on machine learning (ML). The main aim of the framework is to make ridiculously simple the deployment of ML APIs, simplifying (when possible) the entire process to a single line of code.

The library builds on Starlette, and provides an easy-to-learn philosophy to speed up the building of highly performant GraphQL, REST and ML APIs. Besides, it comprises an ideal solution for the development of asynchronous and production-ready services, offering automatic deployment for ML models.

Some remarkable characteristics:

  • Generic classes for API resources with the convenience of standard CRUD methods over SQLAlchemy tables.
  • A schema system (based on Marshmallow or Typesystem) which allows the declaration of inputs and outputs of endpoints very easily, with the convenience of reliable and automatic data-type validation.
  • Dependency injection to make ease the process of managing parameters needed in endpoints via the use of Components. Flama ASGI objects like Request, Response, Session and so on are defined as Components ready to be injected in your endpoints.
  • Components as the base of the plugin ecosystem, allowing you to create custom or use those already defined in your endpoints, injected as parameters.
  • Auto generated API schema using OpenAPI standard.
  • Auto generated docs, and provides a Swagger UI and ReDoc endpoints.
  • Automatic handling of pagination, with several methods at your disposal such as limit-offset and page numbering, to name a few.

Installation

Flama is fully compatible with all supported versions of Python. We recommend you to use the latest version available.

For a detailed explanation on how to install flama visit: https://flama.dev/docs/getting-started/installation.

Getting Started

Visit https://flama.dev/docs/getting-started/quickstart to get started with Flama.

Documentation

Visit https://flama.dev/docs/ to view the full documentation.

Example

from flama import Flama

app = Flama(
    title="Hello-๐Ÿ”ฅ",
    version="1.0",
    description="My first API",
)


@app.route("/")
def home():
    """
    tags:
        - Salute
    summary:
        Returns a warming message.
    description:
        This is a more detailed description of the method itself.
        Here we can give all the details required and they will appear
        automatically in the auto-generated docs.
    responses:
        200:
            description: Warming hello message!
    """
    return {"message": "Hello ๐Ÿ”ฅ"}

This example will build and run a Hello ๐Ÿ”ฅ API. To run it:

flama run examples.hello_flama:app

Authors

  • Josรฉ Antonio Perdiguero Lรณpez (@perdy)
  • Miguel Durรกn-Olivencia (@migduroli)

Contributing

This project is absolutely open to contributions so if you have a nice idea, please read our contributing docs before submitting a pull request.

More Repositories

1

starlette-prometheus

Prometheus integration for Starlette.
Python
272
star
2

health-check

Health Check is an application that provides an API to check the health health_check of some parts and some utilities like ping requests. This application can works as standalone or included in a Django project.
Python
31
star
3

django-status

Django Status is a application for Django projects that provides an API to check the status of some parts and some utilities like ping requests.
Python
17
star
4

apistar-crud

API Star CRUD resources
JavaScript
14
star
5

apistar-sqlalchemy

SQLAlchemy integration for API Star
Python
13
star
6

warcraftlogs

WarcraftLogs API client
Python
9
star
7

haystack-elasticsearch

Add elasticsearch specific features to haystack
Python
8
star
8

clinner

Command Line Interface builder that helps creating an entry point for your application.
Python
8
star
9

django-audit-tools

Django application that provides a set of tools for auditing requests and models and improve logging
Python
8
star
10

barrenero

Barrenero is a set of tools for effective mining crypto currencies.
Python
7
star
11

django-numpy

Application for Django projects that adds some utilities and integration tools with Numpy.
Python
6
star
12

speech

Repository to store speech materials.
Jupyter Notebook
5
star
13

task-dispatcher

Library that provides a system to generate tasks producers and consumers with ease.
Python
3
star
14

management-tools

A set of tools to improve efficiency in team management tasks
Python
3
star
15

performance-tools

Some tools to make performance analysis and improvements.
Python
2
star
16

apistar-pagination

Pagination tools for API Star
Python
1
star
17

apistar-peewee-orm

Peewee integration for API Star
Python
1
star
18

cookiecutter-python-app

Cookiecutter template for simple python application
Python
1
star
19

flama-site

Flama Website
TypeScript
1
star
20

ci-builder

Docker image to use as GitHub Actions builder
Python
1
star
21

test-academy-19-11

Jupyter Notebook
1
star
22

cookiecutter-django-graphql-api

Cookiecutter template for GraphQL API based on Django.
Python
1
star
23

cookiecutter-python-package

Cookiecutter template for python packages.
Python
1
star