faster-app 0.0.4__tar.gz → 0.0.6__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 (38) hide show
  1. {faster_app-0.0.4 → faster_app-0.0.6}/PKG-INFO +4 -17
  2. {faster_app-0.0.4 → faster_app-0.0.6}/README.md +3 -16
  3. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/__init__.py +2 -2
  4. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/commands/base.py +3 -0
  5. faster_app-0.0.6/faster_app/commands/builtins/app.py +30 -0
  6. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/commands/builtins/db.py +1 -0
  7. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/routes/builtins/defaults.py +2 -2
  8. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/settings/builtins/settings.py +3 -2
  9. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/statics/swagger-ui-bundle.min.js +1 -1
  10. faster_app-0.0.6/faster_app/templates/apps/demo/commands.py +16 -0
  11. faster_app-0.0.6/faster_app/templates/apps/demo/models.py +13 -0
  12. faster_app-0.0.6/faster_app/templates/apps/demo/routes.py +13 -0
  13. faster_app-0.0.6/faster_app/templates/config/settings.py +9 -0
  14. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app.egg-info/PKG-INFO +4 -17
  15. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app.egg-info/SOURCES.txt +6 -1
  16. {faster_app-0.0.4 → faster_app-0.0.6}/pyproject.toml +1 -1
  17. {faster_app-0.0.4 → faster_app-0.0.6}/LICENSE +0 -0
  18. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/base.py +0 -0
  19. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/commands/__init__.py +0 -0
  20. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/commands/builtins/__init__.py +0 -0
  21. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/commands/builtins/fastapi.py +0 -0
  22. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/commands/discover.py +0 -0
  23. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/db.py +0 -0
  24. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/models/__init__.py +0 -0
  25. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/models/base.py +0 -0
  26. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/models/discover.py +0 -0
  27. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/routes/__init__.py +0 -0
  28. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/routes/base.py +0 -0
  29. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/routes/builtins/__init__.py +0 -0
  30. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/routes/builtins/swagger.py +0 -0
  31. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/routes/discover.py +0 -0
  32. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/settings/__init__.py +0 -0
  33. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/settings/discover.py +0 -0
  34. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app/statics/swagger-ui.min.css +0 -0
  35. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app.egg-info/dependency_links.txt +0 -0
  36. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app.egg-info/requires.txt +0 -0
  37. {faster_app-0.0.4 → faster_app-0.0.6}/faster_app.egg-info/top_level.txt +0 -0
  38. {faster_app-0.0.4 → faster_app-0.0.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: faster_app
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: 一个轻量级的 Python Web 框架,提供自动发现、模型基类、命令行工具等功能
5
5
  Author-email: peizhenfei <peizhenfei@hotmail.com>
6
6
  Maintainer-email: peizhenfei <peizhenfei@hotmail.com>
@@ -23,7 +23,7 @@ Requires-Dist: tortoise-orm>=0.25.1
23
23
  Requires-Dist: uvicorn>=0.35.0
24
24
  Dynamic: license-file
25
25
 
26
- # Faster API
26
+ # Faster APP
27
27
 
28
28
  [![Python](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://www.python.org/downloads/)
29
29
  [![FastAPI](https://img.shields.io/badge/FastAPI-0.116.1+-green.svg)](https://fastapi.tiangolo.com/)
@@ -201,7 +201,7 @@ class Settings(BaseSettings):
201
201
  DEBUG: bool = True
202
202
 
203
203
  # 服务器配置
204
- HOST: str = "127.0.0.4"
204
+ HOST: str = "127.0.0.6"
205
205
  PORT: int = 8000
206
206
 
207
207
  # API 配置
@@ -267,19 +267,6 @@ SECRET_KEY=your-secret-key-here
267
267
  - [Pydantic](https://pydantic-docs.helpmanual.io/) - 数据验证库
268
268
  - [Rich](https://rich.readthedocs.io/) - 终端美化库
269
269
 
270
- ## 📈 更新日志
271
-
272
- ### v0.0.4 (2025-09-09)
273
-
274
- - 🎉 初始版本发布
275
- - ✅ 提供基础的自动发现功能
276
- - ✅ 提供模型、命令、路由基类
277
- - ✅ 提供数据库连接管理
278
- - ✅ 内置数据库迁移工具
279
- - ✅ 内置 FastAPI 开发服务器
280
-
281
- ---
282
-
283
270
  **作者**: peizhenfei (peizhenfei@hotmail.com)
284
271
 
285
- **项目主页**: [https://github.com/mautops/faster_app.git](https://github.com/mautops/faster_app.git)
272
+ **项目主页**: [https://github.com/mautops/faster-app.git](https://github.com/mautops/faster-app.git)
@@ -1,4 +1,4 @@
1
- # Faster API
1
+ # Faster APP
2
2
 
3
3
  [![Python](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://www.python.org/downloads/)
4
4
  [![FastAPI](https://img.shields.io/badge/FastAPI-0.116.1+-green.svg)](https://fastapi.tiangolo.com/)
@@ -176,7 +176,7 @@ class Settings(BaseSettings):
176
176
  DEBUG: bool = True
177
177
 
178
178
  # 服务器配置
179
- HOST: str = "127.0.0.4"
179
+ HOST: str = "127.0.0.6"
180
180
  PORT: int = 8000
181
181
 
182
182
  # API 配置
@@ -242,19 +242,6 @@ SECRET_KEY=your-secret-key-here
242
242
  - [Pydantic](https://pydantic-docs.helpmanual.io/) - 数据验证库
243
243
  - [Rich](https://rich.readthedocs.io/) - 终端美化库
244
244
 
245
- ## 📈 更新日志
246
-
247
- ### v0.0.4 (2025-09-09)
248
-
249
- - 🎉 初始版本发布
250
- - ✅ 提供基础的自动发现功能
251
- - ✅ 提供模型、命令、路由基类
252
- - ✅ 提供数据库连接管理
253
- - ✅ 内置数据库迁移工具
254
- - ✅ 内置 FastAPI 开发服务器
255
-
256
- ---
257
-
258
245
  **作者**: peizhenfei (peizhenfei@hotmail.com)
259
246
 
260
- **项目主页**: [https://github.com/mautops/faster_app.git](https://github.com/mautops/faster_app.git)
247
+ **项目主页**: [https://github.com/mautops/faster-app.git](https://github.com/mautops/faster-app.git)
@@ -1,5 +1,5 @@
1
1
  """
2
- Faster API - 一个轻量级的 Python Web 框架
2
+ Faster APP - 一个轻量级的 Python Web 框架
3
3
 
4
4
  提供了以下核心功能:
5
5
  - 自动发现和加载模块 (DiscoverBase)
@@ -9,7 +9,7 @@ Faster API - 一个轻量级的 Python Web 框架
9
9
  - 数据库连接管理 (tortoise_init)
10
10
  """
11
11
 
12
- __version__ = "0.0.4"
12
+ __version__ = "0.0.6"
13
13
  __author__ = "peizhenfei"
14
14
  __email__ = "peizhenfei@hotmail.com"
15
15
 
@@ -2,6 +2,7 @@
2
2
  命令基类, 使用 fire 库管理子命令
3
3
  """
4
4
 
5
+ import os
5
6
  import inspect
6
7
  from functools import wraps
7
8
  from tortoise import Tortoise
@@ -30,6 +31,8 @@ def with_db_init(func):
30
31
  class CommandBase(object):
31
32
  """命令基类"""
32
33
 
34
+ BASE_PATH = os.path.dirname(os.path.dirname(__file__))
35
+
33
36
  # 默认要去掉的后缀列表
34
37
  DEFAULT_SUFFIXES = [
35
38
  "Command",
@@ -0,0 +1,30 @@
1
+ import os
2
+ import shutil
3
+ from faster_app.commands.base import CommandBase
4
+
5
+
6
+ class AppCommand(CommandBase):
7
+ """App Command"""
8
+
9
+ async def demo(self):
10
+ """Run Demo"""
11
+ # 项目根路径下创建 apps 目录,如果存在则跳过
12
+ if not os.path.exists("apps"):
13
+ os.makedirs("apps")
14
+ # 拷贝 templates/apps/demo 目录到 apps 目录
15
+ shutil.copytree(f"{self.BASE_PATH}/templates/apps/demo", "apps/demo")
16
+
17
+ async def config(self):
18
+ """Run Config"""
19
+ # 项目根路径下创建 config 目录,如果存在则跳过
20
+ if not os.path.exists("config"):
21
+ os.makedirs("config")
22
+ # 拷贝 templates/config/settings.py 到 config 目录
23
+ shutil.copytree(
24
+ f"{self.BASE_PATH}/templates/config/settings.py", "config/settings.py"
25
+ )
26
+
27
+ async def env(self):
28
+ """create .env file"""
29
+ # 拷贝项目根路径下的 .env.example 文件到项目根路径
30
+ shutil.copy(f"{self.BASE_PATH}/.env.example", ".env")
@@ -7,6 +7,7 @@ from rich.console import Console
7
7
  from faster_app.settings.builtins.settings import DefaultSettings
8
8
  from faster_app.models.discover import ModelDiscover
9
9
  from aerich import Command
10
+ from faster_app.settings import configs
10
11
 
11
12
  console = Console()
12
13
 
@@ -1,5 +1,5 @@
1
1
  from fastapi import APIRouter
2
- from settings import configs
2
+ from faster_app.settings import configs
3
3
 
4
4
  router = APIRouter()
5
5
 
@@ -7,6 +7,6 @@ router = APIRouter()
7
7
  @router.get("/")
8
8
  async def default():
9
9
  return {
10
- "message": f"Make {configs.PROJECT_NAME} Great Again",
10
+ "message": f"Make {configs.PROJECT_NAME}",
11
11
  "version": configs.VERSION,
12
12
  }
@@ -10,8 +10,8 @@ class DefaultSettings(BaseSettings):
10
10
  """应用设置"""
11
11
 
12
12
  # 基础配置
13
- PROJECT_NAME: str = "Faster API"
14
- VERSION: str = "0.0.4"
13
+ PROJECT_NAME: str = "Faster APP"
14
+ VERSION: str = "0.0.6"
15
15
  DEBUG: bool = True
16
16
 
17
17
  # Server 配置
@@ -62,3 +62,4 @@ class DefaultSettings(BaseSettings):
62
62
  class Config:
63
63
  env_file = ".env"
64
64
  exclude_from_env = {"TORTOISE_ORM"}
65
+ extra = "ignore"
@@ -31826,7 +31826,7 @@ ${u.current.stack}
31826
31826
  return !(
31827
31827
  !e ||
31828
31828
  0 <= r()(e).call(e, "localhost") ||
31829
- 0 <= r()(e).call(e, "127.0.0.4") ||
31829
+ 0 <= r()(e).call(e, "127.0.0.6") ||
31830
31830
  "none" === e
31831
31831
  );
31832
31832
  },
@@ -0,0 +1,16 @@
1
+ import time
2
+ from faster_app.commands.base import CommandBase
3
+ from rich.console import Console
4
+ from rich.progress import track
5
+
6
+ console = Console()
7
+
8
+
9
+ class DemoCommand(CommandBase):
10
+ """Demo App Commands"""
11
+
12
+ async def run(self):
13
+ console.print("[i]Hello[/i] ABC", style="bold green")
14
+ for step in track(range(50)):
15
+ time.sleep(0.1)
16
+ console.print(f"[progress.description]{step}[/progress.description]")
@@ -0,0 +1,13 @@
1
+ from tortoise import fields
2
+ from faster_app.models import UUIDModel, DateTimeModel, StatusModel
3
+
4
+
5
+ class DemoModel(UUIDModel, DateTimeModel, StatusModel):
6
+ name = fields.CharField(max_length=255)
7
+
8
+ class Meta:
9
+ table = "demo"
10
+ table_description = "Demo Model"
11
+
12
+ def __str__(self):
13
+ return self.name
@@ -0,0 +1,13 @@
1
+ from fastapi import APIRouter
2
+ from pydantic import BaseModel
3
+
4
+ router = APIRouter(prefix="/demo", tags=["demo"])
5
+
6
+
7
+ class DemoRequest(BaseModel):
8
+ name: str
9
+
10
+
11
+ @router.post("/")
12
+ async def get_demo(request: DemoRequest):
13
+ return {"message": f"Hello, {request.name}!"}
@@ -0,0 +1,9 @@
1
+ from pydantic_settings import BaseSettings
2
+
3
+
4
+ class Settings(BaseSettings):
5
+ """Settings"""
6
+
7
+ PROJECT_NAME: str = "Faster APP"
8
+ VERSION: str = "0.0.6"
9
+ DEBUG: bool = True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: faster_app
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: 一个轻量级的 Python Web 框架,提供自动发现、模型基类、命令行工具等功能
5
5
  Author-email: peizhenfei <peizhenfei@hotmail.com>
6
6
  Maintainer-email: peizhenfei <peizhenfei@hotmail.com>
@@ -23,7 +23,7 @@ Requires-Dist: tortoise-orm>=0.25.1
23
23
  Requires-Dist: uvicorn>=0.35.0
24
24
  Dynamic: license-file
25
25
 
26
- # Faster API
26
+ # Faster APP
27
27
 
28
28
  [![Python](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://www.python.org/downloads/)
29
29
  [![FastAPI](https://img.shields.io/badge/FastAPI-0.116.1+-green.svg)](https://fastapi.tiangolo.com/)
@@ -201,7 +201,7 @@ class Settings(BaseSettings):
201
201
  DEBUG: bool = True
202
202
 
203
203
  # 服务器配置
204
- HOST: str = "127.0.0.4"
204
+ HOST: str = "127.0.0.6"
205
205
  PORT: int = 8000
206
206
 
207
207
  # API 配置
@@ -267,19 +267,6 @@ SECRET_KEY=your-secret-key-here
267
267
  - [Pydantic](https://pydantic-docs.helpmanual.io/) - 数据验证库
268
268
  - [Rich](https://rich.readthedocs.io/) - 终端美化库
269
269
 
270
- ## 📈 更新日志
271
-
272
- ### v0.0.4 (2025-09-09)
273
-
274
- - 🎉 初始版本发布
275
- - ✅ 提供基础的自动发现功能
276
- - ✅ 提供模型、命令、路由基类
277
- - ✅ 提供数据库连接管理
278
- - ✅ 内置数据库迁移工具
279
- - ✅ 内置 FastAPI 开发服务器
280
-
281
- ---
282
-
283
270
  **作者**: peizhenfei (peizhenfei@hotmail.com)
284
271
 
285
- **项目主页**: [https://github.com/mautops/faster_app.git](https://github.com/mautops/faster_app.git)
272
+ **项目主页**: [https://github.com/mautops/faster-app.git](https://github.com/mautops/faster-app.git)
@@ -13,6 +13,7 @@ faster_app/commands/__init__.py
13
13
  faster_app/commands/base.py
14
14
  faster_app/commands/discover.py
15
15
  faster_app/commands/builtins/__init__.py
16
+ faster_app/commands/builtins/app.py
16
17
  faster_app/commands/builtins/db.py
17
18
  faster_app/commands/builtins/fastapi.py
18
19
  faster_app/models/__init__.py
@@ -28,4 +29,8 @@ faster_app/settings/__init__.py
28
29
  faster_app/settings/discover.py
29
30
  faster_app/settings/builtins/settings.py
30
31
  faster_app/statics/swagger-ui-bundle.min.js
31
- faster_app/statics/swagger-ui.min.css
32
+ faster_app/statics/swagger-ui.min.css
33
+ faster_app/templates/apps/demo/commands.py
34
+ faster_app/templates/apps/demo/models.py
35
+ faster_app/templates/apps/demo/routes.py
36
+ faster_app/templates/config/settings.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "faster_app"
7
- version = "0.0.4"
7
+ version = "0.0.6"
8
8
  description = "一个轻量级的 Python Web 框架,提供自动发现、模型基类、命令行工具等功能"
9
9
  readme = "README.md"
10
10
  license = "MIT"
File without changes
File without changes
File without changes