gentem 0.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gentem/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """Gentem - A Python CLI template boilerplate generator."""
2
+
3
+ __version__ = "0.1.0"
gentem/__main__.py ADDED
@@ -0,0 +1,6 @@
1
+ """Entry point for python -m gentem."""
2
+
3
+ from gentem.cli import main
4
+
5
+ if __name__ == "__main__":
6
+ main()
gentem/cli.py ADDED
@@ -0,0 +1,163 @@
1
+ """Main CLI entry point for Gentem."""
2
+
3
+ import typer
4
+
5
+ from gentem import __version__
6
+
7
+ # Explicitly configure typer for better Windows support
8
+ app = typer.Typer(
9
+ name="gentem",
10
+ help="A Python CLI template boilerplate generator",
11
+ add_completion=False,
12
+ no_args_is_help=True,
13
+ )
14
+
15
+
16
+ def version_callback(value: bool) -> None:
17
+ """Print the version of gentem."""
18
+ if value:
19
+ print(f"Gentem version: {__version__}")
20
+ raise typer.Exit(0)
21
+
22
+
23
+ @app.callback(invoke_without_command=True)
24
+ def callback(
25
+ version: bool = typer.Option(
26
+ False,
27
+ "--version",
28
+ "-V",
29
+ help="Show the version and exit.",
30
+ callback=version_callback,
31
+ is_eager=True,
32
+ ),
33
+ ) -> None:
34
+ """A Python CLI template boilerplate generator."""
35
+ pass
36
+
37
+
38
+ @app.command("new")
39
+ def new_command(
40
+ project_name: str = typer.Argument(
41
+ ...,
42
+ help="Name of the project to create.",
43
+ ),
44
+ project_type: str = typer.Option(
45
+ "library",
46
+ "--type",
47
+ "-t",
48
+ help="Project type: library, cli, or script.",
49
+ ),
50
+ author: str = typer.Option(
51
+ "",
52
+ "--author",
53
+ "-a",
54
+ help="Author name for the project.",
55
+ ),
56
+ description: str = typer.Option(
57
+ "",
58
+ "--description",
59
+ "-d",
60
+ help="Description for the project.",
61
+ ),
62
+ license_type: str = typer.Option(
63
+ "mit",
64
+ "--license",
65
+ "-l",
66
+ help="License type: mit, apache, gpl, or none.",
67
+ ),
68
+ dry_run: bool = typer.Option(
69
+ False,
70
+ "--dry-run",
71
+ help="Preview the project structure without creating files.",
72
+ ),
73
+ verbose: bool = typer.Option(
74
+ False,
75
+ "--verbose",
76
+ "-v",
77
+ help="Show verbose output.",
78
+ ),
79
+ ) -> None:
80
+ """Create a new Python project."""
81
+ from gentem.commands.new import create_new_project
82
+
83
+ if verbose:
84
+ print(f"Creating project: {project_name}")
85
+ print(f"Project type: {project_type}")
86
+
87
+ create_new_project(
88
+ project_name=project_name,
89
+ project_type=project_type,
90
+ author=author,
91
+ description=description,
92
+ license_type=license_type,
93
+ dry_run=dry_run,
94
+ verbose=verbose,
95
+ )
96
+
97
+
98
+ @app.command("fastapi")
99
+ def fastapi_command(
100
+ project_name: str = typer.Argument(
101
+ ...,
102
+ help="Name of the FastAPI project to create.",
103
+ ),
104
+ async_mode: bool = typer.Option(
105
+ False,
106
+ "--async",
107
+ "-A",
108
+ help="Use async mode with lifespan.",
109
+ ),
110
+ db_type: str = typer.Option(
111
+ "",
112
+ "--db",
113
+ "-D",
114
+ help="Database type: asyncpg (for async SQLAlchemy).",
115
+ ),
116
+ author: str = typer.Option(
117
+ "",
118
+ "--author",
119
+ "-a",
120
+ help="Author name for the project.",
121
+ ),
122
+ description: str = typer.Option(
123
+ "",
124
+ "--description",
125
+ "-d",
126
+ help="Description for the project.",
127
+ ),
128
+ dry_run: bool = typer.Option(
129
+ False,
130
+ "--dry-run",
131
+ help="Preview the project structure without creating files.",
132
+ ),
133
+ verbose: bool = typer.Option(
134
+ False,
135
+ "--verbose",
136
+ "-v",
137
+ help="Show verbose output.",
138
+ ),
139
+ ) -> None:
140
+ """Create a new FastAPI project with opinionated structure."""
141
+ from gentem.commands.fastapi import create_fastapi_project
142
+
143
+ if verbose:
144
+ print(f"Creating FastAPI project: {project_name}")
145
+ print(f"Async mode: {async_mode}")
146
+ print(f"Database type: {db_type or 'none'}")
147
+
148
+ create_fastapi_project(
149
+ project_name=project_name,
150
+ async_mode=async_mode,
151
+ db_type=db_type,
152
+ author=author,
153
+ description=description,
154
+ dry_run=dry_run,
155
+ verbose=verbose,
156
+ )
157
+
158
+ def main():
159
+ app()
160
+
161
+
162
+ if __name__ == "__main__":
163
+ main()
@@ -0,0 +1 @@
1
+ """Commands package for Gentem."""