panther 1.7.2__py3-none-any.whl → 1.7.3__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.
panther/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from .main import Panther
2
2
 
3
- __version__ = '1.7.2'
3
+ __version__ = '1.7.3'
4
4
 
5
5
 
6
6
  def version():
panther/cli/template.py CHANGED
@@ -64,23 +64,29 @@ env = load_env(BASE_DIR / '.env')
64
64
  DB_NAME = env['DB_NAME']
65
65
  SECRET_KEY = env['SECRET_KEY']
66
66
 
67
-
67
+ # # # More Info: Https://PantherPy.GitHub.io/middlewares/
68
68
  MIDDLEWARES = [
69
69
  ('panther.middlewares.db.Middleware', {'url': f'pantherdb://{BASE_DIR}/{DB_NAME}.pantherdb'}),
70
70
  ]
71
71
 
72
72
  USER_MODEL = 'panther.db.models.User'
73
73
 
74
+ # # # More Info: Https://PantherPy.GitHub.io/authentications/
75
+ AUTHENTICATION = 'panther.authentications.JWTAuthentication'
76
+
77
+ # # # More Info: Https://PantherPy.GitHub.io/monitoring/
74
78
  MONITORING = True
75
79
 
80
+ # # # More Info: Https://PantherPy.GitHub.io/log_queries/
76
81
  LOG_QUERIES = True
77
82
 
83
+ # # # More Info: Https://PantherPy.GitHub.io/throttling/
84
+ THROTTLING = Throttling(rate=60, duration=timedelta(minutes=1))
85
+
86
+ # # # More Info: Https://PantherPy.GitHub.io/urls/
78
87
  URLs = 'core/urls.py'
79
88
  """ % datetime.now().date().isoformat()
80
89
 
81
- middlewares = """from panther.middlewares import BaseMiddleware
82
- """
83
-
84
90
  env = """
85
91
  SECRET_KEY = '%s'
86
92
 
@@ -102,8 +108,9 @@ urls = {
102
108
  git_ignore = """__pycache__/
103
109
  .venv/
104
110
  .idea/
105
- .env
106
111
  logs/
112
+
113
+ .env
107
114
  *.pantherdb
108
115
  """
109
116
 
@@ -115,11 +122,11 @@ Template = {
115
122
  'apis.py': apis_py,
116
123
  'models.py': models_py,
117
124
  'serializers.py': serializers_py,
125
+ 'throttling.py': throttling_py,
118
126
  'urls.py': app_urls_py,
119
127
  },
120
128
  'core': {
121
129
  'configs.py': configs_py,
122
- 'middlewares.py': middlewares,
123
130
  'urls.py': urls_py,
124
131
  },
125
132
  'main.py': main_py,
@@ -20,17 +20,9 @@ class Middleware(BaseMiddleware):
20
20
  self.kwargs['host'] = '127.0.0.1'
21
21
 
22
22
  def validate_port(self):
23
- if port := self.kwargs.get('port'):
24
- if isinstance(port, str):
25
- try:
26
- self.kwargs['port'] = int(port)
27
- except ValueError:
28
- logger.critical('Redis "port" should be number')
29
-
30
- elif not isinstance(port, int):
31
- logger.critical('Redis "port" is not valid.')
32
- else:
33
- self.kwargs['port'] = 6379
23
+ port = self.kwargs.setdefault('port', 6379)
24
+ if not isinstance(port, int):
25
+ logger.critical('Redis "port" is not valid.')
34
26
 
35
27
  async def before(self, request: Request) -> Request:
36
28
  self.redis = RedisConnection(**self.kwargs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: panther
3
- Version: 1.7.2
3
+ Version: 1.7.3
4
4
  Summary: Fast & Friendly, Web Framework For Building Async APIs
5
5
  Home-page: https://github.com/alirn76/panther
6
6
  Author: Ali RajabNezhad
@@ -26,10 +26,13 @@ Provides-Extra: full
26
26
  Requires-Dist: python-jose (>=3.3.0) ; extra == 'full'
27
27
  Requires-Dist: pymongo (>=4.3.3) ; extra == 'full'
28
28
 
29
-
30
29
  ## Panther
31
30
  <b>Is A Fast & Friendly, Web Framework For Building Async APIs With Python 3.11+</b>
32
31
 
32
+ <p align="center">
33
+ <img src="https://github.com/AliRn76/panther/raw/master/docs/docs/images/logo.png" alt="logo" style="width: 200px">
34
+ </p>
35
+
33
36
  >_Full Documentation_ -> [https://pantherpy.github.io](https://pantherpy.github.io)
34
37
  >
35
38
  >_PyPI_ -> [https://pypi.org/project/panther/](https://pypi.org/project/panther/)
@@ -1,4 +1,4 @@
1
- panther/__init__.py,sha256=ygDxTPGGfUKNshe0qxbpOmcLzCnsAtu3at9InCjZnRY,89
1
+ panther/__init__.py,sha256=ZNlrk0ToNVSaok7NcXQHwGl68nxc1gOv0q8amPR0wKU,89
2
2
  panther/_utils.py,sha256=EC-5HJnVsUmfY9LCoauUGtRsShGJVbL0ssvYn8CRvSU,3668
3
3
  panther/app.py,sha256=gHyxMH1nQrj_JlBKfdfYAXUXB_Yc3Xka9AYd5s8rVCo,6263
4
4
  panther/authentications.py,sha256=ZOpgWzaQXy5sGgXrWY_DtfHQ55hYLYOBt-BHejIYbZM,3124
@@ -19,7 +19,7 @@ panther/cli/create_command.py,sha256=F472b-4WH5vC7ZkvZ1qp3MHPr_j5BMM-Zdy2pAllFLI
19
19
  panther/cli/main.py,sha256=spotgTcfXquc07Sx4tdFpxdLJG2vcYJRpTyZZ9Up0sM,739
20
20
  panther/cli/monitor_command.py,sha256=ahInyna59bWW0LhIfI-CLoE8BKFFApLK9OtKR71vk4o,2076
21
21
  panther/cli/run_command.py,sha256=qpK2Bxe2_tyNppGmhhP1LRKDBVmTdlbZHlSNGAI33Jo,1509
22
- panther/cli/template.py,sha256=JWpmr8IzQ7StlutuYqxdezhzixoKUosoD2-aMOscy-k,2572
22
+ panther/cli/template.py,sha256=S9Q89WIyWqoBvA6izyBYIsLtBWZjG9XznLTxoZQbe8k,2974
23
23
  panther/cli/utils.py,sha256=rpjSK0T0-0m_UxAnYGPl0-zJ0fVlxmIFRYqhLAddBcY,8539
24
24
  panther/db/__init__.py,sha256=0mo9HwD_JAjJ-kRudbZqWNgzSxJ2t0ewh7Pa-83FhPY,50
25
25
  panther/db/connection.py,sha256=jQkY-JJu4LMHUau8-G6AQzlODwzESkghcLALe6wsR4g,2207
@@ -33,10 +33,10 @@ panther/middlewares/__init__.py,sha256=7RtHuS-MfybnJc6pcBSGhi9teXNhDsnJ3n7h_cXSk
33
33
  panther/middlewares/base.py,sha256=Php29ckITeGZm6GfauFG3i61bcsb4qoU8RpPLTqsfls,240
34
34
  panther/middlewares/db.py,sha256=C_PevTIaMykJl0NaaMYEfwE_oLdSLfKW2HR9UoPN1dU,508
35
35
  panther/middlewares/monitoring.py,sha256=oRFRGRNuoBOkGd46VYsXpRHRIklSuSglfuy574kHM4Y,863
36
- panther/middlewares/redis.py,sha256=bmKPDUH3Bs1ax-gYd7QX91KnvxROKAnuihvUlPqsNRI,1317
37
- panther-1.7.2.dist-info/LICENSE,sha256=2aF1hL2aC0zRPjzUkSxJUzZbn2_uLoOkn7DHjzZni-I,1524
38
- panther-1.7.2.dist-info/METADATA,sha256=3EcUNvXhZ_lRRxE38oUR90c88TSdgL-ezGJdtHbAjiQ,5391
39
- panther-1.7.2.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
40
- panther-1.7.2.dist-info/entry_points.txt,sha256=6GPxYFGuzVfNB4YpHFJvYex6iWah5_tLnirAHwj2Qsg,51
41
- panther-1.7.2.dist-info/top_level.txt,sha256=VbBs02JGXTIoHMzsX-eLOk2MCbBZzQbLhWiYpI7xI2g,8
42
- panther-1.7.2.dist-info/RECORD,,
36
+ panther/middlewares/redis.py,sha256=m_a0QPqUP_OJyuDJtRxCQpn5m_DLdrDIVHHFcytQmAU,1046
37
+ panther-1.7.3.dist-info/LICENSE,sha256=2aF1hL2aC0zRPjzUkSxJUzZbn2_uLoOkn7DHjzZni-I,1524
38
+ panther-1.7.3.dist-info/METADATA,sha256=4GHwPbXf3VMfZCuJFO_pmTGsp8MYI69hFL2oZQarkVo,5531
39
+ panther-1.7.3.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
40
+ panther-1.7.3.dist-info/entry_points.txt,sha256=6GPxYFGuzVfNB4YpHFJvYex6iWah5_tLnirAHwj2Qsg,51
41
+ panther-1.7.3.dist-info/top_level.txt,sha256=VbBs02JGXTIoHMzsX-eLOk2MCbBZzQbLhWiYpI7xI2g,8
42
+ panther-1.7.3.dist-info/RECORD,,