Panther
Is A Fast & Friendly, Web Framework For Building Async APIs With Python 3.11+
Full Documentation -> https://pantherpy.github.io
Features
- Document-oriented Databases ORM (SlarkDB, MongoDB)
- Visual API Monitoring (In Terminal)
- Cache APIs (In Memory, In Redis)
- Built-in Authentication Classes (Customizable)
- Built-in Permission Classes (Customizable)
- Handle Custom Middlewares
Benchmark
We implemented most of the Python frameworks and sent
25,000 requests per second
for 10 seconds
(Total 250,000 requests)
in the same environment
with https://github.com/nakabonne/ali and here's the result:
you can find the detailed results & source codes here --> benchmarks
| Framework | Throughput | Request Handled | Max Latencies |
|---|---|---|---|
| Sanic | 23,326 | 233,842 | 268.8ms |
| Panther | 14,719 | 147,595 | 113.1ms |
| FastAPI | 14,573 | 146,467 | 155.1ms |
| Tornado | 4,969 | 50.585 | 426.5ms |
| Flask | 3,555 | 36,396 | 1.2s |
| Django | 2,188 | 22,814 | 526.3ms |
| Bottle | 1,226 | 39,650 | 30.0s |
| Pyramid | 1,023 | 30,912 | 30.0s |
| Cherrypy | 639 | 24,944 | 30.0s |
Installation
-
Create a Virtual Environment
$ python -m venv .venv
-
Active The Environment
* Linux & Mac$ source .venv/bin/activate
* Windows$ .\.venv\Scripts\activate
-
Install Panther
* Normal$ pip install panther
* Include JWT Authentication$ pip install panther[full]
Usage
-
Create Project
$ panther create <project_name> <directory>
-
Run Project
Panther needs Uvicorn as ASGI (Asynchronous Server Gateway Interface)
$ pip install uvicorn[standard]
Then
$ panther run
-
Monitoring Requests
$ panther monitor
-
Python Shell
$ panther shell
Example
-
You can create project with
$ panther create myproject
-
or create it yourself:
core/configs.py:
URLs = 'core/urls.py'
core/urls.py:
from app.urls import urls as app_urls urls = { '/': app_urls, }
app/urls.py:
from app.apis import hello_world, info urls = { '': hello_world, 'info/': info, }
app/apis.py:
from panther import version, status from panther.app import API from panther.request import Request from panther.response import Response @API() async def hello_world(): return {'detail': 'Hello World'} @API() async def info(request: Request): data = { 'version': version(), 'user_agent': request.headers.user_agent, 'content_length': request.headers.content_length, } return Response(data=data, status_code=status.HTTP_202_ACCEPTED)
-
Then run (
$ panther run) the project, now you can see these two urls:
More examples: https://github.com/AliRn76/panther/tree/master/example.
Metadata
Release files for panther 1.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| panther-1.2.7.tar.gz | 27.7 kB | Without provenance | Details for panther-1.2.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| panther-1.2.7-py3-none-any.whl | Python 3 | none | any | Details for panther-1.2.7-py3-none-any.whl |
Total release size: 61.5 kB
Release files / panther-1.2.7.tar.gz
| Download URL | panther-1.2.7.tar.gz |
|---|---|
| Size | 27.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
04d4c44e5d2c0b62361766dc8634633b29bf82ba20ebd21f2e31206306a25528
|
|
BLAKE2b-256 checksum How to use checksums |
dfbb8a42d131501e0e9477acc6fd54484c6382e9bce8437dbfa0cac06bf4c7f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / panther-1.2.7-py3-none-any.whl
| Download URL | panther-1.2.7-py3-none-any.whl |
|---|---|
| Size | 33.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c002d7df407d05b3d6439c0466eb019be855633c4ca44e5825ea581a66c0e97a
|
|
BLAKE2b-256 checksum How to use checksums |
46765667b4d92d9040dc6eeeade0d248e5a7680d9b5fedfbe53618901e372dd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for panther 1.2.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.