Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/finalsa/fastapi-helpers
FastAPI helpers used by the team
https://github.com/finalsa/fastapi-helpers
crud fastapi logging middleware ormar python python3 routes security
Last synced: about 1 month ago
JSON representation
FastAPI helpers used by the team
- Host: GitHub
- URL: https://github.com/finalsa/fastapi-helpers
- Owner: finalsa
- License: mit
- Created: 2021-09-17T00:38:07.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-12T05:36:11.000Z (11 months ago)
- Last Synced: 2024-09-29T02:21:44.813Z (about 2 months ago)
- Topics: crud, fastapi, logging, middleware, ormar, python, python3, routes, security
- Language: Python
- Homepage:
- Size: 104 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Fastapi Helpers
This pip packages will help you to make your life easier when working with fastapi and ormar.
For installing this package:
```bash
pip install fastapi-helpers
```If you need a default settings for your app, it includes an implementation BaseSettings of pydantic.
```python
from fastapi_helpers import DefaultSettings
from utils import env_path
from typing import Optionalclass Settings(DefaultSettings):
app_name = "your-app-name"
redis_url: Optional[str] = 'redis://localhost:6379'
version: Optional[str] = '1.0.0.0'
port: Optional[str] = "8000"
env: Optional[str] = "dev" #dev, test, prodsettings = Settings(env_path)
```If you need a logger, it includes an implementation a colored console, and in prod envs it will log to aws with the help of watchtower.
```python
from fastapi_helpers import DefaultLogger
from .config import settingslogger = DefaultLogger("your-app-name", settings)
```If you need to connect to a db superfast, the only thing you need to do is to:
```python
from fastapi_helpers import DbConfig
from core.config import settings
from core.logger import loggerdb_config = DbConfig(settings, logger)
```There are other tools for making the usage of ormar and fastapi even easier.
I would really like to make this tools bigger, but I´m looking for help for documenting this package.
Happy codding!