fastapi-basic 0.1.6__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.

Files changed (23) hide show
  1. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/PKG-INFO +25 -1
  2. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/base_config.py +6 -1
  3. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/base_factory.py +15 -1
  4. fastapi_basic-0.1.8/fastapi_basic/const.py +4 -0
  5. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic.egg-info/PKG-INFO +25 -1
  6. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic.egg-info/requires.txt +24 -0
  7. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/setup.py +1 -1
  8. fastapi_basic-0.1.6/fastapi_basic/const.py +0 -2
  9. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/README.md +0 -0
  10. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/__init__.py +0 -0
  11. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/database/__init__.py +0 -0
  12. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/database/mongodb.py +0 -0
  13. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/exception/__init__.py +0 -0
  14. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/exception/base_exception.py +0 -0
  15. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/ext/__init__.py +0 -0
  16. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/ext/aws/__init__.py +0 -0
  17. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/ext/aws/const.py +0 -0
  18. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/ext/line/__init__.py +0 -0
  19. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic/utils.py +0 -0
  20. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic.egg-info/SOURCES.txt +0 -0
  21. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic.egg-info/dependency_links.txt +0 -0
  22. {fastapi_basic-0.1.6 → fastapi_basic-0.1.8}/fastapi_basic.egg-info/top_level.txt +0 -0
  23. {fastapi_basic-0.1.6 → 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.6
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
@@ -10,24 +10,43 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.6
12
12
  Description-Content-Type: text/markdown
13
+ Requires-Dist: aenum==3.1.16
14
+ Requires-Dist: aiohappyeyeballs==2.6.1
15
+ Requires-Dist: aiohttp==3.10.5
16
+ Requires-Dist: aiosignal==1.3.2
17
+ Requires-Dist: amqp==5.3.1
13
18
  Requires-Dist: annotated-types==0.7.0
14
19
  Requires-Dist: anyio==4.9.0
20
+ Requires-Dist: attrs==25.3.0
21
+ Requires-Dist: billiard==4.2.1
15
22
  Requires-Dist: boto3==1.37.36
16
23
  Requires-Dist: botocore==1.37.36
24
+ Requires-Dist: celery==5.5.2
17
25
  Requires-Dist: certifi==2025.1.31
18
26
  Requires-Dist: charset-normalizer==3.4.1
19
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
31
+ Requires-Dist: Deprecated==1.2.18
20
32
  Requires-Dist: dotenv==0.9.9
21
33
  Requires-Dist: fastapi==0.115.12
34
+ Requires-Dist: frozenlist==1.6.0
35
+ Requires-Dist: future==1.0.0
22
36
  Requires-Dist: h11==0.14.0
23
37
  Requires-Dist: idna==3.10
24
38
  Requires-Dist: jmespath==1.0.1
39
+ Requires-Dist: kombu==5.5.3
25
40
  Requires-Dist: line-bot-sdk==3.12.0
41
+ Requires-Dist: multidict==6.4.3
42
+ Requires-Dist: prompt_toolkit==3.0.51
43
+ Requires-Dist: propcache==0.3.1
26
44
  Requires-Dist: pydantic==2.11.3
27
45
  Requires-Dist: pydantic_core==2.33.1
28
46
  Requires-Dist: python-dateutil==2.9.0.post0
29
47
  Requires-Dist: python-dotenv==1.1.0
30
48
  Requires-Dist: python-multipart==0.0.20
49
+ Requires-Dist: redis==6.1.0
31
50
  Requires-Dist: requests==2.32.3
32
51
  Requires-Dist: s3transfer==0.11.5
33
52
  Requires-Dist: six==1.17.0
@@ -35,9 +54,14 @@ Requires-Dist: sniffio==1.3.1
35
54
  Requires-Dist: starlette==0.46.1
36
55
  Requires-Dist: typing-inspection==0.4.0
37
56
  Requires-Dist: typing_extensions==4.13.1
57
+ Requires-Dist: tzdata==2025.2
38
58
  Requires-Dist: urllib3==2.3.0
39
59
  Requires-Dist: uvicorn==0.34.0
60
+ Requires-Dist: vine==5.1.0
40
61
  Requires-Dist: watchtower==3.4.0
62
+ Requires-Dist: wcwidth==0.2.13
63
+ Requires-Dist: wrapt==1.17.2
64
+ Requires-Dist: yarl==1.20.0
41
65
  Dynamic: author
42
66
  Dynamic: author-email
43
67
  Dynamic: classifier
@@ -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(
@@ -0,0 +1,4 @@
1
+ LOG_DEFAULT_LOGGER_NAME = "uvicorn"
2
+ LOG_FMT = '%(asctime)s %(filename)s %(levelname)s: %(message)s'
3
+
4
+ CELERY_CONFIG = ["CELERY_APP", "CELERY_BROKER_URL", "CELERY_BACKEND_URL"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi_basic
3
- Version: 0.1.6
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
@@ -10,24 +10,43 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.6
12
12
  Description-Content-Type: text/markdown
13
+ Requires-Dist: aenum==3.1.16
14
+ Requires-Dist: aiohappyeyeballs==2.6.1
15
+ Requires-Dist: aiohttp==3.10.5
16
+ Requires-Dist: aiosignal==1.3.2
17
+ Requires-Dist: amqp==5.3.1
13
18
  Requires-Dist: annotated-types==0.7.0
14
19
  Requires-Dist: anyio==4.9.0
20
+ Requires-Dist: attrs==25.3.0
21
+ Requires-Dist: billiard==4.2.1
15
22
  Requires-Dist: boto3==1.37.36
16
23
  Requires-Dist: botocore==1.37.36
24
+ Requires-Dist: celery==5.5.2
17
25
  Requires-Dist: certifi==2025.1.31
18
26
  Requires-Dist: charset-normalizer==3.4.1
19
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
31
+ Requires-Dist: Deprecated==1.2.18
20
32
  Requires-Dist: dotenv==0.9.9
21
33
  Requires-Dist: fastapi==0.115.12
34
+ Requires-Dist: frozenlist==1.6.0
35
+ Requires-Dist: future==1.0.0
22
36
  Requires-Dist: h11==0.14.0
23
37
  Requires-Dist: idna==3.10
24
38
  Requires-Dist: jmespath==1.0.1
39
+ Requires-Dist: kombu==5.5.3
25
40
  Requires-Dist: line-bot-sdk==3.12.0
41
+ Requires-Dist: multidict==6.4.3
42
+ Requires-Dist: prompt_toolkit==3.0.51
43
+ Requires-Dist: propcache==0.3.1
26
44
  Requires-Dist: pydantic==2.11.3
27
45
  Requires-Dist: pydantic_core==2.33.1
28
46
  Requires-Dist: python-dateutil==2.9.0.post0
29
47
  Requires-Dist: python-dotenv==1.1.0
30
48
  Requires-Dist: python-multipart==0.0.20
49
+ Requires-Dist: redis==6.1.0
31
50
  Requires-Dist: requests==2.32.3
32
51
  Requires-Dist: s3transfer==0.11.5
33
52
  Requires-Dist: six==1.17.0
@@ -35,9 +54,14 @@ Requires-Dist: sniffio==1.3.1
35
54
  Requires-Dist: starlette==0.46.1
36
55
  Requires-Dist: typing-inspection==0.4.0
37
56
  Requires-Dist: typing_extensions==4.13.1
57
+ Requires-Dist: tzdata==2025.2
38
58
  Requires-Dist: urllib3==2.3.0
39
59
  Requires-Dist: uvicorn==0.34.0
60
+ Requires-Dist: vine==5.1.0
40
61
  Requires-Dist: watchtower==3.4.0
62
+ Requires-Dist: wcwidth==0.2.13
63
+ Requires-Dist: wrapt==1.17.2
64
+ Requires-Dist: yarl==1.20.0
41
65
  Dynamic: author
42
66
  Dynamic: author-email
43
67
  Dynamic: classifier
@@ -1,21 +1,40 @@
1
+ aenum==3.1.16
2
+ aiohappyeyeballs==2.6.1
3
+ aiohttp==3.10.5
4
+ aiosignal==1.3.2
5
+ amqp==5.3.1
1
6
  annotated-types==0.7.0
2
7
  anyio==4.9.0
8
+ attrs==25.3.0
9
+ billiard==4.2.1
3
10
  boto3==1.37.36
4
11
  botocore==1.37.36
12
+ celery==5.5.2
5
13
  certifi==2025.1.31
6
14
  charset-normalizer==3.4.1
7
15
  click==8.1.8
16
+ click-didyoumean==0.3.1
17
+ click-plugins==1.1.1
18
+ click-repl==0.3.0
19
+ Deprecated==1.2.18
8
20
  dotenv==0.9.9
9
21
  fastapi==0.115.12
22
+ frozenlist==1.6.0
23
+ future==1.0.0
10
24
  h11==0.14.0
11
25
  idna==3.10
12
26
  jmespath==1.0.1
27
+ kombu==5.5.3
13
28
  line-bot-sdk==3.12.0
29
+ multidict==6.4.3
30
+ prompt_toolkit==3.0.51
31
+ propcache==0.3.1
14
32
  pydantic==2.11.3
15
33
  pydantic_core==2.33.1
16
34
  python-dateutil==2.9.0.post0
17
35
  python-dotenv==1.1.0
18
36
  python-multipart==0.0.20
37
+ redis==6.1.0
19
38
  requests==2.32.3
20
39
  s3transfer==0.11.5
21
40
  six==1.17.0
@@ -23,6 +42,11 @@ sniffio==1.3.1
23
42
  starlette==0.46.1
24
43
  typing-inspection==0.4.0
25
44
  typing_extensions==4.13.1
45
+ tzdata==2025.2
26
46
  urllib3==2.3.0
27
47
  uvicorn==0.34.0
48
+ vine==5.1.0
28
49
  watchtower==3.4.0
50
+ wcwidth==0.2.13
51
+ wrapt==1.17.2
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.6', # 版號版號
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 格式
@@ -1,2 +0,0 @@
1
- LOG_DEFAULT_LOGGER_NAME = "uvicorn"
2
- LOG_FMT = '%(asctime)s %(filename)s %(levelname)s: %(message)s'
File without changes
File without changes