plinth-cli 1.0.0__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.
- plinth_cli-1.0.0/PKG-INFO +166 -0
- plinth_cli-1.0.0/README.md +131 -0
- plinth_cli-1.0.0/docs/developer-guide.md +523 -0
- plinth_cli-1.0.0/docs/plinth-complete-guide.md +315 -0
- plinth_cli-1.0.0/pyproject.toml +68 -0
- plinth_cli-1.0.0/requirements.txt +25 -0
- plinth_cli-1.0.0/src/plinth/__init__.py +3 -0
- plinth_cli-1.0.0/src/plinth/__main__.py +6 -0
- plinth_cli-1.0.0/src/plinth/cli.py +239 -0
- plinth_cli-1.0.0/src/plinth/commands/__init__.py +15 -0
- plinth_cli-1.0.0/src/plinth/commands/add.py +235 -0
- plinth_cli-1.0.0/src/plinth/commands/doctor.py +158 -0
- plinth_cli-1.0.0/src/plinth/commands/init.py +179 -0
- plinth_cli-1.0.0/src/plinth/commands/list.py +78 -0
- plinth_cli-1.0.0/src/plinth/commands/remove.py +60 -0
- plinth_cli-1.0.0/src/plinth/config.py +96 -0
- plinth_cli-1.0.0/src/plinth/exceptions.py +77 -0
- plinth_cli-1.0.0/src/plinth/injector.py +154 -0
- plinth_cli-1.0.0/src/plinth/logger.py +73 -0
- plinth_cli-1.0.0/src/plinth/packages.py +98 -0
- plinth_cli-1.0.0/src/plinth/state.py +164 -0
- plinth_cli-1.0.0/src/plinth/templates/base/.env.example +35 -0
- plinth_cli-1.0.0/src/plinth/templates/base/.gitignore +63 -0
- plinth_cli-1.0.0/src/plinth/templates/base/README.md.j2 +91 -0
- plinth_cli-1.0.0/src/plinth/templates/base/pyproject.toml.j2 +49 -0
- plinth_cli-1.0.0/src/plinth/templates/base/src/__init__.py +1 -0
- plinth_cli-1.0.0/src/plinth/templates/base/src/api/__init__.py +1 -0
- plinth_cli-1.0.0/src/plinth/templates/base/src/api/v1/__init__.py +0 -0
- plinth_cli-1.0.0/src/plinth/templates/base/src/api/v1/health.py +47 -0
- plinth_cli-1.0.0/src/plinth/templates/base/src/config.py.j2 +52 -0
- plinth_cli-1.0.0/src/plinth/templates/base/src/core/__init__.py +1 -0
- plinth_cli-1.0.0/src/plinth/templates/base/src/core/config.py.j2 +52 -0
- plinth_cli-1.0.0/src/plinth/templates/base/src/core/database.py.j2 +34 -0
- plinth_cli-1.0.0/src/plinth/templates/base/src/core/registry.py +20 -0
- plinth_cli-1.0.0/src/plinth/templates/base/src/main.py.j2 +61 -0
- plinth_cli-1.0.0/src/plinth/templates/base/src/models/__init__.py +0 -0
- plinth_cli-1.0.0/src/plinth/templates/base/tests/__init__.py +0 -0
- plinth_cli-1.0.0/src/plinth/templates.py +193 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: plinth-cli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A high-performance, developer-first CLI scaffolding tool for FastAPI
|
|
5
|
+
Project-URL: Homepage, https://github.com/cybertycoon/plinth
|
|
6
|
+
Project-URL: Documentation, https://github.com/cybertycoon/plinth/blob/main/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/cybertycoon/plinth.git
|
|
8
|
+
Project-URL: Issues, https://github.com/cybertycoon/plinth/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/cybertycoon/plinth/blob/main/CHANGELOG.md
|
|
10
|
+
Author-email: Silas Okanlawon <okanlawonsilas@gmail.com>
|
|
11
|
+
License: MIT
|
|
12
|
+
Keywords: api,cli,fastapi,framework,generator,scaffolding,web
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Classifier: Typing :: Typed
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Requires-Dist: jinja2>=3.1.0
|
|
28
|
+
Requires-Dist: libcst>=1.0.0
|
|
29
|
+
Requires-Dist: pydantic-settings>=2.0.0
|
|
30
|
+
Requires-Dist: pydantic>=2.0.0
|
|
31
|
+
Requires-Dist: rich>=13.0.0
|
|
32
|
+
Requires-Dist: toml>=0.10.2
|
|
33
|
+
Requires-Dist: typer[all]>=0.12.0
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# 🪨 Plinth
|
|
37
|
+
|
|
38
|
+
> A high-performance, developer-first CLI scaffolding tool for FastAPI
|
|
39
|
+
|
|
40
|
+
## Overview
|
|
41
|
+
|
|
42
|
+
Plinth is a dynamic CLI scaffolding engine for FastAPI that provides a rock-solid foundation for modern web APIs. Unlike static boilerplates, Plinth generates code based on your specific needs and allows you to evolve your project over time.
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- 🚀 **Fast Project Initialization** - Create a new FastAPI project in seconds
|
|
47
|
+
- 🔧 **Modular Architecture** - Add features (Auth, Redis, Database) as needed
|
|
48
|
+
- 📝 **Type-Safe** - Built with Pydantic and Typer
|
|
49
|
+
- 🎨 **Beautiful CLI** - Rich terminal output with progress bars
|
|
50
|
+
- 🔒 **Safe Code Injection** - LibCST ensures safe AST modifications
|
|
51
|
+
- 📦 **uv Integration** - Native support for fast Python package management
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
### From Source
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Clone the repository
|
|
59
|
+
git clone <repository-url>
|
|
60
|
+
cd plinth
|
|
61
|
+
|
|
62
|
+
# Install dependencies
|
|
63
|
+
pip install -r requirements.txt
|
|
64
|
+
|
|
65
|
+
# Install in development mode
|
|
66
|
+
pip install -e .
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Using pip
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pip install plinth
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Quick Start
|
|
76
|
+
|
|
77
|
+
### Create a Basic Project
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
plinth init my-app
|
|
81
|
+
cd my-app
|
|
82
|
+
uv run uvicorn src.main:app --reload
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Create with Database
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
plinth init my-api --db postgres --auth jwt --redis
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Add Features Later
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
cd my-api
|
|
95
|
+
|
|
96
|
+
# Add Redis caching
|
|
97
|
+
plinth add redis
|
|
98
|
+
|
|
99
|
+
# Add JWT authentication
|
|
100
|
+
plinth add auth-jwt
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Commands
|
|
104
|
+
|
|
105
|
+
| Command | Description |
|
|
106
|
+
| ------------------------ | ------------------------------------ |
|
|
107
|
+
| `plinth init <name>` | Initialize a new FastAPI project |
|
|
108
|
+
| `plinth add <module>` | Add a feature module |
|
|
109
|
+
| `plinth remove <module>` | Remove a feature module |
|
|
110
|
+
| `plinth list` | List installed and available modules |
|
|
111
|
+
| `plinth doctor` | Run diagnostics on the project |
|
|
112
|
+
|
|
113
|
+
## Available Modules
|
|
114
|
+
|
|
115
|
+
- **postgres** - PostgreSQL database with asyncpg driver
|
|
116
|
+
- **mysql** - MySQL database with aiomysql driver
|
|
117
|
+
- **sqlite** - SQLite database with aiosqlite driver
|
|
118
|
+
- **redis** - Redis caching and session storage
|
|
119
|
+
- **auth-jwt** - JWT-based authentication
|
|
120
|
+
- **auth-session** - Session-based authentication
|
|
121
|
+
|
|
122
|
+
## Project Structure
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
my-app/
|
|
126
|
+
├── .plinth.json # State tracking
|
|
127
|
+
├── pyproject.toml # Dependencies
|
|
128
|
+
├── src/
|
|
129
|
+
│ ├── main.py # FastAPI entry point
|
|
130
|
+
│ ├── core/
|
|
131
|
+
│ │ ├── config.py # Settings
|
|
132
|
+
│ │ └── registry.py # Router registry
|
|
133
|
+
│ └── api/
|
|
134
|
+
│ └── v1/
|
|
135
|
+
│ └── health.py
|
|
136
|
+
└── tests/
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Development
|
|
140
|
+
|
|
141
|
+
### Running Tests
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
pytest
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Code Quality
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Format code
|
|
151
|
+
ruff format .
|
|
152
|
+
|
|
153
|
+
# Lint code
|
|
154
|
+
ruff check .
|
|
155
|
+
|
|
156
|
+
# Type check
|
|
157
|
+
mypy src/
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Documentation
|
|
161
|
+
|
|
162
|
+
See the [complete guide](docs/plinth-complete-guide.md) for detailed documentation.
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
MIT License
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# 🪨 Plinth
|
|
2
|
+
|
|
3
|
+
> A high-performance, developer-first CLI scaffolding tool for FastAPI
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Plinth is a dynamic CLI scaffolding engine for FastAPI that provides a rock-solid foundation for modern web APIs. Unlike static boilerplates, Plinth generates code based on your specific needs and allows you to evolve your project over time.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- 🚀 **Fast Project Initialization** - Create a new FastAPI project in seconds
|
|
12
|
+
- 🔧 **Modular Architecture** - Add features (Auth, Redis, Database) as needed
|
|
13
|
+
- 📝 **Type-Safe** - Built with Pydantic and Typer
|
|
14
|
+
- 🎨 **Beautiful CLI** - Rich terminal output with progress bars
|
|
15
|
+
- 🔒 **Safe Code Injection** - LibCST ensures safe AST modifications
|
|
16
|
+
- 📦 **uv Integration** - Native support for fast Python package management
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
### From Source
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Clone the repository
|
|
24
|
+
git clone <repository-url>
|
|
25
|
+
cd plinth
|
|
26
|
+
|
|
27
|
+
# Install dependencies
|
|
28
|
+
pip install -r requirements.txt
|
|
29
|
+
|
|
30
|
+
# Install in development mode
|
|
31
|
+
pip install -e .
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Using pip
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install plinth
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
### Create a Basic Project
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
plinth init my-app
|
|
46
|
+
cd my-app
|
|
47
|
+
uv run uvicorn src.main:app --reload
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Create with Database
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
plinth init my-api --db postgres --auth jwt --redis
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Add Features Later
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cd my-api
|
|
60
|
+
|
|
61
|
+
# Add Redis caching
|
|
62
|
+
plinth add redis
|
|
63
|
+
|
|
64
|
+
# Add JWT authentication
|
|
65
|
+
plinth add auth-jwt
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Commands
|
|
69
|
+
|
|
70
|
+
| Command | Description |
|
|
71
|
+
| ------------------------ | ------------------------------------ |
|
|
72
|
+
| `plinth init <name>` | Initialize a new FastAPI project |
|
|
73
|
+
| `plinth add <module>` | Add a feature module |
|
|
74
|
+
| `plinth remove <module>` | Remove a feature module |
|
|
75
|
+
| `plinth list` | List installed and available modules |
|
|
76
|
+
| `plinth doctor` | Run diagnostics on the project |
|
|
77
|
+
|
|
78
|
+
## Available Modules
|
|
79
|
+
|
|
80
|
+
- **postgres** - PostgreSQL database with asyncpg driver
|
|
81
|
+
- **mysql** - MySQL database with aiomysql driver
|
|
82
|
+
- **sqlite** - SQLite database with aiosqlite driver
|
|
83
|
+
- **redis** - Redis caching and session storage
|
|
84
|
+
- **auth-jwt** - JWT-based authentication
|
|
85
|
+
- **auth-session** - Session-based authentication
|
|
86
|
+
|
|
87
|
+
## Project Structure
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
my-app/
|
|
91
|
+
├── .plinth.json # State tracking
|
|
92
|
+
├── pyproject.toml # Dependencies
|
|
93
|
+
├── src/
|
|
94
|
+
│ ├── main.py # FastAPI entry point
|
|
95
|
+
│ ├── core/
|
|
96
|
+
│ │ ├── config.py # Settings
|
|
97
|
+
│ │ └── registry.py # Router registry
|
|
98
|
+
│ └── api/
|
|
99
|
+
│ └── v1/
|
|
100
|
+
│ └── health.py
|
|
101
|
+
└── tests/
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Development
|
|
105
|
+
|
|
106
|
+
### Running Tests
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
pytest
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Code Quality
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Format code
|
|
116
|
+
ruff format .
|
|
117
|
+
|
|
118
|
+
# Lint code
|
|
119
|
+
ruff check .
|
|
120
|
+
|
|
121
|
+
# Type check
|
|
122
|
+
mypy src/
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Documentation
|
|
126
|
+
|
|
127
|
+
See the [complete guide](docs/plinth-complete-guide.md) for detailed documentation.
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
MIT License
|