FastAPI-fastkit 1.0.1__py3-none-any.whl → 1.0.2__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_fastkit/__init__.py +10 -1
- fastapi_fastkit/backend/main.py +482 -482
- fastapi_fastkit/backend/transducer.py +106 -106
- fastapi_fastkit/cli.py +664 -631
- fastapi_fastkit/core/settings.py +155 -155
- fastapi_fastkit/fastapi_project_template/README.md +90 -90
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/.env-tpl +1 -1
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/.gitignore-tpl +30 -30
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/README.md-tpl +107 -107
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/requirements.txt-tpl +36 -36
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/scripts/format.sh-tpl +5 -5
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/scripts/lint.sh-tpl +5 -5
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/scripts/run-server.sh-tpl +8 -8
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/scripts/test.sh-tpl +6 -6
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/setup.cfg-tpl +14 -14
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/setup.py-tpl +25 -25
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/api/api.py-tpl +9 -9
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/api/routes/items.py-tpl +57 -57
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/core/config.py-tpl +64 -64
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/crud/items.py-tpl +21 -21
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/main.py-tpl +26 -26
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/mocks/mock_items.json-tpl +8 -8
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/schemas/items.py-tpl +22 -22
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/tests/conftest.py-tpl +42 -42
- fastapi_fastkit/fastapi_project_template/fastapi-async-crud/tests/test_items.py-tpl +48 -48
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/.env-tpl +1 -1
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/.gitignore-tpl +191 -191
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/README.md-tpl +156 -156
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/requirements.txt-tpl +36 -36
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/scripts/format.sh-tpl +5 -5
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/scripts/lint.sh-tpl +5 -5
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/scripts/run-server.sh-tpl +8 -8
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/scripts/test.sh-tpl +6 -6
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/setup.cfg-tpl +12 -12
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/setup.py-tpl +27 -27
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/.DS_Store +0 -0
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/api/api.py-tpl +9 -9
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/api/routes/items.py-tpl +172 -172
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/core/config.py-tpl +64 -64
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/crud/items.py-tpl +21 -21
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/helper/exceptions.py-tpl +103 -103
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/helper/pagination.py-tpl +72 -72
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/main.py-tpl +39 -39
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/mocks/mock_items.json-tpl +8 -8
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/schemas/base.py-tpl +49 -49
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/schemas/items.py-tpl +22 -22
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/utils/documents.py-tpl +20 -20
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/tests/conftest.py-tpl +42 -42
- fastapi_fastkit/fastapi_project_template/fastapi-custom-response/tests/test_items.py-tpl +61 -61
- fastapi_fastkit/fastapi_project_template/fastapi-default/README.md-tpl +101 -101
- fastapi_fastkit/fastapi_project_template/fastapi-default/scripts/run-server.sh-tpl +8 -8
- fastapi_fastkit/fastapi_project_template/fastapi-default/setup.py-tpl +22 -22
- fastapi_fastkit/fastapi_project_template/fastapi-default/src/mocks/mock_items.json-tpl +8 -8
- fastapi_fastkit/fastapi_project_template/fastapi-default/tests/conftest.py-tpl +30 -30
- fastapi_fastkit/fastapi_project_template/fastapi-default/tests/test_items.py-tpl +44 -44
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/.env-tpl +1 -1
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/.gitignore-tpl +30 -30
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/Dockerfile-tpl +23 -23
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/README.md-tpl +119 -119
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/requirements.txt-tpl +36 -36
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/scripts/format.sh-tpl +5 -5
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/scripts/lint.sh-tpl +5 -5
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/scripts/run-server.sh-tpl +8 -8
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/scripts/test.sh-tpl +6 -6
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/setup.cfg-tpl +13 -13
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/setup.py-tpl +22 -22
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/api/api.py-tpl +6 -6
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/api/routes/items.py-tpl +54 -54
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/core/config.py-tpl +64 -64
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/crud/items.py-tpl +15 -15
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/main.py-tpl +26 -26
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/mocks/mock_items.json-tpl +8 -8
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/schemas/items.py-tpl +19 -19
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/tests/conftest.py-tpl +30 -30
- fastapi_fastkit/fastapi_project_template/fastapi-dockerized/tests/test_items.py-tpl +44 -44
- fastapi_fastkit/fastapi_project_template/fastapi-empty/.env-tpl +1 -1
- fastapi_fastkit/fastapi_project_template/fastapi-empty/setup.py-tpl +22 -22
- fastapi_fastkit/fastapi_project_template/fastapi-empty/src/core/config.py-tpl +75 -75
- fastapi_fastkit/fastapi_project_template/fastapi-empty/src/main.py-tpl +36 -36
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/.env-tpl +9 -9
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/.gitignore-tpl +30 -30
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/Dockerfile-tpl +23 -23
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/README.md-tpl +144 -144
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/alembic.ini-tpl +119 -119
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/docker-compose.yml-tpl +44 -44
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/requirements.txt-tpl +41 -41
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/scripts/format.sh-tpl +5 -5
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/scripts/lint.sh-tpl +5 -5
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/scripts/pre-start.sh-tpl +16 -16
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/scripts/run-server.sh-tpl +8 -8
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/scripts/test.sh-tpl +10 -10
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/setup.cfg-tpl +13 -13
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/setup.py-tpl +25 -25
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/alembic/README-tpl +1 -1
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/alembic/env.py-tpl +85 -85
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/alembic/script.py.mako-tpl +26 -26
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/alembic/versions/bedcdc35b64a_first_alembic.py-tpl +37 -37
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/api/api.py-tpl +11 -11
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/api/deps.py-tpl +19 -19
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/api/routes/items.py-tpl +109 -109
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/core/config.py-tpl +88 -88
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/core/db.py-tpl +53 -53
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/crud/items.py-tpl +102 -102
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/main.py-tpl +45 -45
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/schemas/items.py-tpl +54 -54
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/utils/backend_pre_start.py-tpl +39 -39
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/utils/init_data.py-tpl +23 -23
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/utils/tests_pre_start.py-tpl +39 -39
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/tests/conftest.py-tpl +63 -63
- fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/tests/test_items.py-tpl +44 -44
- fastapi_fastkit/fastapi_project_template/modules/api/routes/new_route.py-tpl +64 -64
- fastapi_fastkit/fastapi_project_template/modules/crud/new_route.py-tpl +29 -29
- fastapi_fastkit/fastapi_project_template/modules/schemas/new_route.py-tpl +23 -23
- fastapi_fastkit/logs/fastkit_debug_20250702_161423.log +21 -0
- fastapi_fastkit/logs/fastkit_debug_20250702_162706.log +20 -0
- fastapi_fastkit/logs/fastkit_debug_20250702_163010.log +21 -0
- fastapi_fastkit/logs/fastkit_debug_20250702_163526.log +21 -0
- fastapi_fastkit/logs/fastkit_debug_20250702_164053.log +21 -0
- fastapi_fastkit/logs/fastkit_debug_20250702_165220.log +21 -0
- fastapi_fastkit/logs/fastkit_debug_20250702_165647.log +21 -0
- fastapi_fastkit/utils/logging.py +112 -1
- fastapi_fastkit/utils/main.py +140 -129
- {fastapi_fastkit-1.0.1.dist-info → fastapi_fastkit-1.0.2.dist-info}/METADATA +13 -2
- {fastapi_fastkit-1.0.1.dist-info → fastapi_fastkit-1.0.2.dist-info}/RECORD +127 -119
- {fastapi_fastkit-1.0.1.dist-info → fastapi_fastkit-1.0.2.dist-info}/licenses/LICENSE +21 -21
- {fastapi_fastkit-1.0.1.dist-info → fastapi_fastkit-1.0.2.dist-info}/WHEEL +0 -0
- {fastapi_fastkit-1.0.1.dist-info → fastapi_fastkit-1.0.2.dist-info}/entry_points.txt +0 -0
|
@@ -1,191 +1,191 @@
|
|
|
1
|
-
### venv template
|
|
2
|
-
# Virtualenv
|
|
3
|
-
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
|
|
4
|
-
.Python
|
|
5
|
-
[Bb]in
|
|
6
|
-
[Ii]nclude
|
|
7
|
-
[Ll]ib
|
|
8
|
-
[Ll]ib64
|
|
9
|
-
[Ll]ocal
|
|
10
|
-
[Ss]cripts
|
|
11
|
-
pyvenv.cfg
|
|
12
|
-
.venv
|
|
13
|
-
pip-selfcheck.json
|
|
14
|
-
|
|
15
|
-
### dotenv template
|
|
16
|
-
.env
|
|
17
|
-
|
|
18
|
-
### VirtualEnv template
|
|
19
|
-
# Virtualenv
|
|
20
|
-
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
|
|
21
|
-
.Python
|
|
22
|
-
[Bb]in
|
|
23
|
-
[Ii]nclude
|
|
24
|
-
[Ll]ib
|
|
25
|
-
[Ll]ib64
|
|
26
|
-
[Ll]ocal
|
|
27
|
-
pyvenv.cfg
|
|
28
|
-
.venv
|
|
29
|
-
pip-selfcheck.json
|
|
30
|
-
|
|
31
|
-
### Python template
|
|
32
|
-
# Byte-compiled / optimized / DLL files
|
|
33
|
-
__pycache__/
|
|
34
|
-
*.py[cod]
|
|
35
|
-
*$py.class
|
|
36
|
-
|
|
37
|
-
# C extensions
|
|
38
|
-
*.so
|
|
39
|
-
|
|
40
|
-
# Distribution / packaging
|
|
41
|
-
.Python
|
|
42
|
-
build/
|
|
43
|
-
develop-eggs/
|
|
44
|
-
dist/
|
|
45
|
-
downloads/
|
|
46
|
-
eggs/
|
|
47
|
-
.eggs/
|
|
48
|
-
lib/
|
|
49
|
-
lib64/
|
|
50
|
-
parts/
|
|
51
|
-
sdist/
|
|
52
|
-
var/
|
|
53
|
-
wheels/
|
|
54
|
-
share/python-wheels/
|
|
55
|
-
*.egg-info/
|
|
56
|
-
.installed.cfg
|
|
57
|
-
*.egg
|
|
58
|
-
MANIFEST
|
|
59
|
-
|
|
60
|
-
# PyInstaller
|
|
61
|
-
# Usually these files are written by a python script from a template
|
|
62
|
-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
63
|
-
*.manifest
|
|
64
|
-
*.spec
|
|
65
|
-
|
|
66
|
-
# Installer logs
|
|
67
|
-
pip-log.txt
|
|
68
|
-
pip-delete-this-directory.txt
|
|
69
|
-
|
|
70
|
-
# Unit test / coverage reports
|
|
71
|
-
htmlcov/
|
|
72
|
-
.tox/
|
|
73
|
-
.nox/
|
|
74
|
-
.coverage
|
|
75
|
-
.coverage.*
|
|
76
|
-
.cache
|
|
77
|
-
nosetests.xml
|
|
78
|
-
coverage.xml
|
|
79
|
-
*.cover
|
|
80
|
-
*.py,cover
|
|
81
|
-
.hypothesis/
|
|
82
|
-
.pytest_cache/
|
|
83
|
-
cover/
|
|
84
|
-
|
|
85
|
-
# Translations
|
|
86
|
-
*.mo
|
|
87
|
-
*.pot
|
|
88
|
-
|
|
89
|
-
# Django stuff:
|
|
90
|
-
*.log
|
|
91
|
-
local_settings.py
|
|
92
|
-
db.sqlite3
|
|
93
|
-
db.sqlite3-journal
|
|
94
|
-
|
|
95
|
-
# Flask stuff:
|
|
96
|
-
instance/
|
|
97
|
-
.webassets-cache
|
|
98
|
-
|
|
99
|
-
# Scrapy stuff:
|
|
100
|
-
.scrapy
|
|
101
|
-
|
|
102
|
-
# Sphinx documentation
|
|
103
|
-
docs/_build/
|
|
104
|
-
|
|
105
|
-
# PyBuilder
|
|
106
|
-
.pybuilder/
|
|
107
|
-
target/
|
|
108
|
-
|
|
109
|
-
# Jupyter Notebook
|
|
110
|
-
.ipynb_checkpoints
|
|
111
|
-
|
|
112
|
-
# IPython
|
|
113
|
-
profile_default/
|
|
114
|
-
ipython_config.py
|
|
115
|
-
|
|
116
|
-
# pyenv
|
|
117
|
-
# For a library or package, you might want to ignore these files since the code is
|
|
118
|
-
# intended to run in multiple environments; otherwise, check them in:
|
|
119
|
-
# .python-version
|
|
120
|
-
|
|
121
|
-
# pipenv
|
|
122
|
-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
123
|
-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
124
|
-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
125
|
-
# install all needed dependencies.
|
|
126
|
-
#Pipfile.lock
|
|
127
|
-
|
|
128
|
-
# poetry
|
|
129
|
-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
130
|
-
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
131
|
-
# commonly ignored for libraries.
|
|
132
|
-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
133
|
-
# poetry.lock
|
|
134
|
-
|
|
135
|
-
# pdm
|
|
136
|
-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
137
|
-
#pdm.lock
|
|
138
|
-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
139
|
-
# in version control.
|
|
140
|
-
# https://pdm.fming.dev/#use-with-ide
|
|
141
|
-
.pdm.toml
|
|
142
|
-
|
|
143
|
-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
144
|
-
__pypackages__/
|
|
145
|
-
|
|
146
|
-
# Celery stuff
|
|
147
|
-
celerybeat-schedule
|
|
148
|
-
celerybeat.pid
|
|
149
|
-
|
|
150
|
-
# SageMath parsed files
|
|
151
|
-
*.sage.py
|
|
152
|
-
|
|
153
|
-
# Environments
|
|
154
|
-
.env
|
|
155
|
-
.venv
|
|
156
|
-
env/
|
|
157
|
-
venv/
|
|
158
|
-
ENV/
|
|
159
|
-
env.bak/
|
|
160
|
-
venv.bak/
|
|
161
|
-
|
|
162
|
-
# Spyder project settings
|
|
163
|
-
.spyderproject
|
|
164
|
-
.spyproject
|
|
165
|
-
|
|
166
|
-
# Rope project settings
|
|
167
|
-
.ropeproject
|
|
168
|
-
|
|
169
|
-
# mkdocs documentation
|
|
170
|
-
/site
|
|
171
|
-
|
|
172
|
-
# mypy
|
|
173
|
-
.mypy_cache/
|
|
174
|
-
.dmypy.json
|
|
175
|
-
dmypy.json
|
|
176
|
-
|
|
177
|
-
# Pyre type checker
|
|
178
|
-
.pyre/
|
|
179
|
-
|
|
180
|
-
# pytype static type analyzer
|
|
181
|
-
.pytype/
|
|
182
|
-
|
|
183
|
-
# Cython debug symbols
|
|
184
|
-
cython_debug/
|
|
185
|
-
|
|
186
|
-
# PyCharm
|
|
187
|
-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
188
|
-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
189
|
-
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
190
|
-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
191
|
-
.idea/
|
|
1
|
+
### venv template
|
|
2
|
+
# Virtualenv
|
|
3
|
+
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
|
|
4
|
+
.Python
|
|
5
|
+
[Bb]in
|
|
6
|
+
[Ii]nclude
|
|
7
|
+
[Ll]ib
|
|
8
|
+
[Ll]ib64
|
|
9
|
+
[Ll]ocal
|
|
10
|
+
[Ss]cripts
|
|
11
|
+
pyvenv.cfg
|
|
12
|
+
.venv
|
|
13
|
+
pip-selfcheck.json
|
|
14
|
+
|
|
15
|
+
### dotenv template
|
|
16
|
+
.env
|
|
17
|
+
|
|
18
|
+
### VirtualEnv template
|
|
19
|
+
# Virtualenv
|
|
20
|
+
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
|
|
21
|
+
.Python
|
|
22
|
+
[Bb]in
|
|
23
|
+
[Ii]nclude
|
|
24
|
+
[Ll]ib
|
|
25
|
+
[Ll]ib64
|
|
26
|
+
[Ll]ocal
|
|
27
|
+
pyvenv.cfg
|
|
28
|
+
.venv
|
|
29
|
+
pip-selfcheck.json
|
|
30
|
+
|
|
31
|
+
### Python template
|
|
32
|
+
# Byte-compiled / optimized / DLL files
|
|
33
|
+
__pycache__/
|
|
34
|
+
*.py[cod]
|
|
35
|
+
*$py.class
|
|
36
|
+
|
|
37
|
+
# C extensions
|
|
38
|
+
*.so
|
|
39
|
+
|
|
40
|
+
# Distribution / packaging
|
|
41
|
+
.Python
|
|
42
|
+
build/
|
|
43
|
+
develop-eggs/
|
|
44
|
+
dist/
|
|
45
|
+
downloads/
|
|
46
|
+
eggs/
|
|
47
|
+
.eggs/
|
|
48
|
+
lib/
|
|
49
|
+
lib64/
|
|
50
|
+
parts/
|
|
51
|
+
sdist/
|
|
52
|
+
var/
|
|
53
|
+
wheels/
|
|
54
|
+
share/python-wheels/
|
|
55
|
+
*.egg-info/
|
|
56
|
+
.installed.cfg
|
|
57
|
+
*.egg
|
|
58
|
+
MANIFEST
|
|
59
|
+
|
|
60
|
+
# PyInstaller
|
|
61
|
+
# Usually these files are written by a python script from a template
|
|
62
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
63
|
+
*.manifest
|
|
64
|
+
*.spec
|
|
65
|
+
|
|
66
|
+
# Installer logs
|
|
67
|
+
pip-log.txt
|
|
68
|
+
pip-delete-this-directory.txt
|
|
69
|
+
|
|
70
|
+
# Unit test / coverage reports
|
|
71
|
+
htmlcov/
|
|
72
|
+
.tox/
|
|
73
|
+
.nox/
|
|
74
|
+
.coverage
|
|
75
|
+
.coverage.*
|
|
76
|
+
.cache
|
|
77
|
+
nosetests.xml
|
|
78
|
+
coverage.xml
|
|
79
|
+
*.cover
|
|
80
|
+
*.py,cover
|
|
81
|
+
.hypothesis/
|
|
82
|
+
.pytest_cache/
|
|
83
|
+
cover/
|
|
84
|
+
|
|
85
|
+
# Translations
|
|
86
|
+
*.mo
|
|
87
|
+
*.pot
|
|
88
|
+
|
|
89
|
+
# Django stuff:
|
|
90
|
+
*.log
|
|
91
|
+
local_settings.py
|
|
92
|
+
db.sqlite3
|
|
93
|
+
db.sqlite3-journal
|
|
94
|
+
|
|
95
|
+
# Flask stuff:
|
|
96
|
+
instance/
|
|
97
|
+
.webassets-cache
|
|
98
|
+
|
|
99
|
+
# Scrapy stuff:
|
|
100
|
+
.scrapy
|
|
101
|
+
|
|
102
|
+
# Sphinx documentation
|
|
103
|
+
docs/_build/
|
|
104
|
+
|
|
105
|
+
# PyBuilder
|
|
106
|
+
.pybuilder/
|
|
107
|
+
target/
|
|
108
|
+
|
|
109
|
+
# Jupyter Notebook
|
|
110
|
+
.ipynb_checkpoints
|
|
111
|
+
|
|
112
|
+
# IPython
|
|
113
|
+
profile_default/
|
|
114
|
+
ipython_config.py
|
|
115
|
+
|
|
116
|
+
# pyenv
|
|
117
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
118
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
119
|
+
# .python-version
|
|
120
|
+
|
|
121
|
+
# pipenv
|
|
122
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
123
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
124
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
125
|
+
# install all needed dependencies.
|
|
126
|
+
#Pipfile.lock
|
|
127
|
+
|
|
128
|
+
# poetry
|
|
129
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
130
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
131
|
+
# commonly ignored for libraries.
|
|
132
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
133
|
+
# poetry.lock
|
|
134
|
+
|
|
135
|
+
# pdm
|
|
136
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
137
|
+
#pdm.lock
|
|
138
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
139
|
+
# in version control.
|
|
140
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
141
|
+
.pdm.toml
|
|
142
|
+
|
|
143
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
144
|
+
__pypackages__/
|
|
145
|
+
|
|
146
|
+
# Celery stuff
|
|
147
|
+
celerybeat-schedule
|
|
148
|
+
celerybeat.pid
|
|
149
|
+
|
|
150
|
+
# SageMath parsed files
|
|
151
|
+
*.sage.py
|
|
152
|
+
|
|
153
|
+
# Environments
|
|
154
|
+
.env
|
|
155
|
+
.venv
|
|
156
|
+
env/
|
|
157
|
+
venv/
|
|
158
|
+
ENV/
|
|
159
|
+
env.bak/
|
|
160
|
+
venv.bak/
|
|
161
|
+
|
|
162
|
+
# Spyder project settings
|
|
163
|
+
.spyderproject
|
|
164
|
+
.spyproject
|
|
165
|
+
|
|
166
|
+
# Rope project settings
|
|
167
|
+
.ropeproject
|
|
168
|
+
|
|
169
|
+
# mkdocs documentation
|
|
170
|
+
/site
|
|
171
|
+
|
|
172
|
+
# mypy
|
|
173
|
+
.mypy_cache/
|
|
174
|
+
.dmypy.json
|
|
175
|
+
dmypy.json
|
|
176
|
+
|
|
177
|
+
# Pyre type checker
|
|
178
|
+
.pyre/
|
|
179
|
+
|
|
180
|
+
# pytype static type analyzer
|
|
181
|
+
.pytype/
|
|
182
|
+
|
|
183
|
+
# Cython debug symbols
|
|
184
|
+
cython_debug/
|
|
185
|
+
|
|
186
|
+
# PyCharm
|
|
187
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
188
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
189
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
190
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
191
|
+
.idea/
|
|
@@ -1,156 +1,156 @@
|
|
|
1
|
-
# Async Item Management API with Custom Response System
|
|
2
|
-
|
|
3
|
-
A FastAPI-based REST API demonstrating asynchronous processing and standardized response handling.
|
|
4
|
-
|
|
5
|
-
## Tech Stack
|
|
6
|
-
|
|
7
|
-
- Python 3.12+
|
|
8
|
-
- FastAPI + uvicorn
|
|
9
|
-
- Pydantic 2 & pydantic-settings
|
|
10
|
-
- pytest, pytest-asyncio
|
|
11
|
-
- mypy + black + isort
|
|
12
|
-
- aiofiles (async file handling)
|
|
13
|
-
|
|
14
|
-
## Project Structure
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
.
|
|
18
|
-
├── src/
|
|
19
|
-
│ ├── core
|
|
20
|
-
│ │ └── config.py
|
|
21
|
-
│ └── api
|
|
22
|
-
│ │ ├── api.py
|
|
23
|
-
│ │ └── routes
|
|
24
|
-
│ │ └── items.py
|
|
25
|
-
│ ├── schemas
|
|
26
|
-
│ │ ├── base.py # Base response schema
|
|
27
|
-
│ │ └── items.py
|
|
28
|
-
│ ├── helper
|
|
29
|
-
│ │ ├── exceptions.py # Exception handlers
|
|
30
|
-
│ │ └── pagination.py # Paginator
|
|
31
|
-
│ ├── crud
|
|
32
|
-
│ │ └── items.py
|
|
33
|
-
│ ├── mocks
|
|
34
|
-
│ │ └── mock_items.json
|
|
35
|
-
│ └── utils
|
|
36
|
-
│ └── documents.py # custom OpenAPI docs generator
|
|
37
|
-
└── tests
|
|
38
|
-
├── __init__.py
|
|
39
|
-
├── test_items.py
|
|
40
|
-
└── conftest.py
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## How to Run
|
|
44
|
-
|
|
45
|
-
Run in virtual environment:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
# Install dependencies
|
|
49
|
-
$ pip install -r requirements.txt
|
|
50
|
-
|
|
51
|
-
# Start development server (using script)
|
|
52
|
-
$ bash scripts/run-server.sh
|
|
53
|
-
|
|
54
|
-
# Manual run
|
|
55
|
-
$ uvicorn src.main:app --reload
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Access API documentation after server starts:
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
<domain:port>/docs # Swagger format
|
|
62
|
-
<domain:port>/redoc # ReDoc format
|
|
63
|
-
|
|
64
|
-
# example
|
|
65
|
-
http://127.0.0.1:8000/docs
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## API Endpoints
|
|
69
|
-
|
|
70
|
-
| Method | Endpoint | Description |
|
|
71
|
-
|--------|------------------|----------------------------|
|
|
72
|
-
| GET | `/items/` | List all items |
|
|
73
|
-
| GET | `/items/{id}` | Get single item |
|
|
74
|
-
| POST | `/items/` | Create new item |
|
|
75
|
-
| PUT | `/items/{id}` | Update existing item |
|
|
76
|
-
| DELETE | `/items/{id}` | Delete item |
|
|
77
|
-
|
|
78
|
-
## Key Features
|
|
79
|
-
|
|
80
|
-
### 1. Custom Response System
|
|
81
|
-
- **Standardized Response Format** (`schemas/base.py`):
|
|
82
|
-
```python
|
|
83
|
-
class ResponseSchema(BaseModel, Generic[T]):
|
|
84
|
-
timestamp: str # ISO 8601 format
|
|
85
|
-
status: int # HTTP status code
|
|
86
|
-
code: str # Custom error code
|
|
87
|
-
path: str # Request endpoint
|
|
88
|
-
message: T # Response payload/error
|
|
89
|
-
```
|
|
90
|
-
- **Exception Handling** (`helper/exceptions.py`):
|
|
91
|
-
- `InternalException` class with error code mapping
|
|
92
|
-
- Automatic error response formatting
|
|
93
|
-
- Custom error codes with HTTP status mapping
|
|
94
|
-
|
|
95
|
-
#### Response Examples
|
|
96
|
-
|
|
97
|
-
##### Success Response
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"timestamp": "2024-02-15T09:30:00.000Z",
|
|
102
|
-
"status": 200,
|
|
103
|
-
"code": "HTTP-200",
|
|
104
|
-
"path": "/items/1",
|
|
105
|
-
"message": {
|
|
106
|
-
"id": 1,
|
|
107
|
-
"name": "Test Item 1",
|
|
108
|
-
"price": 20.0,
|
|
109
|
-
"category": "test"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
##### Error Response
|
|
115
|
-
|
|
116
|
-
```json
|
|
117
|
-
{
|
|
118
|
-
"timestamp": "2024-02-15T09:30:00.000Z",
|
|
119
|
-
"status": 404,
|
|
120
|
-
"code": "DATA-002",
|
|
121
|
-
"path": "/items/999",
|
|
122
|
-
"message": "ERROR: Item not found"
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### 2. Async Operations
|
|
127
|
-
- Asynchronous CRUD operations with aiofiles
|
|
128
|
-
- Non-blocking I/O for JSON data management
|
|
129
|
-
- Async test client with pytest-asyncio
|
|
130
|
-
|
|
131
|
-
### 3. Enhanced Documentation
|
|
132
|
-
- Custom OpenAPI tags and descriptions (`utils/documents.py`)
|
|
133
|
-
- Automatic API documentation generation
|
|
134
|
-
- Response schema examples in Swagger/ReDoc
|
|
135
|
-
|
|
136
|
-
## Running Tests
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
# Run all tests
|
|
140
|
-
$ pytest tests/
|
|
141
|
-
|
|
142
|
-
# Run specific test file
|
|
143
|
-
$ pytest tests/test_items.py -v
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
For FastAPI documentation: <https://fastapi.tiangolo.com/>
|
|
147
|
-
|
|
148
|
-
## Project Origin
|
|
149
|
-
|
|
150
|
-
This project was created using the [FastAPI-fastkit](https://github.com/bnbong/FastAPI-fastkit) template.
|
|
151
|
-
|
|
152
|
-
FastAPI-fastkit is an open-source project that helps developers quickly set up FastAPI-based applications with proper structure and tooling.
|
|
153
|
-
|
|
154
|
-
### Template Information
|
|
155
|
-
- Template author: [bnbong](mailto:bbbong9@gmail.com)
|
|
156
|
-
- Project maintainer: [bnbong](mailto:bbbong9@gmail.com)
|
|
1
|
+
# Async Item Management API with Custom Response System
|
|
2
|
+
|
|
3
|
+
A FastAPI-based REST API demonstrating asynchronous processing and standardized response handling.
|
|
4
|
+
|
|
5
|
+
## Tech Stack
|
|
6
|
+
|
|
7
|
+
- Python 3.12+
|
|
8
|
+
- FastAPI + uvicorn
|
|
9
|
+
- Pydantic 2 & pydantic-settings
|
|
10
|
+
- pytest, pytest-asyncio
|
|
11
|
+
- mypy + black + isort
|
|
12
|
+
- aiofiles (async file handling)
|
|
13
|
+
|
|
14
|
+
## Project Structure
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
.
|
|
18
|
+
├── src/
|
|
19
|
+
│ ├── core
|
|
20
|
+
│ │ └── config.py
|
|
21
|
+
│ └── api
|
|
22
|
+
│ │ ├── api.py
|
|
23
|
+
│ │ └── routes
|
|
24
|
+
│ │ └── items.py
|
|
25
|
+
│ ├── schemas
|
|
26
|
+
│ │ ├── base.py # Base response schema
|
|
27
|
+
│ │ └── items.py
|
|
28
|
+
│ ├── helper
|
|
29
|
+
│ │ ├── exceptions.py # Exception handlers
|
|
30
|
+
│ │ └── pagination.py # Paginator
|
|
31
|
+
│ ├── crud
|
|
32
|
+
│ │ └── items.py
|
|
33
|
+
│ ├── mocks
|
|
34
|
+
│ │ └── mock_items.json
|
|
35
|
+
│ └── utils
|
|
36
|
+
│ └── documents.py # custom OpenAPI docs generator
|
|
37
|
+
└── tests
|
|
38
|
+
├── __init__.py
|
|
39
|
+
├── test_items.py
|
|
40
|
+
└── conftest.py
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## How to Run
|
|
44
|
+
|
|
45
|
+
Run in virtual environment:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Install dependencies
|
|
49
|
+
$ pip install -r requirements.txt
|
|
50
|
+
|
|
51
|
+
# Start development server (using script)
|
|
52
|
+
$ bash scripts/run-server.sh
|
|
53
|
+
|
|
54
|
+
# Manual run
|
|
55
|
+
$ uvicorn src.main:app --reload
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Access API documentation after server starts:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
<domain:port>/docs # Swagger format
|
|
62
|
+
<domain:port>/redoc # ReDoc format
|
|
63
|
+
|
|
64
|
+
# example
|
|
65
|
+
http://127.0.0.1:8000/docs
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## API Endpoints
|
|
69
|
+
|
|
70
|
+
| Method | Endpoint | Description |
|
|
71
|
+
|--------|------------------|----------------------------|
|
|
72
|
+
| GET | `/items/` | List all items |
|
|
73
|
+
| GET | `/items/{id}` | Get single item |
|
|
74
|
+
| POST | `/items/` | Create new item |
|
|
75
|
+
| PUT | `/items/{id}` | Update existing item |
|
|
76
|
+
| DELETE | `/items/{id}` | Delete item |
|
|
77
|
+
|
|
78
|
+
## Key Features
|
|
79
|
+
|
|
80
|
+
### 1. Custom Response System
|
|
81
|
+
- **Standardized Response Format** (`schemas/base.py`):
|
|
82
|
+
```python
|
|
83
|
+
class ResponseSchema(BaseModel, Generic[T]):
|
|
84
|
+
timestamp: str # ISO 8601 format
|
|
85
|
+
status: int # HTTP status code
|
|
86
|
+
code: str # Custom error code
|
|
87
|
+
path: str # Request endpoint
|
|
88
|
+
message: T # Response payload/error
|
|
89
|
+
```
|
|
90
|
+
- **Exception Handling** (`helper/exceptions.py`):
|
|
91
|
+
- `InternalException` class with error code mapping
|
|
92
|
+
- Automatic error response formatting
|
|
93
|
+
- Custom error codes with HTTP status mapping
|
|
94
|
+
|
|
95
|
+
#### Response Examples
|
|
96
|
+
|
|
97
|
+
##### Success Response
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"timestamp": "2024-02-15T09:30:00.000Z",
|
|
102
|
+
"status": 200,
|
|
103
|
+
"code": "HTTP-200",
|
|
104
|
+
"path": "/items/1",
|
|
105
|
+
"message": {
|
|
106
|
+
"id": 1,
|
|
107
|
+
"name": "Test Item 1",
|
|
108
|
+
"price": 20.0,
|
|
109
|
+
"category": "test"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
##### Error Response
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"timestamp": "2024-02-15T09:30:00.000Z",
|
|
119
|
+
"status": 404,
|
|
120
|
+
"code": "DATA-002",
|
|
121
|
+
"path": "/items/999",
|
|
122
|
+
"message": "ERROR: Item not found"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 2. Async Operations
|
|
127
|
+
- Asynchronous CRUD operations with aiofiles
|
|
128
|
+
- Non-blocking I/O for JSON data management
|
|
129
|
+
- Async test client with pytest-asyncio
|
|
130
|
+
|
|
131
|
+
### 3. Enhanced Documentation
|
|
132
|
+
- Custom OpenAPI tags and descriptions (`utils/documents.py`)
|
|
133
|
+
- Automatic API documentation generation
|
|
134
|
+
- Response schema examples in Swagger/ReDoc
|
|
135
|
+
|
|
136
|
+
## Running Tests
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Run all tests
|
|
140
|
+
$ pytest tests/
|
|
141
|
+
|
|
142
|
+
# Run specific test file
|
|
143
|
+
$ pytest tests/test_items.py -v
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
For FastAPI documentation: <https://fastapi.tiangolo.com/>
|
|
147
|
+
|
|
148
|
+
## Project Origin
|
|
149
|
+
|
|
150
|
+
This project was created using the [FastAPI-fastkit](https://github.com/bnbong/FastAPI-fastkit) template.
|
|
151
|
+
|
|
152
|
+
FastAPI-fastkit is an open-source project that helps developers quickly set up FastAPI-based applications with proper structure and tooling.
|
|
153
|
+
|
|
154
|
+
### Template Information
|
|
155
|
+
- Template author: [bnbong](mailto:bbbong9@gmail.com)
|
|
156
|
+
- Project maintainer: [bnbong](mailto:bbbong9@gmail.com)
|