panther 5.0.0b3__py3-none-any.whl → 5.0.0b5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. panther/__init__.py +1 -1
  2. panther/_load_configs.py +46 -37
  3. panther/_utils.py +49 -34
  4. panther/app.py +96 -97
  5. panther/authentications.py +97 -50
  6. panther/background_tasks.py +98 -124
  7. panther/base_request.py +16 -10
  8. panther/base_websocket.py +8 -8
  9. panther/caching.py +16 -80
  10. panther/cli/create_command.py +17 -16
  11. panther/cli/main.py +1 -1
  12. panther/cli/monitor_command.py +11 -6
  13. panther/cli/run_command.py +5 -71
  14. panther/cli/template.py +7 -7
  15. panther/cli/utils.py +58 -69
  16. panther/configs.py +70 -72
  17. panther/db/connections.py +30 -24
  18. panther/db/cursor.py +3 -1
  19. panther/db/models.py +26 -10
  20. panther/db/queries/base_queries.py +4 -5
  21. panther/db/queries/mongodb_queries.py +21 -21
  22. panther/db/queries/pantherdb_queries.py +1 -1
  23. panther/db/queries/queries.py +26 -8
  24. panther/db/utils.py +1 -1
  25. panther/events.py +25 -14
  26. panther/exceptions.py +2 -7
  27. panther/file_handler.py +1 -1
  28. panther/generics.py +74 -100
  29. panther/logging.py +2 -1
  30. panther/main.py +12 -13
  31. panther/middlewares/cors.py +67 -0
  32. panther/middlewares/monitoring.py +5 -3
  33. panther/openapi/urls.py +2 -2
  34. panther/openapi/utils.py +3 -3
  35. panther/openapi/views.py +20 -37
  36. panther/pagination.py +4 -2
  37. panther/panel/apis.py +2 -7
  38. panther/panel/urls.py +2 -6
  39. panther/panel/utils.py +9 -5
  40. panther/panel/views.py +13 -22
  41. panther/permissions.py +2 -1
  42. panther/request.py +2 -1
  43. panther/response.py +101 -94
  44. panther/routings.py +12 -12
  45. panther/serializer.py +20 -43
  46. panther/test.py +73 -58
  47. panther/throttling.py +68 -3
  48. panther/utils.py +5 -11
  49. panther-5.0.0b5.dist-info/METADATA +188 -0
  50. panther-5.0.0b5.dist-info/RECORD +75 -0
  51. panther/monitoring.py +0 -34
  52. panther-5.0.0b3.dist-info/METADATA +0 -223
  53. panther-5.0.0b3.dist-info/RECORD +0 -75
  54. {panther-5.0.0b3.dist-info → panther-5.0.0b5.dist-info}/WHEEL +0 -0
  55. {panther-5.0.0b3.dist-info → panther-5.0.0b5.dist-info}/entry_points.txt +0 -0
  56. {panther-5.0.0b3.dist-info → panther-5.0.0b5.dist-info}/licenses/LICENSE +0 -0
  57. {panther-5.0.0b3.dist-info → panther-5.0.0b5.dist-info}/top_level.txt +0 -0
@@ -1,223 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: panther
3
- Version: 5.0.0b3
4
- Summary: Fast & Friendly, Web Framework For Building Async APIs
5
- Home-page: https://github.com/alirn76/panther
6
- Author: Ali RajabNezhad
7
- Author-email: alirn76@yahoo.com
8
- License: BSD-3-Clause license
9
- Classifier: Operating System :: OS Independent
10
- Classifier: Programming Language :: Python :: 3.10
11
- Classifier: Programming Language :: Python :: 3.11
12
- Classifier: Programming Language :: Python :: 3.12
13
- Classifier: Programming Language :: Python :: 3.13
14
- Requires-Python: >=3.10
15
- Description-Content-Type: text/markdown
16
- License-File: LICENSE
17
- Requires-Dist: pantherdb~=2.2.3
18
- Requires-Dist: orjson~=3.9.15
19
- Requires-Dist: pydantic~=2.10.6
20
- Requires-Dist: rich~=13.9.4
21
- Requires-Dist: uvicorn~=0.34.0
22
- Requires-Dist: pytz~=2025.2
23
- Requires-Dist: Jinja2~=3.1
24
- Requires-Dist: simple-ulid~=1.0.0
25
- Requires-Dist: httptools~=0.6.4
26
- Provides-Extra: full
27
- Requires-Dist: redis==5.2.1; extra == "full"
28
- Requires-Dist: motor~=3.7.0; extra == "full"
29
- Requires-Dist: ipython~=9.0.2; extra == "full"
30
- Requires-Dist: python-jose~=3.4.0; extra == "full"
31
- Requires-Dist: ruff~=0.11.2; extra == "full"
32
- Requires-Dist: websockets~=15.0.1; extra == "full"
33
- Requires-Dist: cryptography~=44.0.2; extra == "full"
34
- Requires-Dist: watchfiles~=1.0.4; extra == "full"
35
- Provides-Extra: dev
36
- Requires-Dist: ruff~=0.11.2; extra == "dev"
37
- Requires-Dist: pytest~=8.3.5; extra == "dev"
38
- Dynamic: author
39
- Dynamic: author-email
40
- Dynamic: classifier
41
- Dynamic: description
42
- Dynamic: description-content-type
43
- Dynamic: home-page
44
- Dynamic: license
45
- Dynamic: license-file
46
- Dynamic: provides-extra
47
- Dynamic: requires-dist
48
- Dynamic: requires-python
49
- Dynamic: summary
50
-
51
-
52
- [![PyPI](https://img.shields.io/pypi/v/panther?label=PyPI)](https://pypi.org/project/panther/) [![PyVersion](https://img.shields.io/pypi/pyversions/panther.svg)](https://pypi.org/project/panther/) [![codecov](https://codecov.io/github/AliRn76/panther/graph/badge.svg?token=YWFQA43GSP)](https://codecov.io/github/AliRn76/panther) [![Downloads](https://static.pepy.tech/badge/panther/month)](https://pepy.tech/project/panther) [![license](https://img.shields.io/github/license/alirn76/panther.svg)](https://github.com/alirn76/panther/blob/main/LICENSE)
53
-
54
-
55
- ## Panther
56
- <b>Is A Fast & Friendly Web Framework For Building Async APIs With Python 3.10+</b>
57
-
58
- <p align="center">
59
- <img src="https://github.com/AliRn76/panther/raw/master/docs/docs/images/logo-vertical.png" alt="logo" style="width: 450px">
60
- </p>
61
-
62
- **_📚 Full Documentation:_** [PantherPy.GitHub.io](https://pantherpy.github.io)
63
-
64
- ---
65
-
66
- ### Why Use Panther ?
67
- - Include Simple **File-Base** Database ([PantherDB](https://pypi.org/project/pantherdb/))
68
- - Built-in Document-oriented Databases **ODM** (**MongoDB**, PantherDB)
69
- - Built-in **Websocket** Support
70
- - Built-in API **Caching** System (In Memory, **Redis**)
71
- - Built-in **Authentication** Classes
72
- - Built-in **Permission** Classes
73
- - Built-in Visual API **Monitoring** (In Terminal)
74
- - Support Custom **Background Tasks**
75
- - Support Custom **Middlewares**
76
- - Support Custom **Throttling**
77
- - Support **Function-Base** and **Class-Base** APIs
78
- - It's One Of The **Fastest Python Framework** ([Benchmark](https://www.techempower.com/benchmarks/#section=test&runid=d3364379-1bf7-465f-bcb1-e9c65b4840f9&hw=ph&test=fortune&l=zik0zj-6bi))
79
- ---
80
-
81
- ### Supported by
82
- <center>
83
- <a href="https://drive.google.com/file/d/17xe1hicIiRF7SQ-clg9SETdc19SktCbV/view?usp=sharing">
84
- <img alt="jetbrains" src="https://github.com/AliRn76/panther/raw/master/docs/docs/images/jb_beam_50x50.png">
85
- </a>
86
- </center>
87
-
88
- ---
89
-
90
- ### Installation
91
- ```shell
92
- $ pip install panther
93
- ```
94
-
95
- ### Usage
96
-
97
- - #### Create Project
98
-
99
- ```shell
100
- $ panther create
101
- ```
102
-
103
- - #### Run Project
104
-
105
- ```shell
106
- $ panther run --reload
107
- ```
108
- _* Panther uses [Uvicorn](https://github.com/encode/uvicorn) as ASGI (Asynchronous Server Gateway Interface) but you can run the project with [Granian](https://pypi.org/project/granian/), [daphne](https://pypi.org/project/daphne/) or any ASGI server_
109
-
110
- - #### Monitoring Requests
111
-
112
- ```shell
113
- $ panther monitor
114
- ```
115
-
116
- - #### Python Shell
117
-
118
- ```shell
119
- $ panther shell
120
- ```
121
-
122
- ---
123
-
124
- ### API Example
125
- - Create `main.py`
126
-
127
- ```python
128
- from datetime import datetime, timedelta
129
-
130
- from panther import status, Panther
131
- from panther.app import GenericAPI
132
- from panther.response import Response
133
-
134
-
135
- class FirstAPI(GenericAPI):
136
- # Cache Response For 10 Seconds
137
- cache = True
138
- cache_exp_time = timedelta(seconds=10)
139
-
140
- def get(self):
141
- date_time = datetime.now().isoformat()
142
- data = {'detail': f'Hello World | {date_time}'}
143
- return Response(data=data, status_code=status.HTTP_202_ACCEPTED)
144
-
145
-
146
- url_routing = {'': FirstAPI}
147
- app = Panther(__name__, configs=__name__, urls=url_routing)
148
- ```
149
-
150
- - Run the project:
151
- - `$ panther run --reload`
152
-
153
- - Checkout the [http://127.0.0.1:8000/](http://127.0.0.1:8000/)
154
-
155
- ### WebSocket Echo Example
156
- - Create `main.py`
157
-
158
- ```python
159
- from panther import Panther
160
- from panther.app import GenericAPI
161
- from panther.response import HTMLResponse
162
- from panther.websocket import GenericWebsocket
163
-
164
-
165
- class FirstWebsocket(GenericWebsocket):
166
- async def connect(self, **kwargs):
167
- await self.accept()
168
-
169
- async def receive(self, data: str | bytes):
170
- await self.send(data)
171
-
172
-
173
- class MainPage(GenericAPI):
174
- def get(self):
175
- template = """
176
- <input type="text" id="messageInput">
177
- <button id="sendButton">Send Message</button>
178
- <ul id="messages"></ul>
179
- <script>
180
- var socket = new WebSocket('ws://127.0.0.1:8000/ws');
181
- socket.addEventListener('message', function (event) {
182
- var li = document.createElement('li');
183
- document.getElementById('messages').appendChild(li).textContent = 'Server: ' + event.data;
184
- });
185
- function sendMessage() {
186
- socket.send(document.getElementById('messageInput').value);
187
- }
188
- document.getElementById('sendButton').addEventListener('click', sendMessage);
189
- </script>
190
- """
191
- return HTMLResponse(template)
192
-
193
- url_routing = {
194
- '': MainPage,
195
- 'ws': FirstWebsocket,
196
- }
197
- app = Panther(__name__, configs=__name__, urls=url_routing)
198
-
199
- ```
200
-
201
- - Run the project:
202
- - `$ panther run --reload`
203
- - Go to [http://127.0.0.1:8000/](http://127.0.0.1:8000/) and work with your `websocket`
204
-
205
-
206
-
207
- > **Next Step: [First CRUD](https://pantherpy.github.io/function_first_crud)**
208
-
209
- ---
210
-
211
- ### How Panther Works!
212
-
213
- ![diagram](https://raw.githubusercontent.com/AliRn76/panther/master/docs/docs/images/diagram.png)
214
-
215
- ---
216
-
217
- ### Roadmap
218
-
219
- ![roadmap](https://raw.githubusercontent.com/AliRn76/panther/master/docs/docs/images/roadmap.jpg)
220
-
221
- ---
222
-
223
- **If you find this project useful, please give it a star ⭐️.**
@@ -1,75 +0,0 @@
1
- panther/__init__.py,sha256=la_y7QiSYvUdOTeTmsqJ3e0xamVirhHq_r7NhnuAqqY,115
2
- panther/_load_configs.py,sha256=1mMZeULMIgCxuPIXjNCdMPpqpjBm_rf4IgiD7Zk5MWs,10964
3
- panther/_utils.py,sha256=nJK4QdTB9SmcVoRKy3hRvcdvceVGlBQ-MQG38j1BLc8,4130
4
- panther/app.py,sha256=x8UsN3Ct2LfnvyXHkX_yIimBV73W19sL5xxF3RSRaMw,11074
5
- panther/authentications.py,sha256=LK-4fESiGnot2kwxg5qm5RXTOOcqOnMTQ-HL4UBtc0g,6259
6
- panther/background_tasks.py,sha256=HBYubDIiO_673cl_5fqCUP9zzimzRgRkDSkag9Msnbs,7656
7
- panther/base_request.py,sha256=j87aeRFlR8Ix8Nrl0vehuL9QTkKtx7IVG8euUwGXh6U,4606
8
- panther/base_websocket.py,sha256=tqdbDwCJmyonUNAp5-XeIcjxZjALfDwviAbYKU6mY24,11003
9
- panther/caching.py,sha256=0UWg2xlTkyTKcf6rMjf-oZIE_kJWpPfpKKaDOCZxazg,4299
10
- panther/configs.py,sha256=Ge2GlMxkG9UY5ySp_7hvXy_kV6_ipHv1uKoL_L3Tntc,3408
11
- panther/events.py,sha256=tJvqkUA_Zs-tO_6ZpBmP_KkreFeM70fX8A7V6bCJUsU,1360
12
- panther/exceptions.py,sha256=UEwpIIG57zNEm2CouU5Bi_mSUWYNEXi2FKqhjhMc4js,2288
13
- panther/file_handler.py,sha256=I94tpbtTVniBnnUMkFr3Eis6kPDt8sLzS5u8TzFrR5I,1323
14
- panther/generics.py,sha256=NVq43L8rz1jtMYD66O3p0DR295fiiongjq8bPIqBLeE,7261
15
- panther/logging.py,sha256=SGgF9faQM1QmbmMPVc6m1DY-TbV329kTD8BuzGLx3I0,2073
16
- panther/main.py,sha256=aEDGWjOe2rABEYyEkPGKLt4m45lJM6hEOGKYCiEHxk8,7599
17
- panther/monitoring.py,sha256=C0tYBKGci6QR33CN-MixMzCP24ka0a6V0AU2H1sS4HU,1026
18
- panther/pagination.py,sha256=VvvNsMObIarjUx9F8T91TX-9A2Ymy18Ms_hB60lZdEA,1641
19
- panther/permissions.py,sha256=9-J5vzvEKa_PITwEVQbZZv8PG2FOu05YBlD5yMrKcfc,348
20
- panther/request.py,sha256=Ho2tKvwZSKA4_sklZQNE9hjFuVrbt0O5R6sZ1HtCfI0,1861
21
- panther/response.py,sha256=Wq90Tt6Bt0NLi6QDXwkdovqR2cvz2_SqmGTRIKFDbos,9958
22
- panther/routings.py,sha256=Hcug2JZXwqR44PDSgkvG9v2dUgSNDJEIbm8E7t4Q72U,6414
23
- panther/serializer.py,sha256=R5U9H75QRbyCq_CI_i9STlnAKit-DDEPH6-AZ2RyDmA,9085
24
- panther/status.py,sha256=Gc_PnYrHfInTsZpGbqiCfDB-py1C7Rh8KMdb6Lq9Exs,3346
25
- panther/test.py,sha256=RsQtP5IURLWR__BihOjruWoX3NscmGDqDqj1CfAb3bI,7037
26
- panther/throttling.py,sha256=mVa_mGv6w_Ad7LLtV4eG5QpDwwNsk4QjFFi0mIHQBnE,231
27
- panther/utils.py,sha256=92t9NFjzdswN133utDc2ovPgOZzqy_nF4bbrb5DDuY0,4307
28
- panther/websocket.py,sha256=er44pGU3Zm-glj4imS5l1Qdk7WNc_3Jpq7SPkeApPlM,1532
29
- panther/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- panther/cli/create_command.py,sha256=3_2xGWzJjdhCCgQHYvn7ikCl12wqTw6jT_Pu2EvfZWc,10344
31
- panther/cli/main.py,sha256=XvkKMJsi-wvWO7GJsDQng7RShK8UnnKICu3c1H9OFNY,1517
32
- panther/cli/monitor_command.py,sha256=ga8-6shrq0cz3Lo6ueSPZuetkLFdypesVO6fVQE01KM,4219
33
- panther/cli/run_command.py,sha256=yWcDoWC-c4ph4M5EDj0jvR9xSjh-apG5r6-NpDdArUo,2195
34
- panther/cli/template.py,sha256=ZIU4hLy9aNGCtUMt0LS8zoUf6daYQrLDteN-iLkIWTI,5349
35
- panther/cli/utils.py,sha256=84W0bS-FPoJf3BsgOei2OBeoflcxXwy99Gft0ujF1Ss,5355
36
- panther/db/__init__.py,sha256=w9lEL0vRqb18Qx_iUJipUR_fi5GQ5uVX0DWycx14x08,50
37
- panther/db/connections.py,sha256=8QHQ_tmni4gfLHQCR7jmBFfvFgJCOrTQXdQiDRJRuv0,4205
38
- panther/db/cursor.py,sha256=EvjVyOIkg_uynX5vCpVFpAzAw0Yb_R0II8mKgqBN_7c,1784
39
- panther/db/models.py,sha256=gmqWjqbDE6DggTmUnqAipi9l0JfmDgiXttr9qCKK208,2793
40
- panther/db/utils.py,sha256=ZZa3TMkuRtssl5ZRItFLonyxvMFsTq4fmTD4BblhLDA,1589
41
- panther/db/queries/__init__.py,sha256=uF4gvBjLBJ-Yl3WLqoZEVNtHCVhFRKW3_Vi44pJxDNI,45
42
- panther/db/queries/base_queries.py,sha256=GG3F9qFrIl6ibzvbjfDonztJvkUbjzPYHo8PNcdcj-0,3775
43
- panther/db/queries/mongodb_queries.py,sha256=QCP1ibnd-x8js8XIC4nhgdfiJAj1606CkpSQ_-j2y8Y,13394
44
- panther/db/queries/pantherdb_queries.py,sha256=h6LNsEk7srJw-dpqTl46ZSAO5BLFGVymQ4JnU75B4zM,4611
45
- panther/db/queries/queries.py,sha256=sTa0m9q8tf2ugbFDmj4GRfRQOyNFmSBFfDqIVcRjKIM,12433
46
- panther/middlewares/__init__.py,sha256=8VXd-K3L0a5ZkGb-NUipn3K8wxWAVIiOM7fQrcm_dTM,87
47
- panther/middlewares/base.py,sha256=V5PuuemMCrQslIBK-sER4YZGdSDMzRFhZHjRUiIkhbY,721
48
- panther/middlewares/monitoring.py,sha256=pxbRiM20grCNyAJZwouAOe3gLbdveSObStJF5WdCFyA,1486
49
- panther/openapi/__init__.py,sha256=UAkcGDxOltOkZwx3vZjigwfHUdb4xnidC6e_Viezfv4,47
50
- panther/openapi/urls.py,sha256=99f7hx_z65Vw6p9Kg-Vz5hU9_FlIhJeVnA1-CPm1TTI,70
51
- panther/openapi/utils.py,sha256=YxBA9HUShgoH0MphW27xL_qS0uIA0gQsh705hxnJlYE,6504
52
- panther/openapi/views.py,sha256=5B1BifNeUojLVs3ygk7KOEjUSnsMllslSdFgsPgd8yA,3908
53
- panther/openapi/templates/openapi.html,sha256=VAaJytOBFuR1rvGXOxbXOoJlurbeAl-VuTZu7Hk6LLs,889
54
- panther/panel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
- panther/panel/apis.py,sha256=COsbwKZyTgyHvHYbpDfusifAH9ojMS3z1KhZCt9M-Ms,2428
56
- panther/panel/middlewares.py,sha256=xOYpIsy-fqc8OuieePLviUxmR6Tsu-kg3UtgerUKyHo,379
57
- panther/panel/urls.py,sha256=xLEy1qA4MWOLApkecyz1FxDefNthOUCqYft5XsctKys,387
58
- panther/panel/utils.py,sha256=UFDPmST-c5T-pa5bg4wBIzZMgQIgAqervL4ojOeofq8,4219
59
- panther/panel/views.py,sha256=OYCjqVZr1o3MVXtybmsaipUsLE9FwUxc3t1kX-_KlsA,5201
60
- panther/panel/templates/base.html,sha256=kHDzfmlIf14eLrZHymIHdywr36W7cJXKtqFpVhw-x34,327
61
- panther/panel/templates/create.html,sha256=2cKjWpNElv390PPYzoI7MGqVjgy9692x3vpxwAJE7GE,581
62
- panther/panel/templates/create.js,sha256=zO_GfaHnjVI25zx4wGhUPA7aEkCukKMpabJfuiOib7c,40180
63
- panther/panel/templates/detail.html,sha256=wFuePktVNchECgPhMxlXjX_KH3tqQvVsTTUmtOWsqjA,1490
64
- panther/panel/templates/home.html,sha256=vSVHoCWeqY4AhQiC-UVAvu10m2bINneO6_PLyOS9R4Q,238
65
- panther/panel/templates/home.js,sha256=bC8io0iKdAftSvrapkwx7ZPAbVq3UzapV9sv5uWa8FY,849
66
- panther/panel/templates/login.html,sha256=W6V1rgHAno7yTbP6Il38ZvJp4LdlJ8BjM4UuyPkjaTA,1625
67
- panther/panel/templates/sidebar.html,sha256=XikovZsJrth0nvKogvZoh3Eb2Bq7xdeGTlsdlyud450,618
68
- panther/panel/templates/table.html,sha256=fWdaIHEHAuwuPaAfOtXkD-3yvSocyDmtys00_D2yRh8,2176
69
- panther/panel/templates/table.js,sha256=MTdf77571Gtmg4l8HkY-5fM-utIL3lc0O8hv6vLBCYk,10414
70
- panther-5.0.0b3.dist-info/licenses/LICENSE,sha256=2aF1hL2aC0zRPjzUkSxJUzZbn2_uLoOkn7DHjzZni-I,1524
71
- panther-5.0.0b3.dist-info/METADATA,sha256=UYetTvZEU_dVXjP_3Vz4FY6vgiX20nJZl9lZSUvxLyM,7026
72
- panther-5.0.0b3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
- panther-5.0.0b3.dist-info/entry_points.txt,sha256=6GPxYFGuzVfNB4YpHFJvYex6iWah5_tLnirAHwj2Qsg,51
74
- panther-5.0.0b3.dist-info/top_level.txt,sha256=VbBs02JGXTIoHMzsX-eLOk2MCbBZzQbLhWiYpI7xI2g,8
75
- panther-5.0.0b3.dist-info/RECORD,,