FastAPI-fastkit 0.1.0__tar.gz → 0.1.1__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.
Files changed (100) hide show
  1. {fastapi_fastkit-0.1.0 → fastapi_fastkit-0.1.1}/LICENSE +21 -21
  2. fastapi_fastkit-0.1.1/PKG-INFO +173 -0
  3. fastapi_fastkit-0.1.1/README.md +154 -0
  4. {fastapi_fastkit-0.1.0 → fastapi_fastkit-0.1.1}/pyproject.toml +1 -1
  5. fastapi_fastkit-0.1.1/src/fastapi_fastkit/__init__.py +1 -0
  6. fastapi_fastkit-0.1.1/src/fastapi_fastkit/backend/inspector.py +203 -0
  7. fastapi_fastkit-0.1.1/src/fastapi_fastkit/backend/main.py +191 -0
  8. {fastapi_fastkit-0.1.0 → fastapi_fastkit-0.1.1}/src/fastapi_fastkit/cli.py +63 -51
  9. {fastapi_fastkit-0.1.0 → fastapi_fastkit-0.1.1}/src/fastapi_fastkit/core/settings.py +38 -0
  10. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/README.md +71 -0
  11. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/__init__.py-tpl +1 -1
  12. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default/test → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud/tests}/routes/test_user.py-tpl +1 -1
  13. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/.env-tpl +1 -0
  14. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/.gitignore-tpl +30 -0
  15. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/README.md-tpl +25 -0
  16. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/requirements.txt-tpl +34 -0
  17. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/scripts/format.sh-tpl +5 -0
  18. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/scripts/lint.sh-tpl +5 -0
  19. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/scripts/test.sh-tpl +6 -0
  20. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/setup.cfg-tpl +13 -0
  21. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/setup.py-tpl +22 -0
  22. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/api/api.py-tpl +9 -0
  23. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/api/routes/items.py-tpl +57 -0
  24. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/core/config.py-tpl +64 -0
  25. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/crud/items.py-tpl +18 -0
  26. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/main.py-tpl +26 -0
  27. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/mocks/mock_items.json-tpl +8 -0
  28. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/schemas/items.py-tpl +22 -0
  29. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/tests/__init__.py-tpl +0 -0
  30. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/tests/conftest.py-tpl +15 -0
  31. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/tests/test_items.py-tpl +62 -0
  32. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-dockerized/README.md-tpl +0 -0
  33. fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/README.md-tpl +0 -0
  34. fastapi_fastkit-0.1.1/src/fastapi_fastkit/py.typed +0 -0
  35. fastapi_fastkit-0.1.1/src/fastapi_fastkit/utils/__init__.py +0 -0
  36. {fastapi_fastkit-0.1.0 → fastapi_fastkit-0.1.1}/src/fastapi_fastkit/utils/logging.py +4 -1
  37. fastapi_fastkit-0.1.0/src/fastapi_fastkit/backend.py → fastapi_fastkit-0.1.1/src/fastapi_fastkit/utils/main.py +22 -51
  38. fastapi_fastkit-0.1.1/tests/__init__.py +0 -0
  39. {fastapi_fastkit-0.1.0 → fastapi_fastkit-0.1.1}/tests/conftest.py +10 -0
  40. fastapi_fastkit-0.1.1/tests/test_backends/__init__.py +0 -0
  41. {fastapi_fastkit-0.1.0 → fastapi_fastkit-0.1.1}/tests/test_backends/test_configure.py +2 -2
  42. fastapi_fastkit-0.1.1/tests/test_cli_operations/__init__.py +0 -0
  43. {fastapi_fastkit-0.1.0 → fastapi_fastkit-0.1.1}/tests/test_cli_operations/test_cli.py +80 -40
  44. fastapi_fastkit-0.1.1/tests/test_rich/__init__.py +0 -0
  45. fastapi_fastkit-0.1.1/tests/test_rich/test_rich.py +75 -0
  46. fastapi_fastkit-0.1.1/tests/test_templates/__init__.py +0 -0
  47. fastapi_fastkit-0.1.0/PKG-INFO +0 -46
  48. fastapi_fastkit-0.1.0/README.md +0 -27
  49. fastapi_fastkit-0.1.0/src/fastapi_fastkit/__init__.py +0 -10
  50. fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/README.md +0 -20
  51. fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/.DS_Store +0 -0
  52. fastapi_fastkit-0.1.0/src/fastapi_fastkit/utils/inspector.py +0 -15
  53. fastapi_fastkit-0.1.0/tests/.DS_Store +0 -0
  54. fastapi_fastkit-0.1.0/tests/test_rich/test_rich.py +0 -27
  55. {fastapi_fastkit-0.1.0 → fastapi_fastkit-0.1.1}/src/fastapi_fastkit/__main__.py +0 -0
  56. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/core → fastapi_fastkit-0.1.1/src/fastapi_fastkit/backend}/__init__.py +0 -0
  57. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/utils → fastapi_fastkit-0.1.1/src/fastapi_fastkit/backend}/transducer.py +0 -0
  58. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template → fastapi_fastkit-0.1.1/src/fastapi_fastkit/core}/__init__.py +0 -0
  59. {fastapi_fastkit-0.1.0 → fastapi_fastkit-0.1.1}/src/fastapi_fastkit/core/exceptions.py +0 -0
  60. {fastapi_fastkit-0.1.0 → fastapi_fastkit-0.1.1}/src/fastapi_fastkit/fastapi_project_template/PROJECT_README_TEMPLATE.md +0 -0
  61. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/utils → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template}/__init__.py +0 -0
  62. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/.env.test-tpl +0 -0
  63. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/.gitignore-tpl +0 -0
  64. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/README.md-tpl +0 -0
  65. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/main.py-tpl +0 -0
  66. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/requirements.txt-tpl +0 -0
  67. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/script/run-server.sh-tpl +0 -0
  68. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/script/run-test.sh-tpl +0 -0
  69. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/setup.cfg-tpl +0 -0
  70. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/setup.py-tpl +0 -0
  71. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/core/__init__.py-tpl +0 -0
  72. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/core/settings.py-tpl +0 -0
  73. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/crud/__init__.py-tpl +0 -0
  74. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/crud/_base.py-tpl +0 -0
  75. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/crud/user.py-tpl +0 -0
  76. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/helper/__init__.py-tpl +0 -0
  77. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/helper/exceptions.py-tpl +0 -0
  78. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/helper/global_data.py-tpl +0 -0
  79. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/helper/logging.py-tpl +0 -0
  80. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/helper/pagination.py-tpl +0 -0
  81. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/mocks/__init__.py-tpl +0 -0
  82. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/mocks/mock_users.json-tpl +0 -0
  83. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/router/__init__.py-tpl +0 -0
  84. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/router/user.py-tpl +0 -0
  85. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/schemas/__init__.py-tpl +0 -0
  86. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/schemas/user.py-tpl +0 -0
  87. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/templates/index.html-tpl +0 -0
  88. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/utils/__init__.py-tpl +0 -0
  89. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud}/src/utils/documents.py-tpl +0 -0
  90. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default/test → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud/tests}/__init__.py-tpl +0 -0
  91. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default/test → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud/tests}/conftest.py-tpl +0 -0
  92. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-default/test → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-async-crud/tests}/routes/__init__.py-tpl +0 -0
  93. /fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-dockerized/__init__.py-tpl → /fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-customized-response/README.md-tpl +0 -0
  94. {fastapi_fastkit-0.1.0/src/fastapi_fastkit/fastapi_project_template/fastapi-psql-orm → fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src}/__init__.py-tpl +0 -0
  95. /fastapi_fastkit-0.1.0/src/fastapi_fastkit/py.typed → /fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/api/__init__.py-tpl +0 -0
  96. /fastapi_fastkit-0.1.0/tests/__init__.py → /fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/api/routes/__init__.py-tpl +0 -0
  97. /fastapi_fastkit-0.1.0/tests/test_backends/__init__.py → /fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/core/__init__.py-tpl +0 -0
  98. /fastapi_fastkit-0.1.0/tests/test_cli_operations/__init__.py → /fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/crud/__init__.py-tpl +0 -0
  99. /fastapi_fastkit-0.1.0/tests/test_rich/__init__.py → /fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/mocks/__init__.py-tpl +0 -0
  100. /fastapi_fastkit-0.1.0/tests/test_templates/__init__.py → /fastapi_fastkit-0.1.1/src/fastapi_fastkit/fastapi_project_template/fastapi-default/src/schemas/__init__.py-tpl +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 이준혁
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 이준혁
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.1
2
+ Name: FastAPI-fastkit
3
+ Version: 0.1.1
4
+ Summary: Fast, easy-to-use starter kit for new users of Python and FastAPI
5
+ Author-Email: bnbong <bbbong9@gmail.com>
6
+ License: MIT
7
+ Requires-Python: >=3.12
8
+ Requires-Dist: click>=8.1.7
9
+ Requires-Dist: rich>=13.9.2
10
+ Requires-Dist: fastapi-cli>=0.0.5
11
+ Provides-Extra: dev
12
+ Requires-Dist: pytest>=8.3.3; extra == "dev"
13
+ Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
14
+ Requires-Dist: black>=24.10.0; extra == "dev"
15
+ Requires-Dist: pre-commit>=4.0.1; extra == "dev"
16
+ Requires-Dist: mypy>=1.12.0; extra == "dev"
17
+ Requires-Dist: isort>=5.13.2; extra == "dev"
18
+ Description-Content-Type: text/markdown
19
+
20
+ <p align="center">
21
+ <img align="top" width="70%" src="https://bnbong.github.io/projects/img/fastkit_general_logo.png" alt="FastAPI-fastkit"/>
22
+ </p>
23
+ <p align="center">
24
+ <em><b>FastAPI-fastkit</b>: Fast, easy-to-use starter kit for new users of Python and FastAPI</em>
25
+ </p>
26
+ <p align="center">
27
+ <a href="https://pypi.org/project/fastapi-fastkit" target="_blank">
28
+ <img src="https://img.shields.io/pypi/v/fastapi-fastkit" alt="PyPI - Version">
29
+ </a>
30
+ <a href="https://github.com/bnbong/FastAPI-fastkit/releases" target="_blank">
31
+ <img src="https://img.shields.io/github/v/release/bnbong/FastAPI-fastkit" alt="GitHub Release">
32
+ </a>
33
+ </p>
34
+
35
+ ---
36
+
37
+ This project was created to speed up the configuration of the development environment needed to develop Python-based web apps for new users of Python and [FastAPI](https://github.com/fastapi/fastapi).
38
+
39
+ This project was inspired by the `SpringBoot initializer` & Python Django's `django-admin` cli operation.
40
+
41
+ ## Key Features
42
+
43
+ - **Immediate FastAPI project creation** : Super-fast FastAPI workspace & project creation via CLI, inspired by `django-admin`feature of [Python Django](https://github.com/django/django)
44
+ - **Prettier CLI outputs** : beautiful CLI experiment ([rich library](https://github.com/Textualize/rich) feature)
45
+ - **Standards-based FastAPI project template** : All FastAPI-fastkit templates are based on Python standards and FastAPI's common use
46
+
47
+ ## Installation
48
+
49
+ Install `FastAPI-fastkit` at your Python environment.
50
+
51
+ ```console
52
+ $ pip install FastAPI-fastkit
53
+
54
+ ---> 100%
55
+ ```
56
+
57
+ ## Usage
58
+
59
+ ### Create a new FastAPI project workspace environment immediately
60
+
61
+ Create a new FastAPI project workspace with:
62
+
63
+ ```console
64
+ $ fastkit startproject
65
+ Enter project name: <your-project-name>
66
+
67
+ Available Stacks and Dependencies:
68
+ MINIMAL Stack
69
+ ┌──────────────┬─────────┐
70
+ │ Dependency 1 │ fastapi │
71
+ │ Dependency 2 │ uvicorn │
72
+ └──────────────┴─────────┘
73
+
74
+
75
+ STANDARD Stack
76
+ ┌──────────────┬────────────┐
77
+ │ Dependency 1 │ fastapi │
78
+ │ Dependency 2 │ uvicorn │
79
+ │ Dependency 3 │ sqlalchemy │
80
+ │ Dependency 4 │ alembic │
81
+ │ Dependency 5 │ pytest │
82
+ └──────────────┴────────────┘
83
+
84
+
85
+ FULL Stack
86
+ ┌──────────────┬────────────────┐
87
+ │ Dependency 1 │ fastapi │
88
+ │ Dependency 2 │ uvicorn │
89
+ │ Dependency 3 │ sqlalchemy │
90
+ │ Dependency 4 │ alembic │
91
+ │ Dependency 5 │ pytest │
92
+ │ Dependency 6 │ redis │
93
+ │ Dependency 7 │ celery │
94
+ │ Dependency 8 │ docker-compose │
95
+ └──────────────┴────────────────┘
96
+
97
+
98
+ Select stack (minimal, standard, full): minimal
99
+ Creating Project:
100
+ new-fastapi-project
101
+ ┌───────────┬────────┐
102
+ │ Component │ Status │
103
+ │ fastapi │ ✓ │
104
+ │ uvicorn │ ✓ │
105
+ └───────────┴────────┘
106
+ Creating virtual environment...
107
+ Installing dependencies...
108
+ ⠙ Setting up project environment...Collecting <packages~>
109
+
110
+ ---> 100%
111
+
112
+ ╭─────────────────────────────────────────────────────────────────── Success ────────────────────────────────────────────────────────────────────╮
113
+ │ ✨ Project '<your-project-name>' has been created successfully! │
114
+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
115
+ ╭───────────────────────────────────────────────────────────────────── Info ─────────────────────────────────────────────────────────────────────╮
116
+ │ ℹ To activate the virtual environment, run: │
117
+ │ │
118
+ │ source /<new-venv-path>/venv/bin/activate │
119
+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
120
+ ```
121
+
122
+ This command will create a new FastAPI project workspace environment with Python virtual environment.
123
+
124
+ ### Place a structured FastAPI project immediately
125
+
126
+ Place a structured FastAPI project immediately with:
127
+
128
+ ```console
129
+ $ fastkit startup
130
+ Enter the project name: <your-project-name>
131
+ Enter the author name: <your-name>
132
+ Enter the author email: <your-email>
133
+ Enter the project description: <your-project-description>
134
+ Deploying FastAPI project using 'fastapi-default' template
135
+ Template path:
136
+ /<fastapi_fastkit-package-path>/fastapi_project_template/fastapi-defau
137
+ lt
138
+
139
+
140
+ Project Information
141
+ ┌──────────────┬──────────────────────────────────────────┐
142
+ │ Project Name │ <your-project-name> │
143
+ │ Author │ <your-name> │
144
+ │ Author Email │ <your-email> │
145
+ │ Description │ <your-project-description> │
146
+ └──────────────┴──────────────────────────────────────────┘
147
+
148
+ Do you want to proceed with project creation? [y/N]: y
149
+ FastAPI template project will deploy at '<your-project-path>'
150
+
151
+ ---> 100%
152
+
153
+ ╭─────────────────────────────────────────────────────────────────── Success ────────────────────────────────────────────────────────────────────╮
154
+ │ ✨ FastAPI project '<your-project-name>' from 'fastapi-default' has been created and saved to │
155
+ │ <your-project-path>! │
156
+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
157
+ ```
158
+
159
+ ## Significance of FastAPI-fastkit
160
+
161
+ FastAPI-fastkit aims to provide a fast and easy-to-use starter kit for new users of Python and FastAPI.
162
+
163
+ This idea was initiated with the aim of full fill to help FastAPI newcomers to learn from the beginning, which is the production significance of the FastAPI-cli package added with the [FastAPI 0.111.0 version update](https://github.com/fastapi/fastapi/releases/tag/0.111.0).
164
+
165
+ As one person who has been using and loving FastAPI for a long time, I wanted to develop a project that could help me a little bit to practice [the wonderful motivation](https://github.com/fastapi/fastapi/pull/11522#issuecomment-2264639417) that FastAPI developer [tiangolo](https://github.com/tiangolo) has.
166
+
167
+ ## License
168
+
169
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
170
+
171
+ ---
172
+
173
+ @author bnbong bbbong9@gmail.com
@@ -0,0 +1,154 @@
1
+ <p align="center">
2
+ <img align="top" width="70%" src="https://bnbong.github.io/projects/img/fastkit_general_logo.png" alt="FastAPI-fastkit"/>
3
+ </p>
4
+ <p align="center">
5
+ <em><b>FastAPI-fastkit</b>: Fast, easy-to-use starter kit for new users of Python and FastAPI</em>
6
+ </p>
7
+ <p align="center">
8
+ <a href="https://pypi.org/project/fastapi-fastkit" target="_blank">
9
+ <img src="https://img.shields.io/pypi/v/fastapi-fastkit" alt="PyPI - Version">
10
+ </a>
11
+ <a href="https://github.com/bnbong/FastAPI-fastkit/releases" target="_blank">
12
+ <img src="https://img.shields.io/github/v/release/bnbong/FastAPI-fastkit" alt="GitHub Release">
13
+ </a>
14
+ </p>
15
+
16
+ ---
17
+
18
+ This project was created to speed up the configuration of the development environment needed to develop Python-based web apps for new users of Python and [FastAPI](https://github.com/fastapi/fastapi).
19
+
20
+ This project was inspired by the `SpringBoot initializer` & Python Django's `django-admin` cli operation.
21
+
22
+ ## Key Features
23
+
24
+ - **Immediate FastAPI project creation** : Super-fast FastAPI workspace & project creation via CLI, inspired by `django-admin`feature of [Python Django](https://github.com/django/django)
25
+ - **Prettier CLI outputs** : beautiful CLI experiment ([rich library](https://github.com/Textualize/rich) feature)
26
+ - **Standards-based FastAPI project template** : All FastAPI-fastkit templates are based on Python standards and FastAPI's common use
27
+
28
+ ## Installation
29
+
30
+ Install `FastAPI-fastkit` at your Python environment.
31
+
32
+ ```console
33
+ $ pip install FastAPI-fastkit
34
+
35
+ ---> 100%
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ### Create a new FastAPI project workspace environment immediately
41
+
42
+ Create a new FastAPI project workspace with:
43
+
44
+ ```console
45
+ $ fastkit startproject
46
+ Enter project name: <your-project-name>
47
+
48
+ Available Stacks and Dependencies:
49
+ MINIMAL Stack
50
+ ┌──────────────┬─────────┐
51
+ │ Dependency 1 │ fastapi │
52
+ │ Dependency 2 │ uvicorn │
53
+ └──────────────┴─────────┘
54
+
55
+
56
+ STANDARD Stack
57
+ ┌──────────────┬────────────┐
58
+ │ Dependency 1 │ fastapi │
59
+ │ Dependency 2 │ uvicorn │
60
+ │ Dependency 3 │ sqlalchemy │
61
+ │ Dependency 4 │ alembic │
62
+ │ Dependency 5 │ pytest │
63
+ └──────────────┴────────────┘
64
+
65
+
66
+ FULL Stack
67
+ ┌──────────────┬────────────────┐
68
+ │ Dependency 1 │ fastapi │
69
+ │ Dependency 2 │ uvicorn │
70
+ │ Dependency 3 │ sqlalchemy │
71
+ │ Dependency 4 │ alembic │
72
+ │ Dependency 5 │ pytest │
73
+ │ Dependency 6 │ redis │
74
+ │ Dependency 7 │ celery │
75
+ │ Dependency 8 │ docker-compose │
76
+ └──────────────┴────────────────┘
77
+
78
+
79
+ Select stack (minimal, standard, full): minimal
80
+ Creating Project:
81
+ new-fastapi-project
82
+ ┌───────────┬────────┐
83
+ │ Component │ Status │
84
+ │ fastapi │ ✓ │
85
+ │ uvicorn │ ✓ │
86
+ └───────────┴────────┘
87
+ Creating virtual environment...
88
+ Installing dependencies...
89
+ ⠙ Setting up project environment...Collecting <packages~>
90
+
91
+ ---> 100%
92
+
93
+ ╭─────────────────────────────────────────────────────────────────── Success ────────────────────────────────────────────────────────────────────╮
94
+ │ ✨ Project '<your-project-name>' has been created successfully! │
95
+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
96
+ ╭───────────────────────────────────────────────────────────────────── Info ─────────────────────────────────────────────────────────────────────╮
97
+ │ ℹ To activate the virtual environment, run: │
98
+ │ │
99
+ │ source /<new-venv-path>/venv/bin/activate │
100
+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
101
+ ```
102
+
103
+ This command will create a new FastAPI project workspace environment with Python virtual environment.
104
+
105
+ ### Place a structured FastAPI project immediately
106
+
107
+ Place a structured FastAPI project immediately with:
108
+
109
+ ```console
110
+ $ fastkit startup
111
+ Enter the project name: <your-project-name>
112
+ Enter the author name: <your-name>
113
+ Enter the author email: <your-email>
114
+ Enter the project description: <your-project-description>
115
+ Deploying FastAPI project using 'fastapi-default' template
116
+ Template path:
117
+ /<fastapi_fastkit-package-path>/fastapi_project_template/fastapi-defau
118
+ lt
119
+
120
+
121
+ Project Information
122
+ ┌──────────────┬──────────────────────────────────────────┐
123
+ │ Project Name │ <your-project-name> │
124
+ │ Author │ <your-name> │
125
+ │ Author Email │ <your-email> │
126
+ │ Description │ <your-project-description> │
127
+ └──────────────┴──────────────────────────────────────────┘
128
+
129
+ Do you want to proceed with project creation? [y/N]: y
130
+ FastAPI template project will deploy at '<your-project-path>'
131
+
132
+ ---> 100%
133
+
134
+ ╭─────────────────────────────────────────────────────────────────── Success ────────────────────────────────────────────────────────────────────╮
135
+ │ ✨ FastAPI project '<your-project-name>' from 'fastapi-default' has been created and saved to │
136
+ │ <your-project-path>! │
137
+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
138
+ ```
139
+
140
+ ## Significance of FastAPI-fastkit
141
+
142
+ FastAPI-fastkit aims to provide a fast and easy-to-use starter kit for new users of Python and FastAPI.
143
+
144
+ This idea was initiated with the aim of full fill to help FastAPI newcomers to learn from the beginning, which is the production significance of the FastAPI-cli package added with the [FastAPI 0.111.0 version update](https://github.com/fastapi/fastapi/releases/tag/0.111.0).
145
+
146
+ As one person who has been using and loving FastAPI for a long time, I wanted to develop a project that could help me a little bit to practice [the wonderful motivation](https://github.com/fastapi/fastapi/pull/11522#issuecomment-2264639417) that FastAPI developer [tiangolo](https://github.com/tiangolo) has.
147
+
148
+ ## License
149
+
150
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
151
+
152
+ ---
153
+
154
+ @author bnbong bbbong9@gmail.com
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "FastAPI-fastkit"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "Fast, easy-to-use starter kit for new users of Python and FastAPI"
5
5
  authors = [
6
6
  { name = "bnbong", email = "bbbong9@gmail.com" },
@@ -0,0 +1 @@
1
+ __version__ = 'v0.1.1'
@@ -0,0 +1,203 @@
1
+ # --------------------------------------------------------------------------
2
+ # The Module inspect FastAPI template is appropriate
3
+ #
4
+ # This module will be read by Github Action when contributor
5
+ # makes a PR of adding new FastAPI template.
6
+ #
7
+ # First, check a FastAPI template is formed a valid template form with .py-tpl extension
8
+ # & dependencies requirements.
9
+ # Second, check a FastAPI template has a proper FastAPI server implementation.
10
+ # main.py module must have a FastAPI app creation. like `app = FastAPI()`
11
+ # Third, check a FastAPI template has passed all the tests.
12
+ #
13
+ # This module create temporary named 'temp' directory at src/fastapi_fastkit/backend
14
+ # and copy a template to Funtional FastAPI application into the temp directory.
15
+ # After the inspection, it will be deleted.
16
+ #
17
+ # This module include virtual environment creation & installation of dependencies.
18
+ # Depending on the volume in which the template is implemented and the number of dependencies,
19
+ # it may take some time to complete the inspection.
20
+ #
21
+ # @author bnbong
22
+ # --------------------------------------------------------------------------
23
+ import os
24
+ import shutil
25
+ import subprocess
26
+ import sys
27
+ from pathlib import Path
28
+ from typing import Any, Dict, List
29
+
30
+ from fastapi_fastkit.backend.main import (
31
+ create_venv,
32
+ find_template_core_modules,
33
+ install_dependencies,
34
+ )
35
+ from fastapi_fastkit.backend.transducer import copy_and_convert_template
36
+ from fastapi_fastkit.utils.main import print_error, print_success, print_warning
37
+
38
+
39
+ class TemplateInspector:
40
+ def __init__(self, template_path: str):
41
+ self.template_path = Path(template_path)
42
+ self.errors: List[str] = []
43
+ self.warnings: List[str] = []
44
+ self.temp_dir = os.path.join(os.path.dirname(__file__), "temp")
45
+
46
+ # Create temp directory and copy template
47
+ os.makedirs(self.temp_dir, exist_ok=True)
48
+ copy_and_convert_template(str(self.template_path), self.temp_dir)
49
+
50
+ def __del__(self) -> None:
51
+ """Cleanup temp directory when inspector is destroyed."""
52
+ if os.path.exists(self.temp_dir):
53
+ shutil.rmtree(self.temp_dir)
54
+
55
+ def inspect_template(self) -> bool:
56
+ """Inspect the template is valid FastAPI application."""
57
+ checks = [
58
+ self._check_file_structure,
59
+ self._check_file_extensions,
60
+ self._check_dependencies,
61
+ self._check_fastapi_implementation,
62
+ self._test_template,
63
+ ]
64
+
65
+ for check in checks:
66
+ if not check():
67
+ return False
68
+ return True
69
+
70
+ def _check_file_structure(self) -> bool:
71
+ """Check the required file and directory structure."""
72
+ required_paths = [
73
+ "tests",
74
+ "requirements.txt-tpl",
75
+ "setup.py-tpl",
76
+ "README.md-tpl",
77
+ ]
78
+
79
+ for path in required_paths:
80
+ if not (self.template_path / path).exists():
81
+ self.errors.append(f"Missing required path: {path}")
82
+ return False
83
+ return True
84
+
85
+ def _check_file_extensions(self) -> bool:
86
+ """Check all Python files have .py-tpl extension."""
87
+ for path in self.template_path.rglob("*"):
88
+ if path.is_file() and path.suffix == ".py":
89
+ self.errors.append(f"Found .py file instead of .py-tpl: {path}")
90
+ return False
91
+ return True
92
+
93
+ def _check_dependencies(self) -> bool:
94
+ """Check the dependencies in both setup.py-tpl and requirements.txt-tpl."""
95
+ req_path = self.template_path / "requirements.txt-tpl"
96
+ setup_path = self.template_path / "setup.py-tpl"
97
+
98
+ if not req_path.exists():
99
+ self.errors.append("requirements.txt-tpl not found")
100
+ return False
101
+ if not setup_path.exists():
102
+ self.errors.append("setup.py-tpl not found")
103
+ return False
104
+
105
+ with open(req_path) as f:
106
+ deps = f.read().splitlines()
107
+ package_names = [dep.split("==")[0] for dep in deps if dep]
108
+ if "fastapi" not in package_names:
109
+ self.errors.append(
110
+ "FastAPI dependency not found in requirements.txt-tpl"
111
+ )
112
+ return False
113
+ return True
114
+
115
+ def _check_fastapi_implementation(self) -> bool:
116
+ """Check if the template has a proper FastAPI server implementation."""
117
+ core_modules = find_template_core_modules(self.temp_dir)
118
+
119
+ if not core_modules["main"]:
120
+ self.errors.append("main.py not found in template")
121
+ return False
122
+
123
+ with open(core_modules["main"]) as f:
124
+ content = f.read()
125
+ if "FastAPI" not in content or "app" not in content:
126
+ self.errors.append("FastAPI app creation not found in main.py")
127
+ return False
128
+ return True
129
+
130
+ def _test_template(self) -> bool:
131
+ """Run the tests in the converted template directory."""
132
+ test_dir = Path(self.temp_dir) / "tests"
133
+ if not test_dir.exists():
134
+ self.errors.append("Tests directory not found")
135
+ return False
136
+
137
+ try:
138
+ # Create virtual environment
139
+ venv_path = create_venv(self.temp_dir)
140
+
141
+ # Install dependencies
142
+ install_dependencies(self.temp_dir, venv_path)
143
+
144
+ # Run tests using the venv's pytest
145
+ if os.name == "nt": # Windows
146
+ pytest_path = os.path.join(venv_path, "Scripts", "pytest")
147
+ else: # Linux/Mac
148
+ pytest_path = os.path.join(venv_path, "bin", "pytest")
149
+
150
+ result = subprocess.run(
151
+ [pytest_path, str(test_dir)],
152
+ capture_output=True,
153
+ text=True,
154
+ cwd=self.temp_dir,
155
+ )
156
+
157
+ if result.returncode != 0:
158
+ self.errors.append(f"Tests failed: {result.stderr}")
159
+ return False
160
+
161
+ except Exception as e:
162
+ self.errors.append(f"Error running tests: {e}")
163
+ return False
164
+
165
+ return True
166
+
167
+
168
+ def inspect_template(template_path: str) -> Dict[str, Any]:
169
+ """Run the template inspection and return the result."""
170
+ inspector = TemplateInspector(template_path)
171
+ is_valid = inspector.inspect_template()
172
+ result: dict[str, Any] = {
173
+ "valid": is_valid,
174
+ "errors": inspector.errors,
175
+ "warnings": inspector.warnings,
176
+ }
177
+
178
+ if result["valid"]:
179
+ print_success("Template inspection passed successfully! ✨")
180
+ elif result["errors"]:
181
+ error_messages = [str(error) for error in result["errors"]]
182
+ print_error(
183
+ "Template inspection failed with following errors:\n"
184
+ + "\n".join(f"- {error}" for error in error_messages)
185
+ )
186
+
187
+ if result["warnings"]:
188
+ warning_messages = [str(warning) for warning in result["warnings"]]
189
+ print_warning(
190
+ "Template has following warnings:\n"
191
+ + "\n".join(f"- {warning}" for warning in warning_messages)
192
+ )
193
+
194
+ return result
195
+
196
+
197
+ if __name__ == "__main__":
198
+ if len(sys.argv) != 2:
199
+ print("Usage: python inspector.py <template_dir>")
200
+ sys.exit(1)
201
+
202
+ template_dir = sys.argv[1]
203
+ inspect_template(template_dir)