Fast to learn, fast to code, fast to run
Penta - Fast Django REST Framework
Penta is a web framework for building APIs with Django and Python 3.10+ type hints, forked from Django Ninja to focus on opinionated integrations.
Please have a look at the original Django Ninja and leave a star as the job done by the original author is great.
Key features:
- Easy: Designed to be easy to use and intuitive.
- FAST execution: Very high performance thanks to Pydantic and async support.
- Fast to code: Type hints and automatic docs lets you focus only on business logic.
- Dependency injection: the views declare what they need, penta resolves it.
- Standards-based: Based on the open standards for APIs: OpenAPI (previously known as Swagger) and JSON Schema.
- Django friendly: (obviously) has good integration with the Django core and ORM.
Documentation: As Penta is a fork of django ninja, you can start here. We will create a dedicated documentation for Penta soon!
Installation
pip install penta
Usage
In your django project next to urls.py create new api.py file:
from penta import Penta
api = Penta()
@api.get("/add")
def add(request, a: int, b: int):
return {"result": a + b}
Now go to urls.py and add the following:
...
from .api import api
urlpatterns = [
path("admin/", admin.site.urls),
path("api/", api.urls), # <---------- !
]
That's it !
Now you've just created an API that:
- receives an HTTP GET request at
/api/add - takes, validates and type-casts GET parameters
aandb - decodes the result to JSON
- generates an OpenAPI schema for defined operation
Interactive API docs
Now go to http://127.0.0.1:8000/api/docs
You will see the automatic interactive API documentation (provided by Swagger UI or Redoc):
What next?
- Read the full documentation here - https://paperz-org.github.io/unchained/
Metadata
Release files for penta 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| penta-0.4.0.tar.gz | 5.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| penta-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 MB
Release files / penta-0.4.0.tar.gz
| Download URL | penta-0.4.0.tar.gz |
|---|---|
| Size | 5.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d2872e9f6fbb06358d4bab7d20274959c174552a63639dd745999be48008a4b
|
|
BLAKE2b-256 checksum How to use checksums |
c96f6d03220c7a9408d5c154250842aad99100c961c6b9cfbb1b5117808ad4de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / penta-0.4.0-py3-none-any.whl
| Download URL | penta-0.4.0-py3-none-any.whl |
|---|---|
| Size | 2.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddd0316f96a1518ba80c84be1b18d1397245d0e454f57f975d354b80d3a46353
|
|
BLAKE2b-256 checksum How to use checksums |
1c3eb241325eb4c581fb34521616bc00ca26ba8ea98820c4f64dbf0db2b6fb9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|