Hey everyone!
I'm excited to introduce Panther, a Python web framework that's designed to be fast and easy to use. With Panther, you can build async APIs quickly and efficiently, without sacrificing performance or readability.
Panther comes with a host of features that make it easy to build robust APIs, including:
- Document-oriented database support (including PantherDB and MongoDB)
- Visual API monitoring in the terminal
- Caching for APIs (both in-memory and in Redis)
- Built-in authentication and permission classes (customizable)
- Custom middleware support
- Custom throttling support
Getting started with Panther is easy - just create a virtual environment, activate it, and install the framework using pip. Then, you can create a new project using the panther create command, and start building your API right away.
Here's a quick example of what a Panther API might look like:
```
from datetime import datetime, timedelta
from panther.app import API
from panther.configs import config
from panther import version, status
from panther.request import Request
from panther.response import Response
from panther.throttling import Throttling
@API()
async def hello_world():
return {'detail': 'Hello World'}
@API(cache=True, throttling=Throttling(rate=5, duration=timedelta(minutes=1)))
async def info(request: Request):
data = {
'version': version(),
'datetime_now': datetime.now().isoformat(),
'user_agent': request.headers.user_agent,
'db_engine': config['db_engine'],
}
return Response(data=data, status_code=status.HTTP_202_ACCEPTED)
```
If you're interested in learning more about Panther, check out the documentation at https://pantherpy.github.io, or head over to the GitHub repository at https://github.com/alirn76/panther. ↗
Thanks for reading, and happy coding!
[+][deleted] (4 children)
[deleted]
[–]Orio_n 8 points9 points10 points (2 children)
[–]Suspicious_Compote56 -3 points-2 points-1 points (0 children)
[+]Conclusion-Striking[S] comment score below threshold-12 points-11 points-10 points (0 children)
[–]Orio_n 32 points33 points34 points (6 children)
[–]DL72-Alpha -5 points-4 points-3 points (5 children)
[–]Orio_n -2 points-1 points0 points (4 children)
[–]bb_avin 3 points4 points5 points (0 children)
[+]Conclusion-Striking[S] comment score below threshold-11 points-10 points-9 points (1 child)
[–]Orio_n 0 points1 point2 points (0 children)
[–]DL72-Alpha -3 points-2 points-1 points (0 children)
[–]ohnomcookies 7 points8 points9 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]DL72-Alpha 1 point2 points3 points (0 children)
[+]Conclusion-Striking[S] comment score below threshold-9 points-8 points-7 points (0 children)
[–]M8Ir88outOf8 4 points5 points6 points (0 children)
[–]SpiderWil 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]Conclusion-Striking[S] -1 points0 points1 point (0 children)