Um pacote para gerar projetos FastAPI com estrutura básica.
Project description
Fast Hard
Fast Hard is a Python package that generates a FastAPI project with a basic structure, similar to create-react-app for React. It sets up a ready-to-use FastAPI application with essential dependencies, folder structure, and configurations.
Features
- Generates a FastAPI project with a standard folder structure.
- Installs essential dependencies:
- FastAPI
- Uvicorn
- SQLAlchemy
- Pytest
- Email-validator
- Alembic (for database migrations)
- Includes a basic
.envfile for environment variables. - Sets up Alembic for database migrations.
- Provides a simple
main.pywith a "Hello World" endpoint. - New commands for flexible folder structure:
fast-hard create_mvc <project_name>: Creates a project and adds an MVC folder structure.fast-hard create_use_cases <project_name>: Creates a project and adds a folder structure for use cases.
Installation
You can install fast_hard via pip:
pip install fast_hard
Usage
Create a New Project
fast-hard create_project my_new_project
This will generate a new FastAPI project with the following structure:
my_new_project/
├── app/
│ ├── __init__.py
│ ├── main.py
│ ├── models/
│ ├── schemas/
│ ├── routes/
│ ├── tests/
│ ├── config/
│ └── alembic/
│ ├── env.py
│ ├── script.py.mako
│ └── versions/
├── requirements.txt
├── .env
├── .gitignore
├── alembic.ini
└── README.md
Add an MVC Structure
fast-hard create_mvc my_new_project
If the project does not exist, it will first create the project and then add the following folders under the app directory:
my_new_project/
├── app/
│ ├── controllers/
│ ├── views/
│ └── models/
Add a Use Case Structure
fast-hard create_use_cases my_new_project
If the project does not exist, it will first create the project and then add the following folder under the app directory:
my_new_project/
├── app/
│ ├── use_cases/
Run the Project
cd my_new_project
pip install -r requirements.txt
cd app
uvicorn main:app --reload
Open your browser at:
http://127.0.0.1:8000/
You should see the message:
{
"Hello": "World"
}
Link PyPI
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 fast_hard-0.1.2.tar.gz.
File metadata
- Download URL: fast_hard-0.1.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6e9cb9f007af0cbb146affec7e66d4bcd192c267787a67829f1d3756fb203fa
|
|
| MD5 |
df9c9f225666de9ffd852987b043da77
|
|
| BLAKE2b-256 |
04a0c20c1936b3a40fbe4f37706fd2827f201ea5c0f2fba5c12984b3a1d87529
|
File details
Details for the file fast_hard-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fast_hard-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18d9dd18726375c99c75ff89dd79d42a14371633a9d6ad53b6663876c2dadbb7
|
|
| MD5 |
faaee9db3b5fc404734b7c770fb9fca1
|
|
| BLAKE2b-256 |
7a1c92cfc037872c025ad45c94fcdfee0437c54a89f2d989797c5b1d83e28c82
|