Skip to main content

An utils package for fastapi

Project description

Fastapi Helpers

This pip packages will help you to make your life easier when working with fastapi and ormar.

For installing this package:

pip install fastapi-helpers

If you need a default settings for your app, it includes an implemntation BaseSettings of pydantic.

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 implemntation a colored console, and in prod envs it will log to aws with the help of watchtower.

from fastapi_helpers import DefaultLogger
from .config import settings

logger = DefaultLogger("your-app-name", settings)

If you need to connect to a db super fast, the only thing you need to do is to:

from fastapi_helpers import DbConfig
from core.config import settings
from core.logger import logger

db_config = DbConfig(settings, logger)

The are other tools for making the usage of ormar and fastapi even easier.

I would realy like to make this tools bigger, but I´m looking for help for documenting this package.

Happy codding!

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

fastapi_helpers-0.2.3.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

fastapi_helpers-0.2.3-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_helpers-0.2.3.tar.gz.

File metadata

  • Download URL: fastapi_helpers-0.2.3.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for fastapi_helpers-0.2.3.tar.gz
Algorithm Hash digest
SHA256 11521b0bf97d366cdd502c7873f836b444667cca4dd2bee2d379d7afac79480a
MD5 54a78a2023a3e17ca5e430aca4f1746a
BLAKE2b-256 2b9184a9d6d78bce3d30d65fb3a8cbedb831d4fbf9448ec80d4fbcc2f5c903fe

See more details on using hashes here.

File details

Details for the file fastapi_helpers-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_helpers-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fcd65a84e6cb8c275164b0be924b0563199cd1656b0e0160f0d7373c56e1fe94
MD5 9ef2701614e79338e010567bc9f0ba7f
BLAKE2b-256 7f140446f9e10fb6d0e09160034d8a3f9707ab796762c8dfbbf7acce4111c158

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page