A command-line tool to scaffold FastAPI projects, inspired by vitejs.
Project description
scallpy
A command-line tool to scaffold FastAPI projects, inspired by vitejs.
Overview
scallpy helps you quickly set up new FastAPI projects with sensible defaults, providing both a "clean" and a "structured" project template.
Installation
For Users
Requirements: Python 3.10 or higher.
To install scallpy and use it to create new projects, it's recommended to use pipx. This ensures scallpy and its dependencies are installed in an isolated environment without affecting your global Python packages.
pipx install scallpy
After installation, you can use the scallpy command globally.
For Developers (Contributing to scallpy)
If you want to contribute to scallpy or modify its source code:
- Clone the repository:
git clone https://github.com/jara505/fastapi-scallfolding.git cd fastapi-scallfolding
- Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
- Install in editable mode with dev dependencies:
pip install -e ".[dev]"
- Run tests:
pytest
Note: For stability, use Poetry 1.x (e.g., pip install poetry==1.8.3) when working with generated projects. Poetry 2.x may have compatibility issues.
Usage
scallpy provides a create command to generate new FastAPI projects.
Interactive Mode
To create a project interactively, simply run:
scallpy create
The CLI will guide you through selecting a project name, type, and other options.
Non-Interactive Mode (with parameters)
You can also provide parameters directly to bypass interactive prompts, which is useful for scripting or quick setups.
scallpy create --name <project-name> --type <project-type> [--use-db] [--use-orm] [--path <output-path>]
Parameters:
--nameor-n: The name of your new FastAPI project. This will also be the name of the directory created for your project.--typeor-t: The type of project structure to generate.clean: A minimal FastAPI project with a singlemain.pyfile.structured: A more organized FastAPI project with separate modules for API routes, core configuration, and models.
--use-db(Optional): Include database support in the project. Use as a flag (e.g.,--use-db).--use-orm(Optional): Include ORM (Object-Relational Mapper) support in the project. Use as a flag (e.g.,--use-orm).--pathor-p(Optional): The directory where the new project folder will be created. If not specified, the project will be created in the current working directory. If.is provided, the project folder will be created inside the current directory.
Example:
scallpy create --name my-awesome-api --type structured --path ./projects
Running Your Generated Project
After scallpy creates your project, it will provide specific instructions. Generally, the steps are:
- Navigate into your new project directory:
cd <your-project-name>
- Install dependencies using Poetry:
poetry install - Run the FastAPI development server:
- For
cleanprojects:poetry run uvicorn <your-project-name>.main:app --reload
- For
structuredprojects:poetry run uvicorn <your-project-name>.main:app --reload
<your-project-name>with the actual name you gave your project). - For
Your FastAPI application will typically be available at http://127.0.0.1:8000.
Contributing
We welcome contributions! Please feel free to open issues or submit pull requests.
Testing
To run the test suite:
pytest
Ensure all tests pass before submitting pull requests.
License
This project is licensed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scallpy-0.1.0.tar.gz.
File metadata
- Download URL: scallpy-0.1.0.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd7b9a6028ea4faf51a5866da4fbfa247dd42723d81665d10c223ebb9a9de4bf
|
|
| MD5 |
71f0daaf1051c350265476bc38381fea
|
|
| BLAKE2b-256 |
a72de7ac18554934736014e6b401063bbe2213f74a17c07ed1b1ba7931f0d01f
|
File details
Details for the file scallpy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scallpy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52d3030ef34561c5df92c5225cafbcccc199e957af2b01bf64ed220477aaa8bf
|
|
| MD5 |
4361085ab490b4392220d8c9b303d81f
|
|
| BLAKE2b-256 |
6c0faa3c310d06225ca0c43652bf2fe2f393a7400913b54e7a0c198db9a83bd0
|