fastapi-spawn 0.4.25__tar.gz → 0.4.26__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 (77) hide show
  1. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/PKG-INFO +19 -3
  2. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/README.md +18 -2
  3. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/cli.py +62 -13
  4. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/pyproject.toml +1 -1
  5. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/.gitignore +0 -0
  6. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/LICENSE +0 -0
  7. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/__init__.py +0 -0
  8. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/config.py +0 -0
  9. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/constants.py +0 -0
  10. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/generator.py +0 -0
  11. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/interactive.py +0 -0
  12. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/alembic/alembic.ini.j2 +0 -0
  13. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/alembic/env.py.j2 +0 -0
  14. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/__init__.py.j2 +0 -0
  15. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/admin/setup.py.j2 +0 -0
  16. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/deps.py.j2 +0 -0
  17. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/graphql.py.j2 +0 -0
  18. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/v1/auth/router.py.j2 +0 -0
  19. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/v1/auth/sso.py.j2 +0 -0
  20. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/v1/health/router.py.j2 +0 -0
  21. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/v1/pagination/router.py.j2 +0 -0
  22. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/v1/payments/router.py.j2 +0 -0
  23. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/v1/permissions/router.py.j2 +0 -0
  24. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/v1/router.py.j2 +0 -0
  25. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/v1/streaming/router.py.j2 +0 -0
  26. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/v1/uploads/router.py.j2 +0 -0
  27. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/api/v1/ws/router.py.j2 +0 -0
  28. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/ai.py.j2 +0 -0
  29. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/cache.py.j2 +0 -0
  30. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/config.py.j2 +0 -0
  31. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/email.py.j2 +0 -0
  32. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/exceptions.py.j2 +0 -0
  33. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/logger.py.j2 +0 -0
  34. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/logging.py.j2 +0 -0
  35. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/monitoring.py.j2 +0 -0
  36. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/notifications.py.j2 +0 -0
  37. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/ocr.py.j2 +0 -0
  38. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/permissions.py.j2 +0 -0
  39. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/search.py.j2 +0 -0
  40. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/security.py.j2 +0 -0
  41. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/storage.py.j2 +0 -0
  42. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/vector_db.py.j2 +0 -0
  43. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/core/ws_manager.py.j2 +0 -0
  44. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/db/session.py.j2 +0 -0
  45. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/frontend/index.html.j2 +0 -0
  46. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/main.py.j2 +0 -0
  47. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/middleware/__init__.py.j2 +0 -0
  48. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/middleware/rate_limit.py.j2 +0 -0
  49. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/middleware/request_logger.py.j2 +0 -0
  50. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/app/middleware/response_format.py.j2 +0 -0
  51. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/base/Makefile.j2 +0 -0
  52. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/base/README.md.j2 +0 -0
  53. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/base/env.j2 +0 -0
  54. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/base/env_example.j2 +0 -0
  55. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/base/gitignore.j2 +0 -0
  56. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/base/pre_commit.j2 +0 -0
  57. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/base/pyproject.toml.j2 +0 -0
  58. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/ci/github/publish.yml.j2 +0 -0
  59. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/ci/github/tests.yml.j2 +0 -0
  60. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/ci/gitlab/gitlab-ci.yml.j2 +0 -0
  61. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/db/seed.py.j2 +0 -0
  62. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/docker/Dockerfile.j2 +0 -0
  63. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/docker/docker-compose.yml.j2 +0 -0
  64. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/docker/dockerignore.j2 +0 -0
  65. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/infra/docker/docker-compose.prod.yml.j2 +0 -0
  66. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/infra/helm/Chart.yaml.j2 +0 -0
  67. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/infra/helm/values.yaml.j2 +0 -0
  68. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/infra/terraform/main.tf.j2 +0 -0
  69. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/infra/terraform/variables.tf.j2 +0 -0
  70. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/root/main.py.j2 +0 -0
  71. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/tasks/arq_worker.py.j2 +0 -0
  72. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/tasks/celery_app.py.j2 +0 -0
  73. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/tasks/sample_tasks.py.j2 +0 -0
  74. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/tests/conftest.py.j2 +0 -0
  75. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/templates/tests/test_health.py.j2 +0 -0
  76. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/utils.py +0 -0
  77. {fastapi_spawn-0.4.25 → fastapi_spawn-0.4.26}/fastapi_spawn/validators.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi-spawn
3
- Version: 0.4.25
3
+ Version: 0.4.26
4
4
  Summary: A powerful CLI tool to scaffold production-ready FastAPI projects with flexible database, auth, broker, and deployment options.
5
5
  Project-URL: Homepage, https://github.com/Bishwajitgarai/fastapi-spawn
6
6
  Project-URL: Documentation, https://github.com/Bishwajitgarai/fastapi-spawn#readme
@@ -76,6 +76,7 @@ fastapi-spawn new my-api
76
76
  fastapi-spawn start basic my-api
77
77
  fastapi-spawn start full-local my-api
78
78
  fastapi-spawn start full my-api
79
+ fastapi-spawn start custom my-api
79
80
 
80
81
  # Full stack one-liner
81
82
  fastapi-spawn new my-api \
@@ -104,8 +105,23 @@ fastapi-spawn add openai
104
105
  fastapi-spawn add alembic
105
106
  fastapi-spawn add sentry
106
107
  ```
107
-
108
- ```
108
+ ### 💡 Pro-Tip: Starting in an Empty Folder
109
+
110
+ To avoid confusion with nested projects (e.g., having a `pyproject.toml` in both the root and subfolder):
111
+
112
+ #### Option A: Let it create the folder (Recommended)
113
+ 1. Go to your projects directory.
114
+ 2. Run `fastapi-spawn start` (Do **not** run `uv init` first!).
115
+ 3. It will create a folder with everything inside.
116
+ 4. Open that folder in VS Code and run `uv sync`!
117
+
118
+ #### Option B: Generate directly in the CURRENT folder
119
+ If you already created a folder and opened it in VS Code:
120
+ 1. Make sure the folder is empty.
121
+ 2. Run the command with `--output .`:
122
+ ```bash
123
+ fastapi-spawn start custom my_project_name --output .
124
+ ```
109
125
 
110
126
  ---
111
127
 
@@ -35,6 +35,7 @@ fastapi-spawn new my-api
35
35
  fastapi-spawn start basic my-api
36
36
  fastapi-spawn start full-local my-api
37
37
  fastapi-spawn start full my-api
38
+ fastapi-spawn start custom my-api
38
39
 
39
40
  # Full stack one-liner
40
41
  fastapi-spawn new my-api \
@@ -63,8 +64,23 @@ fastapi-spawn add openai
63
64
  fastapi-spawn add alembic
64
65
  fastapi-spawn add sentry
65
66
  ```
66
-
67
- ```
67
+ ### 💡 Pro-Tip: Starting in an Empty Folder
68
+
69
+ To avoid confusion with nested projects (e.g., having a `pyproject.toml` in both the root and subfolder):
70
+
71
+ #### Option A: Let it create the folder (Recommended)
72
+ 1. Go to your projects directory.
73
+ 2. Run `fastapi-spawn start` (Do **not** run `uv init` first!).
74
+ 3. It will create a folder with everything inside.
75
+ 4. Open that folder in VS Code and run `uv sync`!
76
+
77
+ #### Option B: Generate directly in the CURRENT folder
78
+ If you already created a folder and opened it in VS Code:
79
+ 1. Make sure the folder is empty.
80
+ 2. Run the command with `--output .`:
81
+ ```bash
82
+ fastapi-spawn start custom my_project_name --output .
83
+ ```
68
84
 
69
85
  ---
70
86
 
@@ -233,20 +233,48 @@ def start(
233
233
  from fastapi_spawn.interactive import SPAWN_STYLE
234
234
  preset = questionary.select(
235
235
  "Which preset do you want to use?",
236
- choices=["basic", "full-local", "full"],
236
+ choices=["custom", "basic", "full-local", "full"],
237
+ default="custom",
237
238
  style=SPAWN_STYLE,
238
239
  ).unsafe_ask()
239
240
 
240
- if not project_name:
241
- import questionary
242
- from fastapi_spawn.interactive import SPAWN_STYLE
243
- from fastapi_spawn.validators import questionary_validator, validate_project_name
244
- project_name = questionary.text(
245
- "Project name:",
246
- validate=questionary_validator(validate_project_name),
247
- style=SPAWN_STYLE,
248
- ).unsafe_ask()
249
-
241
+ if preset == "custom":
242
+ from fastapi_spawn.interactive import run_interactive_flow
243
+ opts = run_interactive_flow(project_name or "")
244
+ config = ProjectConfig(
245
+ project_name=opts["project_name"],
246
+ db=opts["db"],
247
+ orm=opts["orm"],
248
+ migration=opts.get("migration", MigrationTool.none),
249
+ auth=opts["auth"],
250
+ broker=opts["broker"],
251
+ cache=opts["cache"],
252
+ storage=opts["storage"],
253
+ ai=opts["ai"],
254
+ api_extra=opts.get("api_extra", APIExtra.none),
255
+ monitoring=opts["monitoring"],
256
+ log_lib=opts["log_lib"],
257
+ log_dest=opts.get("log_dest", LogDestination.local),
258
+ email=opts.get("email", EmailProvider.none),
259
+ notify=opts.get("notify", NotificationProvider.none),
260
+ vector_db=opts["vector_db"],
261
+ stack=opts["stack"],
262
+ ci=opts["ci"],
263
+ include_docker=opts["include_docker"],
264
+ include_tests=opts["include_tests"],
265
+ force=force,
266
+ )
267
+ else:
268
+ if not project_name:
269
+ import questionary
270
+ from fastapi_spawn.interactive import SPAWN_STYLE
271
+ from fastapi_spawn.validators import questionary_validator, validate_project_name
272
+ project_name = questionary.text(
273
+ "Project name:",
274
+ validate=questionary_validator(validate_project_name),
275
+ style=SPAWN_STYLE,
276
+ ).unsafe_ask()
277
+ assert project_name is not None
250
278
  if preset == "basic":
251
279
  config = ProjectConfig(
252
280
  project_name=project_name,
@@ -320,13 +348,34 @@ def start(
320
348
  force=force,
321
349
  )
322
350
  else:
323
- rprint(f"[bold red]✗ Error:[/bold red] Unknown preset '{preset}'. Available presets: basic, full-local, full")
351
+ rprint(f"[bold red]✗ Error:[/bold red] Unknown preset '{preset}'. Available presets: basic, full-local, full, custom")
324
352
  raise typer.Exit(1)
325
353
 
326
354
  _print_summary(config)
327
355
 
356
+ import questionary
357
+ from fastapi_spawn.interactive import SPAWN_STYLE
358
+
359
+ use_current = questionary.confirm(
360
+ "Do you want to generate files directly in the current directory?", default=False, style=SPAWN_STYLE
361
+ ).unsafe_ask()
362
+
363
+ if use_current:
364
+ output_dir = Path(".")
365
+ # Check if directory is not empty
366
+ import os
367
+ if os.listdir("."):
368
+ confirm = questionary.confirm(
369
+ "Current directory is not empty. This may overwrite files! Proceed?", default=False, style=SPAWN_STYLE
370
+ ).unsafe_ask()
371
+ if not confirm:
372
+ rprint("[yellow]Aborted.[/yellow]")
373
+ raise typer.Exit()
374
+ else:
375
+ output_dir = output / config.project_name
376
+
328
377
  try:
329
- generator = ProjectGenerator(config, output)
378
+ generator = ProjectGenerator(config, output_dir)
330
379
  project_path = generator.generate()
331
380
  rprint(f"\n[bold green]✓ Project created:[/bold green] {project_path.resolve()}")
332
381
  _print_next_steps(config)
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "fastapi-spawn"
7
- version = "0.4.25"
7
+ version = "0.4.26"
8
8
  description = "A powerful CLI tool to scaffold production-ready FastAPI projects with flexible database, auth, broker, and deployment options."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
File without changes