fastapi-ext-pkg 0.1.0__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.
- fastapi_ext_pkg-0.1.0.dist-info/METADATA +41 -0
- fastapi_ext_pkg-0.1.0.dist-info/RECORD +7 -0
- fastapi_ext_pkg-0.1.0.dist-info/WHEEL +5 -0
- fastapi_ext_pkg-0.1.0.dist-info/top_level.txt +1 -0
- fastapi_utils/__init__.py +0 -0
- fastapi_utils/middlewares/__init__.py +0 -0
- fastapi_utils/middlewares/remove_path.py +15 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: fastapi-ext-pkg
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A well-tailored utility set for FastAPI.
|
|
5
|
+
Author-email: Dotz Developers <devs-dotz@dotz.com>
|
|
6
|
+
Project-URL: Repository, https://github.com/DotzInc/fastapi-ext-pkg
|
|
7
|
+
Keywords: fastapi,utilities
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Internet
|
|
16
|
+
Classifier: Topic :: Software Development
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
Requires-Dist: fastapi
|
|
22
|
+
|
|
23
|
+
# FastAPI Extension Package
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+

|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
A well-tailored utility set for FastAPI.
|
|
30
|
+
|
|
31
|
+
## Requirements
|
|
32
|
+
|
|
33
|
+
* Python 3.8+
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
To install FastAPI Extension Package, use pip:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
pip install fastapi-ext-pkg
|
|
41
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
fastapi_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
fastapi_utils/middlewares/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
fastapi_utils/middlewares/remove_path.py,sha256=BGfgsMohqTnsTrM9Cbaj-FqV_gXRItF_AQLJI7nq88A,525
|
|
4
|
+
fastapi_ext_pkg-0.1.0.dist-info/METADATA,sha256=Ix7Nw7-9aTjbfqubtCvCB_nkQnlIiSwzmjeqOToqlhs,1321
|
|
5
|
+
fastapi_ext_pkg-0.1.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
6
|
+
fastapi_ext_pkg-0.1.0.dist-info/top_level.txt,sha256=jSucyIYN3mLIh602gLjfraUs1gt5crdjvD5oAS-0hZA,14
|
|
7
|
+
fastapi_ext_pkg-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fastapi_utils
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from starlette.types import ASGIApp, Receive, Scope, Send
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class RemovePathMiddleware:
|
|
5
|
+
def __init__(self, app: ASGIApp, path: str = "") -> None:
|
|
6
|
+
self.app = app
|
|
7
|
+
self.path = path if not path.endswith("/") else path[:-1]
|
|
8
|
+
|
|
9
|
+
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
|
|
10
|
+
if scope["type"] != "http":
|
|
11
|
+
return await self.app(scope, receive, send)
|
|
12
|
+
|
|
13
|
+
scope["path"] = scope["path"].replace(self.path, "", 1)
|
|
14
|
+
|
|
15
|
+
await self.app(scope, receive, send)
|