Async (ASGI) Python web framework
Project description
Backendpy
Python web framework for building the backend of your project!
Some features:
- Asynchronous programming (ASGI-based projects)
- Application-based architecture and the ability to install third-party applications in a project
- Support of middlewares for different layers such as Application, Handler, Request or Response
- Supports events and hooks
- Data handler classes, including validators and filters to automatically apply to request input data
- Supports a variety of responses including JSON, HTML, file and… with various settings such as stream, gzip and…
- Router with the ability to define urls as Python decorator or as separate files
- Application-specific error codes
- Optional default database layer by the Sqlalchemy async ORM with management of sessions for the scope of each request
- Optional default templating layer by the Jinja template engine
- …
Requirements
Python 3.8+
Installation
$ pip3 install backendpy
Or use the following command to install optional additional libraries:
$ pip3 install backendpy[full]
You also need to install an ASGI server such as Uvicorn, Hypercorn or Daphne:
$ pip3 install uvicorn
Quick Start
Create Project
project/main.py
from backendpy import Backendpy
bp = Backendpy()
Create Application
project/apps/hello/main.py
from backendpy.app import App
from .handlers import routes
app = App(
routes=[routes])
project/apps/hello/handlers.py
from backendpy.router import Routes
from backendpy.response import Text
routes = Routes()
@routes.get(r'^/hello-world$')
async def hello(request):
return Text('Hello World!')
Activate Application
project/config.ini
[apps]
active =
project.apps.hello
Run Project
Inside the project root path:
$ uvicorn main:bp
Command line
Project creation
$ backendpy create_project --name myproject
To create a project with more complete sample components:
$ backendpy create_project --name myproject --full
App creation
$ backendpy create_app --name myapp
$ backendpy create_app --name myapp --full
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
backendpy-0.1.7a1.tar.gz
(32.2 kB
view details)
Built Distribution
File details
Details for the file backendpy-0.1.7a1.tar.gz
.
File metadata
- Download URL: backendpy-0.1.7a1.tar.gz
- Upload date:
- Size: 32.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 396dc09c1aded478ad0938f4ce1a07639f309a2cd5ff4abfc1c9a84570073219 |
|
MD5 | af8d5fbdb7770f8fe9324c5c4a388ef2 |
|
BLAKE2b-256 | 3efa6c3a1bb67144debd5ae6e2886ac3f75027865d52e01564c025038a12c855 |
File details
Details for the file backendpy-0.1.7a1-py3-none-any.whl
.
File metadata
- Download URL: backendpy-0.1.7a1-py3-none-any.whl
- Upload date:
- Size: 39.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6418d06a20f96949ae628d5968ebe6d32ba711114f3b494d1f64d414b75d770b |
|
MD5 | 7e673d597985aaa51d116c3708820f68 |
|
BLAKE2b-256 | 65c4e4a355a6bf10940abba0ba604880b68d133c7fc734efb4fac10fb79d2ec8 |