Skip to main content

Fire up your models with the flame 🔥

Project description

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flama-1.2.0.tar.gz (270.1 kB view details)

Uploaded Source

Built Distribution

flama-1.2.0-py3-none-any.whl (303.5 kB view details)

Uploaded Python 3

File details

Details for the file flama-1.2.0.tar.gz.

File metadata

  • Download URL: flama-1.2.0.tar.gz
  • Upload date:
  • Size: 270.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.15.0-1033-azure

File hashes

Hashes for flama-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c8fc90c3aa05af270b22ee6ab89591e3d1c40570c751f1cc5ffda2895563c956
MD5 4c89c63bf160eb933a80eff635ef488a
BLAKE2b-256 5d9e5b9787541a14b2ce5ebf1ac12df4a9fc79ed2d5e1eeefa14cf7eacf95a2f

See more details on using hashes here.

File details

Details for the file flama-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: flama-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 303.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.15.0-1033-azure

File hashes

Hashes for flama-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d0af7e8179ba5b31658abc47db324cf2cd24468d8711518df8a6653374dc8e1
MD5 7323747b2b5074674ecc7e179941b7c8
BLAKE2b-256 3aeced945eda7b6296af78a25d6efee889d14c04b10b689866558e5b33b9cdbe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page