Fast-Craftsmanship CLI Tool
Fast-Craftsmanship is a CLI tool designed to streamline the management and scaffolding of FastAPI projects. It follows best practices to help you create a clean, consistent, and scalable project structure, whether you are starting a new project or adding features to an existing one.
📚 Documentation: https://fguedes90.github.io/fast-craftsmanship/
Features
- Project Initialization: Quickly scaffold a new FastAPI project with a pre-defined structure.
- DDD Structure Generation: Generate files for domain, service, API, repository, and tests following Domain-Driven Design principles.
- Database Migrations: Easily create, apply, and rollback database migrations.
- Code Verification: Run type checking, linting, tests, and formatting checks using a single command.
- Extensibility: Easily extend the CLI with custom templates and commands.
Installation
From PyPI
If the package is available on PyPI:
pip install fast-craftsmanship
From Source
Clone the repository and install in editable mode:
git clone <repository-URL>
cd fcship
pip install -e ".[dev]"
Usage
After installation, use the CLI by invoking craftsmanship followed by the desired command.
Basic Commands
-
Project Initialization
craftsmanship project init <project_name>
-
Domain Generation
craftsmanship domain create <domain_name>
-
Service Layer Generation
craftsmanship service create <service_name>
-
API Endpoint Generation
craftsmanship api create <api_name>
-
Repository Implementation
craftsmanship repo create <repository_name>
-
Test File Generation
craftsmanship test create <unit|integration> <test_name>
-
Database Migrations
craftsmanship db migration <migration_name> craftsmanship db migrate craftsmanship db rollback
-
Code Verification
craftsmanship verify <all|type|lint|test|format>
Additional
- Version Information
craftsmanship --version
Project Structure
When a new project is initialized, the following structure is created:
├── api/ # API endpoints and schemas
├── domain/ # Domain entities and interfaces
├── service/ # Service layer implementation
├── infrastructure/ # Database and external services
└── tests/ # Test suites (unit and integration)
Development
Setup
# Clone the repository
git clone <repository-URL>
cd fast-craftsmanship
# Install in development mode
make dev-install
Available Commands
Run make help to see all available commands:
clean Clean up build artifacts
check-all Run linting and tests
dev-install Install the package with development dependencies
docs Generate documentation (placeholder - add your documentation command)
format Format code with ruff
help Show this help
install Install the package
lint Lint code with ruff
release Create a new release (placeholder - add your release commands)
test Run all tests
test-cov Run tests with coverage report
Releasing New Versions
This project uses GitHub Actions for CI/CD with semantic versioning:
- To create a new release, go to the GitHub Actions tab and run the "Bump Version" workflow
- Choose the version type (patch, minor, or major)
- The workflow will:
- Update the version in pyproject.toml
- Commit and push the changes
- Create a tag for the new version
- Trigger the release workflow
Documentation
Full documentation is available at https://fguedes90.github.io/fast-craftsmanship/.
Our documentation includes:
- Detailed command references
- Tutorials and guides
- Architecture explanations
- Development workflows
- Best practices for functional programming
To run the documentation locally:
# Install the docs dependencies
pip install -e ".[docs]"
# Serve the documentation
mkdocs serve
Contributing
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/my-feature - Commit your changes.
- Push your branch:
git push origin feature/my-feature - Open a pull request describing your feature.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
If you encounter issues or have suggestions, please open an issue in the repository.
Happy coding with Fast-Craftsmanship! 🚀
Metadata
Release files for fast-craftsmanship 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fast_craftsmanship-0.2.6.tar.gz | 81.3 kB | Without provenance | Details for fast_craftsmanship-0.2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fast_craftsmanship-0.2.6-py3-none-any.whl | Python 3 | none | any | Details for fast_craftsmanship-0.2.6-py3-none-any.whl |
Total release size: 181.9 kB
Release files / fast_craftsmanship-0.2.6.tar.gz
| Download URL | fast_craftsmanship-0.2.6.tar.gz |
|---|---|
| Size | 81.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
469d4b9d19cfb3eed67c39dfa83583fa51e78dc71554d3d830d192d2fc60e70a
|
|
BLAKE2b-256 checksum How to use checksums |
695c250c324d30fec132e176c574a10b93faa43148faa1c2ce7d30b96ca0eddc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / fast_craftsmanship-0.2.6-py3-none-any.whl
| Download URL | fast_craftsmanship-0.2.6-py3-none-any.whl |
|---|---|
| Size | 100.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd8a7374e38d2c248cf5e6145399b894f5c26e37a1e1f67f441d7ac8aaa4214c
|
|
BLAKE2b-256 checksum How to use checksums |
6922648c1c3559e8255e22a709ce096cc15d248f20dfa72c1d870754be2047b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for fast-craftsmanship 0.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.