Environment application configuration
Project description
Configuration Fetcher v0.0.5
Common code for interacting with dev environs and for deployed AWS 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.0.5.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for app_confetti-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2aba0720481edf7ba67dd8b848969839d629656f8bbd1a9bcf2ea5b9af07d2e8 |
|
MD5 | 5a07951b0e6539a51360580f51bf4d6a |
|
BLAKE2b-256 | 203cbaba2a673af64c361c583dc15e86da64aedb92c984efeda9e918f233936a |