simple_dataclass_settings
Simple library on top of dataclasses to create shiny-looking configs from environment variables.
Example usage
import simple_dataclass_settings
@simple_dataclass_settings.settings
class SomeChildSettings:
some_float: float = simple_dataclass_settings.field.float(
var='SOME_FLOAT',
)
@simple_dataclass_settings.settings
class Settings:
some_child: SomeChildSettings
some_string: str = simple_dataclass_settings.field.str(
var='SOME_STRING',
default='test',
)
some_number: int = simple_dataclass_settings.field.int(
var='SOME_NUMBER',
default=69,
)
some_flag: bool = simple_dataclass_settings.field.bool(
var='SOME_FLAG',
default=False,
)
some_list: bool = simple_dataclass_settings.field.str_list(
var='SOME_LIST',
default=['test', 'vars'],
)
settings = simple_dataclass_settings.populate(Settings)
Interface
settings- decorator that converts a class to the settings class (just a regular frozen (and slotted) dataclass)field- class that creates a special setting field object (that holds metadata about environment variables and its processing)populate- function that creates an instance of passed settings classshow- function that shows a list of environment variables used by the passed classread_envfile- function that populates variables from the env file
Metadata
Release files for simple-dataclass-settings 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simple_dataclass_settings-0.0.5.tar.gz | 5.0 kB | Without provenance | Details for simple_dataclass_settings-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simple_dataclass_settings-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for simple_dataclass_settings-0.0.5-py3-none-any.whl |
Total release size: 10.4 kB
Release files / simple_dataclass_settings-0.0.5.tar.gz
| Download URL | simple_dataclass_settings-0.0.5.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbcaaefe857b665557cd16e5dd3eff1c45081428a4b1e2edd39127ed4b7e798d
|
|
BLAKE2b-256 checksum How to use checksums |
4ce370163cac41bddf520bf560e55b09c477aab59ba2bec8f435fe63675f5bca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.5
|
Release files / simple_dataclass_settings-0.0.5-py3-none-any.whl
| Download URL | simple_dataclass_settings-0.0.5-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a9f98c7b6b6ca079647aa8db2155ffd6130bdfa2160c75f4839f5ffac67b053
|
|
BLAKE2b-256 checksum How to use checksums |
f1fd59fe53c53e442cc8aade6535ba1357fb1a07076933650b5919d41a3ceb9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.5
|
Security for simple-dataclass-settings 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.