aury-boot 0.0.19__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 (198) hide show
  1. aury_boot-0.0.19/.gitignore +47 -0
  2. aury_boot-0.0.19/PKG-INFO +284 -0
  3. aury_boot-0.0.19/README.md +211 -0
  4. aury_boot-0.0.19/aury/boot/__init__.py +66 -0
  5. aury_boot-0.0.19/aury/boot/_version.py +34 -0
  6. aury_boot-0.0.19/aury/boot/application/__init__.py +144 -0
  7. aury_boot-0.0.19/aury/boot/application/adapter/__init__.py +112 -0
  8. aury_boot-0.0.19/aury/boot/application/adapter/base.py +511 -0
  9. aury_boot-0.0.19/aury/boot/application/adapter/config.py +242 -0
  10. aury_boot-0.0.19/aury/boot/application/adapter/decorators.py +259 -0
  11. aury_boot-0.0.19/aury/boot/application/adapter/exceptions.py +202 -0
  12. aury_boot-0.0.19/aury/boot/application/adapter/http.py +325 -0
  13. aury_boot-0.0.19/aury/boot/application/app/__init__.py +43 -0
  14. aury_boot-0.0.19/aury/boot/application/app/base.py +533 -0
  15. aury_boot-0.0.19/aury/boot/application/app/components.py +574 -0
  16. aury_boot-0.0.19/aury/boot/application/app/middlewares.py +106 -0
  17. aury_boot-0.0.19/aury/boot/application/app/startup.py +249 -0
  18. aury_boot-0.0.19/aury/boot/application/config/__init__.py +79 -0
  19. aury_boot-0.0.19/aury/boot/application/config/multi_instance.py +216 -0
  20. aury_boot-0.0.19/aury/boot/application/config/settings.py +951 -0
  21. aury_boot-0.0.19/aury/boot/application/constants/__init__.py +19 -0
  22. aury_boot-0.0.19/aury/boot/application/constants/components.py +56 -0
  23. aury_boot-0.0.19/aury/boot/application/constants/scheduler.py +28 -0
  24. aury_boot-0.0.19/aury/boot/application/constants/service.py +29 -0
  25. aury_boot-0.0.19/aury/boot/application/errors/__init__.py +55 -0
  26. aury_boot-0.0.19/aury/boot/application/errors/chain.py +80 -0
  27. aury_boot-0.0.19/aury/boot/application/errors/codes.py +67 -0
  28. aury_boot-0.0.19/aury/boot/application/errors/exceptions.py +238 -0
  29. aury_boot-0.0.19/aury/boot/application/errors/handlers.py +334 -0
  30. aury_boot-0.0.19/aury/boot/application/errors/response.py +120 -0
  31. aury_boot-0.0.19/aury/boot/application/interfaces/__init__.py +76 -0
  32. aury_boot-0.0.19/aury/boot/application/interfaces/egress.py +224 -0
  33. aury_boot-0.0.19/aury/boot/application/interfaces/ingress.py +98 -0
  34. aury_boot-0.0.19/aury/boot/application/middleware/__init__.py +22 -0
  35. aury_boot-0.0.19/aury/boot/application/middleware/logging.py +340 -0
  36. aury_boot-0.0.19/aury/boot/application/migrations/__init__.py +13 -0
  37. aury_boot-0.0.19/aury/boot/application/migrations/manager.py +685 -0
  38. aury_boot-0.0.19/aury/boot/application/migrations/setup.py +241 -0
  39. aury_boot-0.0.19/aury/boot/application/rpc/__init__.py +63 -0
  40. aury_boot-0.0.19/aury/boot/application/rpc/base.py +108 -0
  41. aury_boot-0.0.19/aury/boot/application/rpc/client.py +294 -0
  42. aury_boot-0.0.19/aury/boot/application/rpc/discovery.py +218 -0
  43. aury_boot-0.0.19/aury/boot/application/scheduler/__init__.py +13 -0
  44. aury_boot-0.0.19/aury/boot/application/scheduler/runner.py +123 -0
  45. aury_boot-0.0.19/aury/boot/application/server/__init__.py +296 -0
  46. aury_boot-0.0.19/aury/boot/commands/__init__.py +50 -0
  47. aury_boot-0.0.19/aury/boot/commands/add.py +76 -0
  48. aury_boot-0.0.19/aury/boot/commands/app.py +242 -0
  49. aury_boot-0.0.19/aury/boot/commands/config.py +177 -0
  50. aury_boot-0.0.19/aury/boot/commands/docker.py +367 -0
  51. aury_boot-0.0.19/aury/boot/commands/docs.py +416 -0
  52. aury_boot-0.0.19/aury/boot/commands/generate.py +1277 -0
  53. aury_boot-0.0.19/aury/boot/commands/init.py +941 -0
  54. aury_boot-0.0.19/aury/boot/commands/migrate/__init__.py +37 -0
  55. aury_boot-0.0.19/aury/boot/commands/migrate/app.py +54 -0
  56. aury_boot-0.0.19/aury/boot/commands/migrate/commands.py +303 -0
  57. aury_boot-0.0.19/aury/boot/commands/pkg.py +471 -0
  58. aury_boot-0.0.19/aury/boot/commands/scheduler.py +124 -0
  59. aury_boot-0.0.19/aury/boot/commands/server/__init__.py +21 -0
  60. aury_boot-0.0.19/aury/boot/commands/server/app.py +540 -0
  61. aury_boot-0.0.19/aury/boot/commands/templates/generate/api.py.tpl +105 -0
  62. aury_boot-0.0.19/aury/boot/commands/templates/generate/model.py.tpl +17 -0
  63. aury_boot-0.0.19/aury/boot/commands/templates/generate/repository.py.tpl +19 -0
  64. aury_boot-0.0.19/aury/boot/commands/templates/generate/schema.py.tpl +29 -0
  65. aury_boot-0.0.19/aury/boot/commands/templates/generate/service.py.tpl +48 -0
  66. aury_boot-0.0.19/aury/boot/commands/templates/project/AGENTS.md.tpl +233 -0
  67. aury_boot-0.0.19/aury/boot/commands/templates/project/README.md.tpl +111 -0
  68. aury_boot-0.0.19/aury/boot/commands/templates/project/admin_console_init.py.tpl +50 -0
  69. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/00-overview.md.tpl +59 -0
  70. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/01-model.md.tpl +184 -0
  71. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/02-repository.md.tpl +206 -0
  72. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/03-service.md.tpl +398 -0
  73. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/04-schema.md.tpl +95 -0
  74. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/05-api.md.tpl +116 -0
  75. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/06-exception.md.tpl +118 -0
  76. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/07-cache.md.tpl +122 -0
  77. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/08-scheduler.md.tpl +178 -0
  78. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/09-tasks.md.tpl +38 -0
  79. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/10-storage.md.tpl +158 -0
  80. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/11-logging.md.tpl +95 -0
  81. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/12-admin.md.tpl +56 -0
  82. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/13-channel.md.tpl +104 -0
  83. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/14-mq.md.tpl +102 -0
  84. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/15-events.md.tpl +147 -0
  85. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/16-adapter.md.tpl +403 -0
  86. aury_boot-0.0.19/aury/boot/commands/templates/project/aury_docs/99-cli.md.tpl +182 -0
  87. aury_boot-0.0.19/aury/boot/commands/templates/project/config.py.tpl +38 -0
  88. aury_boot-0.0.19/aury/boot/commands/templates/project/conftest.py.tpl +26 -0
  89. aury_boot-0.0.19/aury/boot/commands/templates/project/env_templates/_header.tpl +10 -0
  90. aury_boot-0.0.19/aury/boot/commands/templates/project/env_templates/admin.tpl +49 -0
  91. aury_boot-0.0.19/aury/boot/commands/templates/project/env_templates/cache.tpl +14 -0
  92. aury_boot-0.0.19/aury/boot/commands/templates/project/env_templates/database.tpl +22 -0
  93. aury_boot-0.0.19/aury/boot/commands/templates/project/env_templates/log.tpl +20 -0
  94. aury_boot-0.0.19/aury/boot/commands/templates/project/env_templates/messaging.tpl +46 -0
  95. aury_boot-0.0.19/aury/boot/commands/templates/project/env_templates/rpc.tpl +28 -0
  96. aury_boot-0.0.19/aury/boot/commands/templates/project/env_templates/scheduler.tpl +18 -0
  97. aury_boot-0.0.19/aury/boot/commands/templates/project/env_templates/service.tpl +18 -0
  98. aury_boot-0.0.19/aury/boot/commands/templates/project/env_templates/storage.tpl +38 -0
  99. aury_boot-0.0.19/aury/boot/commands/templates/project/env_templates/third_party.tpl +43 -0
  100. aury_boot-0.0.19/aury/boot/commands/templates/project/gitignore.tpl +128 -0
  101. aury_boot-0.0.19/aury/boot/commands/templates/project/main.py.tpl +45 -0
  102. aury_boot-0.0.19/aury/boot/commands/templates/project/modules/api.py.tpl +19 -0
  103. aury_boot-0.0.19/aury/boot/commands/templates/project/modules/exceptions.py.tpl +84 -0
  104. aury_boot-0.0.19/aury/boot/commands/templates/project/modules/schedules.py.tpl +21 -0
  105. aury_boot-0.0.19/aury/boot/commands/templates/project/modules/tasks.py.tpl +20 -0
  106. aury_boot-0.0.19/aury/boot/commands/worker.py +143 -0
  107. aury_boot-0.0.19/aury/boot/common/__init__.py +35 -0
  108. aury_boot-0.0.19/aury/boot/common/exceptions/__init__.py +114 -0
  109. aury_boot-0.0.19/aury/boot/common/i18n/__init__.py +16 -0
  110. aury_boot-0.0.19/aury/boot/common/i18n/translator.py +272 -0
  111. aury_boot-0.0.19/aury/boot/common/logging/__init__.py +67 -0
  112. aury_boot-0.0.19/aury/boot/common/logging/context.py +81 -0
  113. aury_boot-0.0.19/aury/boot/common/logging/decorators.py +118 -0
  114. aury_boot-0.0.19/aury/boot/common/logging/format.py +315 -0
  115. aury_boot-0.0.19/aury/boot/common/logging/setup.py +288 -0
  116. aury_boot-0.0.19/aury/boot/contrib/__init__.py +10 -0
  117. aury_boot-0.0.19/aury/boot/contrib/admin_console/__init__.py +18 -0
  118. aury_boot-0.0.19/aury/boot/contrib/admin_console/auth.py +136 -0
  119. aury_boot-0.0.19/aury/boot/contrib/admin_console/discovery.py +69 -0
  120. aury_boot-0.0.19/aury/boot/contrib/admin_console/install.py +172 -0
  121. aury_boot-0.0.19/aury/boot/contrib/admin_console/utils.py +44 -0
  122. aury_boot-0.0.19/aury/boot/domain/__init__.py +79 -0
  123. aury_boot-0.0.19/aury/boot/domain/exceptions/__init__.py +132 -0
  124. aury_boot-0.0.19/aury/boot/domain/models/__init__.py +51 -0
  125. aury_boot-0.0.19/aury/boot/domain/models/base.py +69 -0
  126. aury_boot-0.0.19/aury/boot/domain/models/mixins.py +182 -0
  127. aury_boot-0.0.19/aury/boot/domain/models/models.py +96 -0
  128. aury_boot-0.0.19/aury/boot/domain/pagination/__init__.py +373 -0
  129. aury_boot-0.0.19/aury/boot/domain/repository/__init__.py +23 -0
  130. aury_boot-0.0.19/aury/boot/domain/repository/impl.py +423 -0
  131. aury_boot-0.0.19/aury/boot/domain/repository/interceptors.py +47 -0
  132. aury_boot-0.0.19/aury/boot/domain/repository/interface.py +106 -0
  133. aury_boot-0.0.19/aury/boot/domain/repository/query_builder.py +348 -0
  134. aury_boot-0.0.19/aury/boot/domain/service/__init__.py +11 -0
  135. aury_boot-0.0.19/aury/boot/domain/service/base.py +73 -0
  136. aury_boot-0.0.19/aury/boot/domain/transaction/__init__.py +403 -0
  137. aury_boot-0.0.19/aury/boot/infrastructure/__init__.py +161 -0
  138. aury_boot-0.0.19/aury/boot/infrastructure/cache/__init__.py +31 -0
  139. aury_boot-0.0.19/aury/boot/infrastructure/cache/backends.py +432 -0
  140. aury_boot-0.0.19/aury/boot/infrastructure/cache/base.py +80 -0
  141. aury_boot-0.0.19/aury/boot/infrastructure/cache/exceptions.py +37 -0
  142. aury_boot-0.0.19/aury/boot/infrastructure/cache/factory.py +94 -0
  143. aury_boot-0.0.19/aury/boot/infrastructure/cache/manager.py +340 -0
  144. aury_boot-0.0.19/aury/boot/infrastructure/channel/__init__.py +24 -0
  145. aury_boot-0.0.19/aury/boot/infrastructure/channel/backends/__init__.py +9 -0
  146. aury_boot-0.0.19/aury/boot/infrastructure/channel/backends/memory.py +83 -0
  147. aury_boot-0.0.19/aury/boot/infrastructure/channel/backends/redis.py +88 -0
  148. aury_boot-0.0.19/aury/boot/infrastructure/channel/base.py +92 -0
  149. aury_boot-0.0.19/aury/boot/infrastructure/channel/manager.py +203 -0
  150. aury_boot-0.0.19/aury/boot/infrastructure/clients/__init__.py +22 -0
  151. aury_boot-0.0.19/aury/boot/infrastructure/clients/rabbitmq/__init__.py +9 -0
  152. aury_boot-0.0.19/aury/boot/infrastructure/clients/rabbitmq/config.py +46 -0
  153. aury_boot-0.0.19/aury/boot/infrastructure/clients/rabbitmq/manager.py +288 -0
  154. aury_boot-0.0.19/aury/boot/infrastructure/clients/redis/__init__.py +28 -0
  155. aury_boot-0.0.19/aury/boot/infrastructure/clients/redis/config.py +51 -0
  156. aury_boot-0.0.19/aury/boot/infrastructure/clients/redis/manager.py +264 -0
  157. aury_boot-0.0.19/aury/boot/infrastructure/database/__init__.py +39 -0
  158. aury_boot-0.0.19/aury/boot/infrastructure/database/config.py +62 -0
  159. aury_boot-0.0.19/aury/boot/infrastructure/database/exceptions.py +44 -0
  160. aury_boot-0.0.19/aury/boot/infrastructure/database/manager.py +301 -0
  161. aury_boot-0.0.19/aury/boot/infrastructure/database/query_tools/__init__.py +164 -0
  162. aury_boot-0.0.19/aury/boot/infrastructure/database/strategies/__init__.py +198 -0
  163. aury_boot-0.0.19/aury/boot/infrastructure/di/__init__.py +15 -0
  164. aury_boot-0.0.19/aury/boot/infrastructure/di/container.py +393 -0
  165. aury_boot-0.0.19/aury/boot/infrastructure/events/__init__.py +30 -0
  166. aury_boot-0.0.19/aury/boot/infrastructure/events/backends/__init__.py +11 -0
  167. aury_boot-0.0.19/aury/boot/infrastructure/events/backends/memory.py +86 -0
  168. aury_boot-0.0.19/aury/boot/infrastructure/events/backends/rabbitmq.py +193 -0
  169. aury_boot-0.0.19/aury/boot/infrastructure/events/backends/redis.py +162 -0
  170. aury_boot-0.0.19/aury/boot/infrastructure/events/base.py +127 -0
  171. aury_boot-0.0.19/aury/boot/infrastructure/events/manager.py +224 -0
  172. aury_boot-0.0.19/aury/boot/infrastructure/events/middleware.py +51 -0
  173. aury_boot-0.0.19/aury/boot/infrastructure/monitoring/__init__.py +529 -0
  174. aury_boot-0.0.19/aury/boot/infrastructure/mq/__init__.py +24 -0
  175. aury_boot-0.0.19/aury/boot/infrastructure/mq/backends/__init__.py +9 -0
  176. aury_boot-0.0.19/aury/boot/infrastructure/mq/backends/rabbitmq.py +179 -0
  177. aury_boot-0.0.19/aury/boot/infrastructure/mq/backends/redis.py +167 -0
  178. aury_boot-0.0.19/aury/boot/infrastructure/mq/base.py +143 -0
  179. aury_boot-0.0.19/aury/boot/infrastructure/mq/manager.py +239 -0
  180. aury_boot-0.0.19/aury/boot/infrastructure/scheduler/__init__.py +19 -0
  181. aury_boot-0.0.19/aury/boot/infrastructure/scheduler/exceptions.py +37 -0
  182. aury_boot-0.0.19/aury/boot/infrastructure/scheduler/manager.py +479 -0
  183. aury_boot-0.0.19/aury/boot/infrastructure/storage/__init__.py +49 -0
  184. aury_boot-0.0.19/aury/boot/infrastructure/storage/base.py +173 -0
  185. aury_boot-0.0.19/aury/boot/infrastructure/storage/exceptions.py +37 -0
  186. aury_boot-0.0.19/aury/boot/infrastructure/storage/factory.py +87 -0
  187. aury_boot-0.0.19/aury/boot/infrastructure/tasks/__init__.py +24 -0
  188. aury_boot-0.0.19/aury/boot/infrastructure/tasks/config.py +37 -0
  189. aury_boot-0.0.19/aury/boot/infrastructure/tasks/constants.py +37 -0
  190. aury_boot-0.0.19/aury/boot/infrastructure/tasks/exceptions.py +37 -0
  191. aury_boot-0.0.19/aury/boot/infrastructure/tasks/manager.py +512 -0
  192. aury_boot-0.0.19/aury/boot/testing/__init__.py +24 -0
  193. aury_boot-0.0.19/aury/boot/testing/base.py +122 -0
  194. aury_boot-0.0.19/aury/boot/testing/client.py +163 -0
  195. aury_boot-0.0.19/aury/boot/testing/factory.py +154 -0
  196. aury_boot-0.0.19/aury/boot/toolkit/__init__.py +21 -0
  197. aury_boot-0.0.19/aury/boot/toolkit/http/__init__.py +367 -0
  198. aury_boot-0.0.19/pyproject.toml +271 -0
@@ -0,0 +1,47 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual environments
24
+ venv/
25
+ env/
26
+ ENV/
27
+
28
+ # IDE
29
+ .vscode/
30
+ .idea/
31
+ *.swp
32
+ *.swo
33
+
34
+ # Logs
35
+ *.log
36
+ log/
37
+
38
+ # Environment
39
+ .env
40
+ .env.local
41
+
42
+ # OS
43
+ .DS_Store
44
+ Thumbs.db
45
+
46
+ # Generated version files
47
+ */_version.py
@@ -0,0 +1,284 @@
1
+ Metadata-Version: 2.4
2
+ Name: aury-boot
3
+ Version: 0.0.19
4
+ Summary: Aury Boot - 基于 FastAPI 生态的企业级 API 开发框架
5
+ Requires-Python: >=3.13
6
+ Requires-Dist: alembic>=1.17.2
7
+ Requires-Dist: aury-sdk-storage[aws]>=0.0.6
8
+ Requires-Dist: babel>=2.17.0
9
+ Requires-Dist: faker>=38.2.0
10
+ Requires-Dist: fastapi>=0.122.0
11
+ Requires-Dist: greenlet>=3.2.4
12
+ Requires-Dist: httpx>=0.28.1
13
+ Requires-Dist: loguru>=0.7.3
14
+ Requires-Dist: pydantic-settings>=2.12.0
15
+ Requires-Dist: pydantic>=2.12.5
16
+ Requires-Dist: rich>=14.2.0
17
+ Requires-Dist: sqlalchemy>=2.0.44
18
+ Requires-Dist: tenacity>=9.1.2
19
+ Requires-Dist: typer>=0.20.0
20
+ Requires-Dist: uvicorn[standard]>=0.30.0
21
+ Provides-Extra: admin
22
+ Requires-Dist: itsdangerous>=2.2.0; extra == 'admin'
23
+ Requires-Dist: sqladmin>=0.16.0; extra == 'admin'
24
+ Provides-Extra: all
25
+ Requires-Dist: aiomysql>=0.3.2; extra == 'all'
26
+ Requires-Dist: aiosqlite>=0.21.0; extra == 'all'
27
+ Requires-Dist: amqp>=5.3.1; extra == 'all'
28
+ Requires-Dist: apscheduler>=3.11.1; extra == 'all'
29
+ Requires-Dist: asyncpg>=0.31.0; extra == 'all'
30
+ Requires-Dist: aury-sdk-storage[aws]>=0.0.1; extra == 'all'
31
+ Requires-Dist: dramatiq-kombu-broker>=0.2.2; extra == 'all'
32
+ Requires-Dist: dramatiq>=1.18.0; extra == 'all'
33
+ Requires-Dist: kombu>=5.6.1; extra == 'all'
34
+ Requires-Dist: redis>=7.1.0; extra == 'all'
35
+ Provides-Extra: dev
36
+ Requires-Dist: mypy>=1.19.0; extra == 'dev'
37
+ Requires-Dist: pytest-asyncio>=1.3.0; extra == 'dev'
38
+ Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
39
+ Requires-Dist: pytest>=9.0.1; extra == 'dev'
40
+ Requires-Dist: ruff>=0.14.7; extra == 'dev'
41
+ Provides-Extra: docs
42
+ Requires-Dist: materialx>=1.39.0; extra == 'docs'
43
+ Requires-Dist: mkdocs-material>=9.7.0; extra == 'docs'
44
+ Requires-Dist: mkdocs>=1.6.0; extra == 'docs'
45
+ Provides-Extra: mysql
46
+ Requires-Dist: aiomysql>=0.3.2; extra == 'mysql'
47
+ Provides-Extra: postgres
48
+ Requires-Dist: asyncpg>=0.31.0; extra == 'postgres'
49
+ Provides-Extra: rabbitmq
50
+ Requires-Dist: amqp>=5.3.1; extra == 'rabbitmq'
51
+ Provides-Extra: recommended
52
+ Requires-Dist: aiosqlite>=0.21.0; extra == 'recommended'
53
+ Requires-Dist: apscheduler>=3.11.1; extra == 'recommended'
54
+ Requires-Dist: asyncpg>=0.31.0; extra == 'recommended'
55
+ Requires-Dist: aury-sdk-storage[aws]>=0.0.1; extra == 'recommended'
56
+ Requires-Dist: dramatiq-kombu-broker>=0.2.2; extra == 'recommended'
57
+ Requires-Dist: dramatiq>=1.18.0; extra == 'recommended'
58
+ Requires-Dist: kombu>=5.6.1; extra == 'recommended'
59
+ Requires-Dist: redis>=7.1.0; extra == 'recommended'
60
+ Provides-Extra: redis
61
+ Requires-Dist: redis>=7.1.0; extra == 'redis'
62
+ Provides-Extra: s3
63
+ Requires-Dist: aury-sdk-storage[aws]>=0.0.1; extra == 's3'
64
+ Provides-Extra: scheduler
65
+ Requires-Dist: apscheduler>=3.11.1; extra == 'scheduler'
66
+ Provides-Extra: sqlite
67
+ Requires-Dist: aiosqlite>=0.21.0; extra == 'sqlite'
68
+ Provides-Extra: tasks
69
+ Requires-Dist: dramatiq-kombu-broker>=0.2.2; extra == 'tasks'
70
+ Requires-Dist: dramatiq>=1.18.0; extra == 'tasks'
71
+ Requires-Dist: kombu>=5.6.1; extra == 'tasks'
72
+ Description-Content-Type: text/markdown
73
+
74
+ # Aury Boot
75
+
76
+ 基于 FastAPI 生态的企业级 API 开发框架,提供所有微服务共用的基础设施组件。
77
+
78
+ ## 快速开始
79
+
80
+ ```bash
81
+ # 1. 创建项目目录并初始化
82
+ mkdir my-service && cd my-service
83
+ uv init . --name my_service --no-package --python 3.13
84
+
85
+ # 2. 添加依赖
86
+ uv add "aury-boot[recommended,admin]" # admin 可选,提供 SQLAdmin 管理后台
87
+
88
+ # 3. 初始化项目结构
89
+ aury init
90
+
91
+ # 4. 启动开发服务器
92
+ aury server dev
93
+ ```
94
+
95
+ ## 功能模块
96
+
97
+ - **core**: 核心功能(数据库、缓存、任务调度等)
98
+ - **utils**: 工具函数(日志、安全、HTTP客户端等)
99
+ - **models**: 共享数据模型和响应模型
100
+ - **repositories**: 基础仓储模式
101
+ - **services**: 基础服务类
102
+ - **adapters**: 第三方服务适配器
103
+ - **rpc**: RPC通信框架
104
+ - **exceptions**: 错误处理系统
105
+ - **i18n**: 国际化支持
106
+ - **testing**: 测试框架
107
+ - **migrations**: 数据库迁移工具
108
+
109
+ ## 主要功能
110
+
111
+ ### 1. 国际化支持 (i18n)
112
+
113
+ 提供完整的多语言支持,包括文本翻译、日期/数字本地化等:
114
+
115
+ ```python
116
+ from aury.boot.i18n import Translator, translate, set_locale
117
+
118
+ # 设置语言环境
119
+ set_locale("zh_CN")
120
+
121
+ # 使用翻译器
122
+ translator = Translator(locale="zh_CN")
123
+ message = translator.translate("user.created", name="张三")
124
+
125
+ # 使用简写函数
126
+ message = translate("user.created", name="张三")
127
+
128
+ # 装饰器方式
129
+ @_("user.title")
130
+ def get_user_title():
131
+ return "User Title" # 会被翻译
132
+ ```
133
+
134
+ ### 2. 测试框架
135
+
136
+ 提供便捷的测试工具,包括测试基类、测试客户端、数据工厂等:
137
+
138
+ ```python
139
+ from aury.boot.testing import TestCase, TestClient, Factory
140
+
141
+ class UserServiceTest(TestCase):
142
+ """测试基类,自动处理数据库事务回滚"""
143
+
144
+ async def setUp(self):
145
+ """测试前准备"""
146
+ self.client = TestClient(app)
147
+ self.user_factory = Factory(User)
148
+
149
+ async def test_create_user(self):
150
+ """测试创建用户"""
151
+ user = await self.user_factory.create(name="张三")
152
+ response = await self.client.post("/users", json={"name": "张三"})
153
+ assert response.status_code == 201
154
+ ```
155
+
156
+ ### 3. 数据库迁移工具
157
+
158
+ 提供便捷的数据库迁移管理,类似 Django 的命令行接口:
159
+
160
+ ```python
161
+ from aury.boot.migrations import MigrationManager
162
+
163
+ # 使用 Python API
164
+ migration_manager = MigrationManager()
165
+ await migration_manager.make_migrations(message="add user table")
166
+ await migration_manager.migrate_up()
167
+ await migration_manager.migrate_down(version="previous")
168
+ status = await migration_manager.status()
169
+ ```
170
+
171
+ 命令行工具:
172
+
173
+ ```bash
174
+ # 生成迁移文件
175
+ aury migrate make -m "add user table"
176
+
177
+ # 执行迁移
178
+ aury migrate up
179
+
180
+ # 回滚迁移
181
+ aury migrate down
182
+
183
+ # 查看状态
184
+ aury migrate status
185
+
186
+ # 显示迁移历史
187
+ aury migrate show
188
+ ```
189
+
190
+ ### 4. 代码生成器
191
+
192
+ 快速生成标准的 CRUD 代码(模型、仓储、服务、API 路由):
193
+
194
+ ```bash
195
+ # 生成完整 CRUD(Model + Repository + Service + API)
196
+ aury generate crud user
197
+
198
+ # 单独生成各层代码
199
+ aury generate model user # SQLAlchemy 模型
200
+ aury generate repo user # Repository 仓储层
201
+ aury generate service user # Service 服务层
202
+ aury generate api user # API 路由
203
+
204
+ # 交互式生成(推荐):逐步选择字段、类型、验证规则
205
+ aury generate crud user -i
206
+ aury generate model user -i
207
+
208
+ # 指定字段(非交互式)
209
+ aury generate model user --fields "name:str,email:str,age:int"
210
+ ```
211
+
212
+ **交互式模式 (`-i`)** 会引导你:
213
+ - 添加字段名称和类型
214
+ - 设置字段约束(唯一、可空、默认值等)
215
+ - 配置关系字段(外键、多对多等)
216
+ - 自动插入 API 路由到 `api/__init__.py`
217
+
218
+ 生成的代码遵循项目架构模式,开箱即用。
219
+
220
+ ## 使用方式
221
+
222
+ 在AUM工作区内的其他包中,可以直接导入:
223
+
224
+ ```python
225
+ from aury.boot.infrastructure.database import DatabaseManager
226
+ from aury.boot.infrastructure.logging import logger
227
+ from aury.boot.core import BaseModel, BaseRepository, BaseService
228
+ from aury.boot.interfaces import BaseRequest, BaseResponse
229
+ from aury.boot.application.rpc import RPCClient
230
+ ```
231
+
232
+ ## 开发指南
233
+
234
+ 修改此包后,所有依赖它的服务都会自动使用最新版本,无需重新安装。
235
+
236
+ ## 安装
237
+
238
+ ```bash
239
+ # 推荐(PostgreSQL + Redis + 任务队列 + 调度器)
240
+ uv add "aury-boot[recommended]"
241
+
242
+ # 或按需组合
243
+ uv add "aury-boot[postgres,redis]"
244
+
245
+ # 全部依赖
246
+ uv add "aury-boot[all]"
247
+ ```
248
+
249
+ ### 可选依赖
250
+
251
+ | 名称 | 说明 |
252
+ |------|------|
253
+ | `postgres` | PostgreSQL 数据库 |
254
+ | `mysql` | MySQL 数据库 |
255
+ | `sqlite` | SQLite 数据库 |
256
+ | `redis` | Redis 缓存 |
257
+ | `s3` | S3 对象存储 |
258
+ | `tasks` | 任务队列 |
259
+ | `rabbitmq` | RabbitMQ 支持 |
260
+ | `scheduler` | 定时调度 |
261
+ | `recommended` | 推荐组合 |
262
+ | `all` | 全部依赖 |
263
+
264
+ ## 开发环境设置
265
+
266
+ ```bash
267
+ # 克隆仓库
268
+ git clone https://github.com/AuriMyth/aury-boot.git
269
+ cd aury-boot
270
+
271
+ # 安装依赖
272
+ uv sync --group dev
273
+
274
+ # 运行测试
275
+ pytest
276
+
277
+ # 代码检查
278
+ ruff check .
279
+ mypy aury/
280
+ ```
281
+
282
+
283
+
284
+
@@ -0,0 +1,211 @@
1
+ # Aury Boot
2
+
3
+ 基于 FastAPI 生态的企业级 API 开发框架,提供所有微服务共用的基础设施组件。
4
+
5
+ ## 快速开始
6
+
7
+ ```bash
8
+ # 1. 创建项目目录并初始化
9
+ mkdir my-service && cd my-service
10
+ uv init . --name my_service --no-package --python 3.13
11
+
12
+ # 2. 添加依赖
13
+ uv add "aury-boot[recommended,admin]" # admin 可选,提供 SQLAdmin 管理后台
14
+
15
+ # 3. 初始化项目结构
16
+ aury init
17
+
18
+ # 4. 启动开发服务器
19
+ aury server dev
20
+ ```
21
+
22
+ ## 功能模块
23
+
24
+ - **core**: 核心功能(数据库、缓存、任务调度等)
25
+ - **utils**: 工具函数(日志、安全、HTTP客户端等)
26
+ - **models**: 共享数据模型和响应模型
27
+ - **repositories**: 基础仓储模式
28
+ - **services**: 基础服务类
29
+ - **adapters**: 第三方服务适配器
30
+ - **rpc**: RPC通信框架
31
+ - **exceptions**: 错误处理系统
32
+ - **i18n**: 国际化支持
33
+ - **testing**: 测试框架
34
+ - **migrations**: 数据库迁移工具
35
+
36
+ ## 主要功能
37
+
38
+ ### 1. 国际化支持 (i18n)
39
+
40
+ 提供完整的多语言支持,包括文本翻译、日期/数字本地化等:
41
+
42
+ ```python
43
+ from aury.boot.i18n import Translator, translate, set_locale
44
+
45
+ # 设置语言环境
46
+ set_locale("zh_CN")
47
+
48
+ # 使用翻译器
49
+ translator = Translator(locale="zh_CN")
50
+ message = translator.translate("user.created", name="张三")
51
+
52
+ # 使用简写函数
53
+ message = translate("user.created", name="张三")
54
+
55
+ # 装饰器方式
56
+ @_("user.title")
57
+ def get_user_title():
58
+ return "User Title" # 会被翻译
59
+ ```
60
+
61
+ ### 2. 测试框架
62
+
63
+ 提供便捷的测试工具,包括测试基类、测试客户端、数据工厂等:
64
+
65
+ ```python
66
+ from aury.boot.testing import TestCase, TestClient, Factory
67
+
68
+ class UserServiceTest(TestCase):
69
+ """测试基类,自动处理数据库事务回滚"""
70
+
71
+ async def setUp(self):
72
+ """测试前准备"""
73
+ self.client = TestClient(app)
74
+ self.user_factory = Factory(User)
75
+
76
+ async def test_create_user(self):
77
+ """测试创建用户"""
78
+ user = await self.user_factory.create(name="张三")
79
+ response = await self.client.post("/users", json={"name": "张三"})
80
+ assert response.status_code == 201
81
+ ```
82
+
83
+ ### 3. 数据库迁移工具
84
+
85
+ 提供便捷的数据库迁移管理,类似 Django 的命令行接口:
86
+
87
+ ```python
88
+ from aury.boot.migrations import MigrationManager
89
+
90
+ # 使用 Python API
91
+ migration_manager = MigrationManager()
92
+ await migration_manager.make_migrations(message="add user table")
93
+ await migration_manager.migrate_up()
94
+ await migration_manager.migrate_down(version="previous")
95
+ status = await migration_manager.status()
96
+ ```
97
+
98
+ 命令行工具:
99
+
100
+ ```bash
101
+ # 生成迁移文件
102
+ aury migrate make -m "add user table"
103
+
104
+ # 执行迁移
105
+ aury migrate up
106
+
107
+ # 回滚迁移
108
+ aury migrate down
109
+
110
+ # 查看状态
111
+ aury migrate status
112
+
113
+ # 显示迁移历史
114
+ aury migrate show
115
+ ```
116
+
117
+ ### 4. 代码生成器
118
+
119
+ 快速生成标准的 CRUD 代码(模型、仓储、服务、API 路由):
120
+
121
+ ```bash
122
+ # 生成完整 CRUD(Model + Repository + Service + API)
123
+ aury generate crud user
124
+
125
+ # 单独生成各层代码
126
+ aury generate model user # SQLAlchemy 模型
127
+ aury generate repo user # Repository 仓储层
128
+ aury generate service user # Service 服务层
129
+ aury generate api user # API 路由
130
+
131
+ # 交互式生成(推荐):逐步选择字段、类型、验证规则
132
+ aury generate crud user -i
133
+ aury generate model user -i
134
+
135
+ # 指定字段(非交互式)
136
+ aury generate model user --fields "name:str,email:str,age:int"
137
+ ```
138
+
139
+ **交互式模式 (`-i`)** 会引导你:
140
+ - 添加字段名称和类型
141
+ - 设置字段约束(唯一、可空、默认值等)
142
+ - 配置关系字段(外键、多对多等)
143
+ - 自动插入 API 路由到 `api/__init__.py`
144
+
145
+ 生成的代码遵循项目架构模式,开箱即用。
146
+
147
+ ## 使用方式
148
+
149
+ 在AUM工作区内的其他包中,可以直接导入:
150
+
151
+ ```python
152
+ from aury.boot.infrastructure.database import DatabaseManager
153
+ from aury.boot.infrastructure.logging import logger
154
+ from aury.boot.core import BaseModel, BaseRepository, BaseService
155
+ from aury.boot.interfaces import BaseRequest, BaseResponse
156
+ from aury.boot.application.rpc import RPCClient
157
+ ```
158
+
159
+ ## 开发指南
160
+
161
+ 修改此包后,所有依赖它的服务都会自动使用最新版本,无需重新安装。
162
+
163
+ ## 安装
164
+
165
+ ```bash
166
+ # 推荐(PostgreSQL + Redis + 任务队列 + 调度器)
167
+ uv add "aury-boot[recommended]"
168
+
169
+ # 或按需组合
170
+ uv add "aury-boot[postgres,redis]"
171
+
172
+ # 全部依赖
173
+ uv add "aury-boot[all]"
174
+ ```
175
+
176
+ ### 可选依赖
177
+
178
+ | 名称 | 说明 |
179
+ |------|------|
180
+ | `postgres` | PostgreSQL 数据库 |
181
+ | `mysql` | MySQL 数据库 |
182
+ | `sqlite` | SQLite 数据库 |
183
+ | `redis` | Redis 缓存 |
184
+ | `s3` | S3 对象存储 |
185
+ | `tasks` | 任务队列 |
186
+ | `rabbitmq` | RabbitMQ 支持 |
187
+ | `scheduler` | 定时调度 |
188
+ | `recommended` | 推荐组合 |
189
+ | `all` | 全部依赖 |
190
+
191
+ ## 开发环境设置
192
+
193
+ ```bash
194
+ # 克隆仓库
195
+ git clone https://github.com/AuriMyth/aury-boot.git
196
+ cd aury-boot
197
+
198
+ # 安装依赖
199
+ uv sync --group dev
200
+
201
+ # 运行测试
202
+ pytest
203
+
204
+ # 代码检查
205
+ ruff check .
206
+ mypy aury/
207
+ ```
208
+
209
+
210
+
211
+
@@ -0,0 +1,66 @@
1
+ """Aury Boot - 核心基础架构工具包。
2
+
3
+ 提供数据库、缓存、认证等核心基础设施功能。
4
+
5
+ 模块结构:
6
+ - common: 最基础层(异常基类、日志系统、国际化)
7
+ - domain: 领域层(业务模型、仓储接口、服务基类、分页、事务管理)
8
+ - infrastructure: 基础设施层(外部依赖的实现:数据库、缓存、存储、调度器等)
9
+ - application: 应用层(配置管理、RPC通信、依赖注入、事务管理、事件系统、迁移管理、API接口)
10
+ - toolkit: 工具包(通用工具函数)
11
+ - testing: 测试框架(测试基类、测试客户端、数据工厂)
12
+
13
+ 使用方式:
14
+ from aury.boot import application
15
+ from aury.boot.domain.models import Model
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ import importlib
21
+ from typing import TYPE_CHECKING
22
+
23
+ # 版本号由 hatch-vcs 自动生成
24
+ try:
25
+ from ._version import __version__
26
+ except ImportError:
27
+ __version__ = "0.0.0.dev0"
28
+
29
+ # 延迟导入:子模块仅在被访问时才加载
30
+ _SUBMODULES = {
31
+ "application",
32
+ "common",
33
+ "domain",
34
+ "infrastructure",
35
+ "toolkit",
36
+ "testing",
37
+ }
38
+
39
+
40
+ def __getattr__(name: str):
41
+ """延迟导入子模块。"""
42
+ if name in _SUBMODULES:
43
+ try:
44
+ return importlib.import_module(f".{name}", __name__)
45
+ except ImportError:
46
+ if name == "testing":
47
+ # testing 模块可能在生产环境不可用
48
+ return None
49
+ raise
50
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
51
+
52
+
53
+ def __dir__():
54
+ """返回可用属性列表。"""
55
+ return [*list(_SUBMODULES), "__version__"]
56
+
57
+
58
+ __all__ = [
59
+ "__version__",
60
+ "application",
61
+ "common",
62
+ "domain",
63
+ "infrastructure",
64
+ "testing",
65
+ "toolkit",
66
+ ]
@@ -0,0 +1,34 @@
1
+ # file generated by setuptools-scm
2
+ # don't change, don't track in version control
3
+
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
12
+
13
+ TYPE_CHECKING = False
14
+ if TYPE_CHECKING:
15
+ from typing import Tuple
16
+ from typing import Union
17
+
18
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
20
+ else:
21
+ VERSION_TUPLE = object
22
+ COMMIT_ID = object
23
+
24
+ version: str
25
+ __version__: str
26
+ __version_tuple__: VERSION_TUPLE
27
+ version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
30
+
31
+ __version__ = version = '0.0.19'
32
+ __version_tuple__ = version_tuple = (0, 0, 19)
33
+
34
+ __commit_id__ = commit_id = None