Metadata-Version: 2.1
Name: fastapi-helpers
Version: 0.3.0
Summary: An utils package for fastapi
Home-page: https://github.com/finalsa/fastapi-utils
Author: Luis Jimenez
Author-email: luis@finalsa.com
License: MIT
Keywords: fastapi,sqlalchemy,ormar,pydantic
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: argon2-cffi>=23.1.0
Requires-Dist: aiosqlite>=0.19.0
Requires-Dist: ormar>=0.12.2
Requires-Dist: pydantic>=1.10.8
Requires-Dist: fastapi>=0.105.0
Requires-Dist: fastapi-better-logger>=0.0.5
Requires-Dist: typing_extensions>=4.9.0
Requires-Dist: watchtower>=3.0.0
Requires-Dist: boto3>=1.20.3
Provides-Extra: postgresql
Requires-Dist: asyncpg; extra == "postgresql"
Requires-Dist: psycopg2-binary; extra == "postgresql"
Provides-Extra: mysql
Requires-Dist: aiomysql; extra == "mysql"
Requires-Dist: pymysql; extra == "mysql"
Provides-Extra: sqlite
Requires-Dist: aiosqlite; extra == "sqlite"
Provides-Extra: orjson
Requires-Dist: orjson; extra == "orjson"

# 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 Optional

class 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, prod


settings = 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 settings

logger = 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 logger

db_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!
