fastapi-basic 0.1.7__tar.gz → 0.1.8__tar.gz
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.
Potentially problematic release.
This version of fastapi-basic might be problematic. Click here for more details.
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/PKG-INFO +13 -1
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/base_config.py +6 -1
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/base_factory.py +15 -1
- fastapi_basic-0.1.8/fastapi_basic/const.py +4 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic.egg-info/PKG-INFO +13 -1
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic.egg-info/requires.txt +12 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/setup.py +1 -1
- fastapi_basic-0.1.7/fastapi_basic/const.py +0 -2
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/README.md +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/__init__.py +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/database/__init__.py +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/database/mongodb.py +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/exception/__init__.py +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/exception/base_exception.py +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/ext/__init__.py +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/ext/aws/__init__.py +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/ext/aws/const.py +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/ext/line/__init__.py +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic/utils.py +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic.egg-info/SOURCES.txt +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic.egg-info/dependency_links.txt +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/fastapi_basic.egg-info/top_level.txt +0 -0
- {fastapi_basic-0.1.7 → fastapi_basic-0.1.8}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi_basic
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
4
4
|
Summary: A short description of your module
|
|
5
5
|
Home-page: https://github.com/szx21023/fastapi-base
|
|
6
6
|
Author: szx21023
|
|
@@ -14,14 +14,20 @@ Requires-Dist: aenum==3.1.16
|
|
|
14
14
|
Requires-Dist: aiohappyeyeballs==2.6.1
|
|
15
15
|
Requires-Dist: aiohttp==3.10.5
|
|
16
16
|
Requires-Dist: aiosignal==1.3.2
|
|
17
|
+
Requires-Dist: amqp==5.3.1
|
|
17
18
|
Requires-Dist: annotated-types==0.7.0
|
|
18
19
|
Requires-Dist: anyio==4.9.0
|
|
19
20
|
Requires-Dist: attrs==25.3.0
|
|
21
|
+
Requires-Dist: billiard==4.2.1
|
|
20
22
|
Requires-Dist: boto3==1.37.36
|
|
21
23
|
Requires-Dist: botocore==1.37.36
|
|
24
|
+
Requires-Dist: celery==5.5.2
|
|
22
25
|
Requires-Dist: certifi==2025.1.31
|
|
23
26
|
Requires-Dist: charset-normalizer==3.4.1
|
|
24
27
|
Requires-Dist: click==8.1.8
|
|
28
|
+
Requires-Dist: click-didyoumean==0.3.1
|
|
29
|
+
Requires-Dist: click-plugins==1.1.1
|
|
30
|
+
Requires-Dist: click-repl==0.3.0
|
|
25
31
|
Requires-Dist: Deprecated==1.2.18
|
|
26
32
|
Requires-Dist: dotenv==0.9.9
|
|
27
33
|
Requires-Dist: fastapi==0.115.12
|
|
@@ -30,14 +36,17 @@ Requires-Dist: future==1.0.0
|
|
|
30
36
|
Requires-Dist: h11==0.14.0
|
|
31
37
|
Requires-Dist: idna==3.10
|
|
32
38
|
Requires-Dist: jmespath==1.0.1
|
|
39
|
+
Requires-Dist: kombu==5.5.3
|
|
33
40
|
Requires-Dist: line-bot-sdk==3.12.0
|
|
34
41
|
Requires-Dist: multidict==6.4.3
|
|
42
|
+
Requires-Dist: prompt_toolkit==3.0.51
|
|
35
43
|
Requires-Dist: propcache==0.3.1
|
|
36
44
|
Requires-Dist: pydantic==2.11.3
|
|
37
45
|
Requires-Dist: pydantic_core==2.33.1
|
|
38
46
|
Requires-Dist: python-dateutil==2.9.0.post0
|
|
39
47
|
Requires-Dist: python-dotenv==1.1.0
|
|
40
48
|
Requires-Dist: python-multipart==0.0.20
|
|
49
|
+
Requires-Dist: redis==6.1.0
|
|
41
50
|
Requires-Dist: requests==2.32.3
|
|
42
51
|
Requires-Dist: s3transfer==0.11.5
|
|
43
52
|
Requires-Dist: six==1.17.0
|
|
@@ -45,9 +54,12 @@ Requires-Dist: sniffio==1.3.1
|
|
|
45
54
|
Requires-Dist: starlette==0.46.1
|
|
46
55
|
Requires-Dist: typing-inspection==0.4.0
|
|
47
56
|
Requires-Dist: typing_extensions==4.13.1
|
|
57
|
+
Requires-Dist: tzdata==2025.2
|
|
48
58
|
Requires-Dist: urllib3==2.3.0
|
|
49
59
|
Requires-Dist: uvicorn==0.34.0
|
|
60
|
+
Requires-Dist: vine==5.1.0
|
|
50
61
|
Requires-Dist: watchtower==3.4.0
|
|
62
|
+
Requires-Dist: wcwidth==0.2.13
|
|
51
63
|
Requires-Dist: wrapt==1.17.2
|
|
52
64
|
Requires-Dist: yarl==1.20.0
|
|
53
65
|
Dynamic: author
|
|
@@ -14,4 +14,9 @@ class BaseConfig(BaseSettings):
|
|
|
14
14
|
AWS_SECRET_KEY: str = ""
|
|
15
15
|
AWS_REGION: str = ""
|
|
16
16
|
AWS_PARAMETER_PATH_PREFIX: str = ""
|
|
17
|
-
AWS_LOGGROUP_NAME: str = ""
|
|
17
|
+
AWS_LOGGROUP_NAME: str = ""
|
|
18
|
+
|
|
19
|
+
# Celery config
|
|
20
|
+
CELERY_APP: str|None = ""
|
|
21
|
+
CELERY_BROKER_URL: str|None = ""
|
|
22
|
+
CELERY_BACKEND_URL: str|None = ""
|
|
@@ -3,13 +3,14 @@ from functools import lru_cache
|
|
|
3
3
|
import os, dotenv
|
|
4
4
|
|
|
5
5
|
import watchtower
|
|
6
|
+
from celery import Celery
|
|
6
7
|
from fastapi import FastAPI, HTTPException, Request
|
|
7
8
|
from fastapi.responses import JSONResponse
|
|
8
9
|
from fastapi.middleware.cors import CORSMiddleware
|
|
9
10
|
from starlette.concurrency import iterate_in_threadpool
|
|
10
11
|
import logging
|
|
11
12
|
|
|
12
|
-
from .const import LOG_DEFAULT_LOGGER_NAME, LOG_FMT
|
|
13
|
+
from .const import LOG_DEFAULT_LOGGER_NAME, LOG_FMT, CELERY_CONFIG
|
|
13
14
|
from .ext.aws import init_app as init_aws_app
|
|
14
15
|
from .exception.base_exception import InternalBaseException
|
|
15
16
|
from .utils import update_dict_with_cast
|
|
@@ -48,6 +49,17 @@ class BaseFactory(metaclass=ABCMeta):
|
|
|
48
49
|
watchtower_handler.setFormatter(logging.Formatter(LOG_FMT))
|
|
49
50
|
app.logger.addHandler(watchtower_handler)
|
|
50
51
|
|
|
52
|
+
def __setup_celery_app(self, app):
|
|
53
|
+
if not all([app.state.config.get(key) for key in CELERY_CONFIG]):
|
|
54
|
+
app.logger.info("Lack Celery config keys, ignore get Celery_app")
|
|
55
|
+
return None
|
|
56
|
+
|
|
57
|
+
app.state.celery_app = Celery(
|
|
58
|
+
app.state.config.get("CELERY_APP"),
|
|
59
|
+
broker=app.state.config.get("CELERY_BROKER_URL"),
|
|
60
|
+
backend=app.state.config.get("CELERY_BACKEND_URL")
|
|
61
|
+
)
|
|
62
|
+
|
|
51
63
|
def create_app(self):
|
|
52
64
|
"""
|
|
53
65
|
Create an application instance.
|
|
@@ -68,6 +80,8 @@ class BaseFactory(metaclass=ABCMeta):
|
|
|
68
80
|
app.state.aws_session = init_aws_app(app)
|
|
69
81
|
self.__setup_aws_cloud_log(app)
|
|
70
82
|
|
|
83
|
+
self.__setup_celery_app(app)
|
|
84
|
+
|
|
71
85
|
@app.exception_handler(InternalBaseException)
|
|
72
86
|
async def http_exception_handler(request: Request, exc: InternalBaseException):
|
|
73
87
|
return JSONResponse(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi_basic
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
4
4
|
Summary: A short description of your module
|
|
5
5
|
Home-page: https://github.com/szx21023/fastapi-base
|
|
6
6
|
Author: szx21023
|
|
@@ -14,14 +14,20 @@ Requires-Dist: aenum==3.1.16
|
|
|
14
14
|
Requires-Dist: aiohappyeyeballs==2.6.1
|
|
15
15
|
Requires-Dist: aiohttp==3.10.5
|
|
16
16
|
Requires-Dist: aiosignal==1.3.2
|
|
17
|
+
Requires-Dist: amqp==5.3.1
|
|
17
18
|
Requires-Dist: annotated-types==0.7.0
|
|
18
19
|
Requires-Dist: anyio==4.9.0
|
|
19
20
|
Requires-Dist: attrs==25.3.0
|
|
21
|
+
Requires-Dist: billiard==4.2.1
|
|
20
22
|
Requires-Dist: boto3==1.37.36
|
|
21
23
|
Requires-Dist: botocore==1.37.36
|
|
24
|
+
Requires-Dist: celery==5.5.2
|
|
22
25
|
Requires-Dist: certifi==2025.1.31
|
|
23
26
|
Requires-Dist: charset-normalizer==3.4.1
|
|
24
27
|
Requires-Dist: click==8.1.8
|
|
28
|
+
Requires-Dist: click-didyoumean==0.3.1
|
|
29
|
+
Requires-Dist: click-plugins==1.1.1
|
|
30
|
+
Requires-Dist: click-repl==0.3.0
|
|
25
31
|
Requires-Dist: Deprecated==1.2.18
|
|
26
32
|
Requires-Dist: dotenv==0.9.9
|
|
27
33
|
Requires-Dist: fastapi==0.115.12
|
|
@@ -30,14 +36,17 @@ Requires-Dist: future==1.0.0
|
|
|
30
36
|
Requires-Dist: h11==0.14.0
|
|
31
37
|
Requires-Dist: idna==3.10
|
|
32
38
|
Requires-Dist: jmespath==1.0.1
|
|
39
|
+
Requires-Dist: kombu==5.5.3
|
|
33
40
|
Requires-Dist: line-bot-sdk==3.12.0
|
|
34
41
|
Requires-Dist: multidict==6.4.3
|
|
42
|
+
Requires-Dist: prompt_toolkit==3.0.51
|
|
35
43
|
Requires-Dist: propcache==0.3.1
|
|
36
44
|
Requires-Dist: pydantic==2.11.3
|
|
37
45
|
Requires-Dist: pydantic_core==2.33.1
|
|
38
46
|
Requires-Dist: python-dateutil==2.9.0.post0
|
|
39
47
|
Requires-Dist: python-dotenv==1.1.0
|
|
40
48
|
Requires-Dist: python-multipart==0.0.20
|
|
49
|
+
Requires-Dist: redis==6.1.0
|
|
41
50
|
Requires-Dist: requests==2.32.3
|
|
42
51
|
Requires-Dist: s3transfer==0.11.5
|
|
43
52
|
Requires-Dist: six==1.17.0
|
|
@@ -45,9 +54,12 @@ Requires-Dist: sniffio==1.3.1
|
|
|
45
54
|
Requires-Dist: starlette==0.46.1
|
|
46
55
|
Requires-Dist: typing-inspection==0.4.0
|
|
47
56
|
Requires-Dist: typing_extensions==4.13.1
|
|
57
|
+
Requires-Dist: tzdata==2025.2
|
|
48
58
|
Requires-Dist: urllib3==2.3.0
|
|
49
59
|
Requires-Dist: uvicorn==0.34.0
|
|
60
|
+
Requires-Dist: vine==5.1.0
|
|
50
61
|
Requires-Dist: watchtower==3.4.0
|
|
62
|
+
Requires-Dist: wcwidth==0.2.13
|
|
51
63
|
Requires-Dist: wrapt==1.17.2
|
|
52
64
|
Requires-Dist: yarl==1.20.0
|
|
53
65
|
Dynamic: author
|
|
@@ -2,14 +2,20 @@ aenum==3.1.16
|
|
|
2
2
|
aiohappyeyeballs==2.6.1
|
|
3
3
|
aiohttp==3.10.5
|
|
4
4
|
aiosignal==1.3.2
|
|
5
|
+
amqp==5.3.1
|
|
5
6
|
annotated-types==0.7.0
|
|
6
7
|
anyio==4.9.0
|
|
7
8
|
attrs==25.3.0
|
|
9
|
+
billiard==4.2.1
|
|
8
10
|
boto3==1.37.36
|
|
9
11
|
botocore==1.37.36
|
|
12
|
+
celery==5.5.2
|
|
10
13
|
certifi==2025.1.31
|
|
11
14
|
charset-normalizer==3.4.1
|
|
12
15
|
click==8.1.8
|
|
16
|
+
click-didyoumean==0.3.1
|
|
17
|
+
click-plugins==1.1.1
|
|
18
|
+
click-repl==0.3.0
|
|
13
19
|
Deprecated==1.2.18
|
|
14
20
|
dotenv==0.9.9
|
|
15
21
|
fastapi==0.115.12
|
|
@@ -18,14 +24,17 @@ future==1.0.0
|
|
|
18
24
|
h11==0.14.0
|
|
19
25
|
idna==3.10
|
|
20
26
|
jmespath==1.0.1
|
|
27
|
+
kombu==5.5.3
|
|
21
28
|
line-bot-sdk==3.12.0
|
|
22
29
|
multidict==6.4.3
|
|
30
|
+
prompt_toolkit==3.0.51
|
|
23
31
|
propcache==0.3.1
|
|
24
32
|
pydantic==2.11.3
|
|
25
33
|
pydantic_core==2.33.1
|
|
26
34
|
python-dateutil==2.9.0.post0
|
|
27
35
|
python-dotenv==1.1.0
|
|
28
36
|
python-multipart==0.0.20
|
|
37
|
+
redis==6.1.0
|
|
29
38
|
requests==2.32.3
|
|
30
39
|
s3transfer==0.11.5
|
|
31
40
|
six==1.17.0
|
|
@@ -33,8 +42,11 @@ sniffio==1.3.1
|
|
|
33
42
|
starlette==0.46.1
|
|
34
43
|
typing-inspection==0.4.0
|
|
35
44
|
typing_extensions==4.13.1
|
|
45
|
+
tzdata==2025.2
|
|
36
46
|
urllib3==2.3.0
|
|
37
47
|
uvicorn==0.34.0
|
|
48
|
+
vine==5.1.0
|
|
38
49
|
watchtower==3.4.0
|
|
50
|
+
wcwidth==0.2.13
|
|
39
51
|
wrapt==1.17.2
|
|
40
52
|
yarl==1.20.0
|
|
@@ -5,7 +5,7 @@ with open('requirements.txt', 'r') as f:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name='fastapi_basic', # 模組名稱
|
|
8
|
-
version='0.1.
|
|
8
|
+
version='0.1.8', # 版號版號
|
|
9
9
|
description='A short description of your module', # 模塊描述
|
|
10
10
|
long_description=open('README.md').read(), # 詳細描述,通常是 README 文件的内容
|
|
11
11
|
long_description_content_type='text/markdown', # markdown 格式
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|