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.1.2.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

fastapi_helpers-0.1.2-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_helpers-0.1.2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for fastapi_helpers-0.1.2.tar.gz
Algorithm Hash digest
SHA256 91e5bbfd75530bf77cc98689dbf0fb14ed05b46a4cdc2cc07b3ec152c80fefa2
MD5 8dd165c3df6f506e6b22d572962043a3
BLAKE2b-256 38b53e692b2e24c4023865d04a401d36ebdff22165e469cb5917794f16c192e0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastapi_helpers-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for fastapi_helpers-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b8ca8161ce844cb88f515f623ed351e5beda84be8dd6efbb12993e7977a2b9ed
MD5 f22e574ffd548a471b1cc6fa75ee6f4e
BLAKE2b-256 f6f9e6d8fdaa66449e5f8f0d7d5c6cbc0ce277758c2ddc2653d15b0f58d9e284

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