General utilities to be use in my base-fastapi template. Why ZOG? It's sound like joke and look like zoo.
Readme
Utilities to use in my base-api project template. https://github.com/tienhm0202/base-fastapi/
Why ZOG? Because I can't named it as utils
only, so I have to add a prefix.
ZOG sounds like joke
and looks like zoo
. I found that funny enough to use.
$ pip install zogutils
from zogutils import secret
secret.unique_id(8, "ID_")
# return: ID_a7uFg9k0
from zogutils import package_name
package_name.shorten("company.scope.modules.Function", 9)
# return: (something like) c.s.m.Function - depends on max length
from zogutils import middlewares
from your.app import settings, fastapi_app
middlewares.init_app(fastapi_app, settings)
# Sentry
SENTRY_DSN: Optional[HttpUrl] = None
SENTRY_INCLUDE: Optional[List[str]] = ["src"]
SENTRY_SAMPLE_RATE: Optional[float] = 0.5
# CSRF
SECURITY_CSRF: bool = False
# Rate limit
RATE_LIMIT: int = 100
RATE_LIMIT_TIME_SPAN: int = 30
RATE_LIMIT_BLOCK_DURATION: int = 300
# Prometheus
PROMETHEUS_ENABLE: bool = True
PROMETHEUS_PATH: str = "/metrics/"
# Cors
BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = []
FAQs
General utilities to be use in my base-fastapi template. Why ZOG? It's sound like joke and look like zoo.
We found that zogutils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.