Environment application configuration
Project description
Configuration Fetcher v0.3.0
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.3.0.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file app_confetti-0.3.0.tar.gz
.
File metadata
- Download URL: app_confetti-0.3.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.9 Linux/6.1.7-zen1-1-zen
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c697fdebed4c378e0cec969229a918a78ba3cdfeedf677d73752ee10ab16813 |
|
MD5 | 2012d10dbf9cc6e1fb8461956085dfed |
|
BLAKE2b-256 | a9252a0de6d4b8bb8d66da9524d551dd87128206832f2ed9a295acdb667865ea |
File details
Details for the file app_confetti-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: app_confetti-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.9 Linux/6.1.7-zen1-1-zen
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fe94bfe685a0f2529232ead860702224bbe532c6231c1e8d13e77985de9155c |
|
MD5 | 7853aa4ab59b6acda3b873104a794d17 |
|
BLAKE2b-256 | d8c9c72ea72ffffc2c767422941091f7d3bb75e92f0192afbe91c3a80d63bf45 |