No project description provided
Project description
FastAPI Boiler
fastapi-boiler
is a command-line tool for quickly generating a boilerplate FastAPI application. It streamlines the setup process, allowing you to get started with your FastAPI project quickly and efficiently.
Features
- FastAPI boilerplate generation
- Dynamic project naming
- Customizable project metadata (author, description)
- Automatic Docker and Poetry configuration updates
Installation
Install fastapi-boiler
using pip.
pip install fastapi-boiler
Usage
To create a new FastAPI application, run:
fastapi-boiler
You will be prompted to enter your app directory, description and email, which will be used to update the boilerplate configuration files.
Example
$ fastapi-boiler
Project directory: testing
Python version (3.10, 3.11, etc.): 3.11
Description: test
Author: john.doe@mail.com
Copied template from fastapi_boilerplate to testing
Updated pyproject.toml with the new project details
Updated docker-compose.yml with the new app name
New FastAPI app created at testing
Configuration
To make fastapi-boiler
available globally, you may need to add the installation path to your shell configuration file.
Bash
Add the following line to your ~/.bashrc
file:
export PATH="$HOME/.local/bin:$PATH"
Then, reload the ~/.bashrc
file:
source ~/.bashrc
Zsh
Add the following line to your ~/.zshrc
file:
export PATH="$HOME/.local/bin:$PATH"
Then, reload the ~/.zshrc
file:
source ~/.zshrc
Project Structure
After running the fastapi-boiler
command, your new FastAPI application will have the following structure:
my_new_app/
├── app/
│ └── v1/
│ ├── health/
│ │ ├── __init__.py
│ │ ├── router.py
│ │ └── views.py
│ ├── __init__.py
│ └── views.py
├── core/
│ ├── __init__.py
│ ├── database.py
│ ├── exception_handlers.py
│ ├── exceptions.py
│ ├── extensions.py
│ ├── factory.py
│ └── middlewares.py
├── settings/
│ └── config.py
├── tests/
│ └── __init__.py
├── .gitignore
├── docker-compose.yml
├── Dockerfile
├── pyproject.toml
├── README.md
├── requirements.txt
└── server.py
Files and Directories
- app/: Contains the main application code.
- v1/: API version 1.
- health/: Health check endpoints.
- init.py: Package initializer.
- router.py: Router configuration.
- views.py: Endpoint views.
- v1/: API version 1.
- core/: Core functionality and utilities.
- database.py: Database configuration.
- exception_handlers.py: Custom exception handlers.
- exceptions.py: Custom exception definitions.
- extensions.py: Extensions and third-party integrations.
- factory.py: Application factory.
- middlewares.py: Custom middlewares.
- settings/: Configuration settings.
- config.py: Main configuration file.
- tests/: Unit and integration tests.
- docker-compose.yml: Docker Compose configuration.
- Dockerfile: Dockerfile for containerizing the application.
- pyproject.toml: Poetry configuration file.
- README.md: Project readme file.
- requirements.txt: Project dependencies.
- server.py: Entry point for running the application.
- create_app.py: Script for creating a new FastAPI project.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
License
This project is licensed under the MIT License. See the LICENSE file for more information.
Contact
For questions or support, please contact ali.heyderli@gmail.com.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file fastapi_boiler-0.1.3.tar.gz
.
File metadata
- Download URL: fastapi_boiler-0.1.3.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b47b518beab08c8a638b94b15888ce962c7231ad4e1c55901368e25323e1a184 |
|
MD5 | 0217296ec2f1cf75dd1ead28e45af235 |
|
BLAKE2b-256 | f7650c61bd0f8ed340e9e2a1cbbe7281fba5252a47f888658ce8858cf25a7d27 |
File details
Details for the file fastapi_boiler-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: fastapi_boiler-0.1.3-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 418a1f3f2d3ef8cbc4fd1cbe7415239cf47d0d829bd6f0c53ed0f84119452c73 |
|
MD5 | 6043f19ab301514418e99f3b28496b7b |
|
BLAKE2b-256 | 2792ff5170e85eabb230f73730af829b2642ffd17c1fd6c6fc478507e94d94ac |