Environment application configuration
Project description
Configuration Fetcher v0.1.2
Common code for interacting with dev environs, deployed environs with ENV vars or for deployed AWS (optional extra) environs.
Config class
from app_confetti import util
@dataclasses.dataclass(frozen=True)
class Config:
required_key: str = util.env("REQUIRED_KEY")
logging_level: str = util.env("LOGGING_LEVEL:INFO")
sentry_dsn: int = util.env("SENTRY_DSN:__NONE__")
debug: bool = util.env("DEBUG:__FALSE__")
@property
def logging_config(self):
return {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"default": {
"format": "[%(asctime)s][%(name)s][%(levelname)s]: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
},
"handlers": {
"default": {
"class": "logging.StreamHandler",
"level": self.logging_level,
"formatter": "default",
},
"sentry": {
"level": "ERROR",
"class": "raven.handlers.logging.SentryHandler",
"dsn": self.sentry_dsn,
},
},
"loggers": {
"": {
"handlers": ["default", "sentry"],
"level": self.logging_level,
"propagate": True,
},
"raven": {
"handlers": ["default"],
"level": "WARNING",
"propagate": True,
},
},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
app_confetti-0.1.2.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for app_confetti-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 094a0a783b8114d1fdf7474615f3114c2def90e02fc6c070a5744f52879b877c |
|
MD5 | 38a2bd4fe5ed6daa82274eefc16408a7 |
|
BLAKE2b-256 | 9a5a45951679dd86f16dcc343b2b00fdb18122109281dd5643cac2d8fae00d5f |