Skip to main content

Falca is an intuitive REST APIs framework based on the falcon framework.

Project description

Falca

Logo

PyPI - Downloads PyPI PyPI - Python Version PyPI - Format PyPI - Status PyPI - License GitHub issues GitHub closed issues Scrutinizer code quality (GitHub/Bitbucket) Black Formatter

Falca is an intuitive REST APIs framework.
Powered by https://falconframework.org/.

:warning: This is a BETA version please don't use it in a production environment. Thank you! :construction:

Goals of this project:

  • Validates request body based on type hints.
  • (Pydantic & Marshmallow) support as object serialization and deserialization
  • Request body mapping
  • Nested routers
  • Plugin support
  • Settings (Global Configuration) support
  • Async Support
  • Routing sub-application
  • CLI
  • Dependency injection
  • Resource shortcut (get, post, put, delete, websocket, etc)

Contribution

Do not hesitate!

if you want to contribute like bug fixes, feature additions, etc. Please read our contribution guidelines.

Also bug reports are welcome :)

Installation

Using pip:

pip install falca

Alternatively, clone this repository and go to the falca directory:

git clone https://github.com/aprilahijriyan/falca
cd falca

Initialize the environment with python v3.7 using poetry

poetry env use $(which python3.7)

Install dependencies

poetry install --no-dev

Usage

Let's see how beautiful it is

# app.py

from typing import Optional

from falca.app import ASGI
from falca.depends.pydantic import Query
from falca.responses import JSONResponse
from falca.serializers.pydantic import Schema


class LimitOffsetSchema(Schema):
    limit: Optional[int]
    offset: Optional[int]

class Simple:
    async def on_get(self, query: dict = Query(LimitOffsetSchema)):
        return JSONResponse(query)

app = ASGI(__name__)
app.add_route("/", Simple())

Save the code above with filename app.py And run it with the command:

falca runserver

NOTE: For the ASGI app, you need to install uvicorn before running it. Also for other examples, you can find them here

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

falca-2.4.0.tar.gz (20.8 kB view hashes)

Uploaded Source

Built Distribution

falca-2.4.0-py3-none-any.whl (29.3 kB view hashes)

Uploaded Python 3

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