panther

Fast & Friendly Web Framework For Building Async APIs With Python 3.10+

https://github.com/alirn76/panther

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.7%) to scientific vocabulary

Keywords

framework panther python
Last synced: 6 months ago · JSON representation

Repository

Fast & Friendly Web Framework For Building Async APIs With Python 3.10+

Basic Info
  • Host: GitHub
  • Owner: AliRn76
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: master
  • Homepage: https://PantherPy.GitHub.io
  • Size: 11.7 MB
Statistics
  • Stars: 342
  • Watchers: 8
  • Forks: 19
  • Open Issues: 6
  • Releases: 1
Topics
framework panther python
Created almost 4 years ago · Last pushed 7 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Security

README.md

PyPI PyVersion codecov Downloads license

Panther Logo # Panther **A Fast & Friendly Web Framework for Building Async APIs with Python 3.10+** [📚 Documentation](https://pantherpy.github.io)

🐾 Why Choose Panther?

Panther is designed to be fast, simple, and powerful. Here's what makes it special:

  • One of the fastest Python frameworks available (Benchmark)
  • File-based database (PantherDB) - No external database setup required
  • Document-oriented ODM - Supports MongoDB & PantherDB with familiar syntax
  • API caching system - In-memory and Redis support
  • OpenAPI - Auto-generated API documentation with multiple UI options
  • WebSocket support - Real-time communication out of the box
  • Authentication & Permissions - Built-in security features
  • Background tasks - Handle long-running operations
  • Middleware & Throttling - Extensible and configurable

Quick Start

Installation

bash pip install panther

  • Create a main.py file with one of the examples below.

Your First API

Here's a simple REST API endpoint that returns a "Hello World" message:

```python from datetime import datetime, timedelta from panther import status, Panther from panther.app import GenericAPI from panther.openapi.urls import urlrouting as openapiurl_routing from panther.response import Response

class HelloAPI(GenericAPI): # Cache responses for 10 seconds cache = timedelta(seconds=10)

def get(self):
    current_time = datetime.now().isoformat()
    return Response(
        data={'message': f'Hello from Panther! 🐾 | {current_time}'},
        status_code=status.HTTP_200_OK
    )

URL routing configuration

urlrouting = { '/': HelloAPI, 'docs/': openapiurl_routing, # Auto-generated API docs }

Create your Panther app

app = Panther(name, configs=name, urls=url_routing) ```

WebSocket Echo Server

Here's a simple WebSocket echo server that sends back any message it receives:

```python from panther import Panther from panther.app import GenericAPI from panther.response import HTMLResponse from panther.websocket import GenericWebsocket

class EchoWebsocket(GenericWebsocket): async def connect(self, **kwargs): await self.accept() await self.send("Connected to Panther WebSocket!")

async def receive(self, data: str | bytes):
    # Echo back the received message
    await self.send(f"Echo: {data}")

class WebSocketPage(GenericAPI): def get(self): template = """

🐾 Panther WebSocket Echo Server

    """ return HTMLResponse(template)

    urlrouting = { '': WebSocketPage, 'ws': EchoWebsocket, } app = Panther(name, configs=name, urls=urlrouting) ```

    Run Your Application

    1. Start the development server shell $ panther run main:app

    2. Test your application


    🙏 Acknowledgments

    Supported by

    JetBrains

    ⭐️ If you find Panther useful, please give it a star!

    Owner

    • Name: Ali RajabNezhad
    • Login: AliRn76
    • Kind: user

    Born to code, Forced to work

    GitHub Events

    Total
    • Issues event: 1
    • Watch event: 78
    • Delete event: 20
    • Issue comment event: 14
    • Push event: 115
    • Pull request review comment event: 5
    • Pull request review event: 7
    • Pull request event: 59
    • Fork event: 6
    • Create event: 41
    Last Year
    • Issues event: 1
    • Watch event: 78
    • Delete event: 20
    • Issue comment event: 14
    • Push event: 115
    • Pull request review comment event: 5
    • Pull request review event: 7
    • Pull request event: 59
    • Fork event: 6
    • Create event: 41

    Committers

    Last synced: over 2 years ago

    All Time
    • Total Commits: 300
    • Total Committers: 8
    • Avg Commits per committer: 37.5
    • Development Distribution Score (DDS): 0.273
    Past Year
    • Commits: 298
    • Committers: 8
    • Avg Commits per committer: 37.25
    • Development Distribution Score (DDS): 0.275
    Top Committers
    Name Email Commits
    AliRn a****6@y****m 218
    AliRn a****7@g****m 52
    MahanBi D****r@g****m 16
    MahanBi d****r@g****m 9
    Vahid Fathi v****0@g****m 2
    Satyajeet Sahu s****p@g****m 1
    Amin Aminian 4****n 1
    Okware Dedan 1****c 1

    Issues and Pull Requests

    Last synced: 6 months ago

    All Time
    • Total issues: 13
    • Total pull requests: 109
    • Average time to close issues: 15 days
    • Average time to close pull requests: 9 days
    • Total issue authors: 9
    • Total pull request authors: 10
    • Average comments per issue: 1.38
    • Average comments per pull request: 0.36
    • Merged pull requests: 89
    • Bot issues: 0
    • Bot pull requests: 0
    Past Year
    • Issues: 1
    • Pull requests: 23
    • Average time to close issues: N/A
    • Average time to close pull requests: 12 days
    • Issue authors: 1
    • Pull request authors: 3
    • Average comments per issue: 0.0
    • Average comments per pull request: 0.04
    • Merged pull requests: 18
    • Bot issues: 0
    • Bot pull requests: 0
    Top Authors
    Issue Authors
    • 0keeper1 (2)
    • djkemmet (2)
    • everythingability (2)
    • aka-deVOID (2)
    • Arian-p1 (1)
    • satyahbp (1)
    • BenGix (1)
    • nimiology (1)
    • vahidfathi (1)
    • iamamirhossein (1)
    Pull Request Authors
    • AliRn76 (101)
    • MahanBi (13)
    • BenGix (11)
    • 0keeper1 (7)
    • aminiun (7)
    • Arian-p1 (7)
    • mahdikalhor1 (2)
    • amirreza8002 (2)
    • satyahbp (1)
    • SoftCysec (1)
    • praktikdev (1)
    • vahidfathi (1)
    Top Labels
    Issue Labels
    enhancement (6) bug (5) good first issue (1) documentation (1)
    Pull Request Labels
    enhancement (3) bug (1)

    Packages

    • Total packages: 2
    • Total downloads:
      • pypi 702 last-month
    • Total dependent packages: 0
      (may contain duplicates)
    • Total dependent repositories: 3
      (may contain duplicates)
    • Total versions: 145
    • Total maintainers: 1
    pypi.org: panther

    Fast & Friendly, Web Framework For Building Async APIs

    • Versions: 142
    • Dependent Packages: 0
    • Dependent Repositories: 3
    • Downloads: 702 Last month
    Rankings
    Stargazers count: 4.6%
    Dependent repos count: 9.0%
    Average: 9.5%
    Dependent packages count: 10.1%
    Forks count: 10.5%
    Downloads: 13.2%
    Maintainers (1)
    Last synced: 6 months ago
    pypi.org: actiontest112

    Fast & Friendly, Web Framework For Building Async APIs

    • Versions: 3
    • Dependent Packages: 0
    • Dependent Repositories: 0
    Rankings
    Dependent packages count: 6.6%
    Stargazers count: 16.1%
    Average: 18.2%
    Forks count: 19.6%
    Dependent repos count: 30.6%
    Maintainers (1)
    Last synced: 10 months ago

    Dependencies

    .github/workflows/pull_request.yaml actions
    • actions/checkout v3 composite
    • actions/setup-python v4 composite
    • supercharge/mongodb-github-action 1.10.0 composite
    .github/workflows/release.yaml actions
    • actions/checkout v3 composite
    • actions/setup-python v4 composite
    • codecov/codecov-action v3 composite
    • pypa/gh-action-pypi-publish master composite
    • supercharge/mongodb-github-action 1.10.0 composite
    example/requirements.txt pypi
    • panther *
    pyproject.toml pypi
    requirements.txt pypi
    • coverage *
    • cryptography *
    • faker *
    • pymongo *
    • pytest *
    • python-jose *
    • websockets *
    setup.py pypi
    • httptools *
    • pantherdb ==1.4.0
    • pydantic *
    • rich *
    • uvicorn *
    • watchfiles *