For providing a python application with configuration and/or settings
Project description
application_settings
"You write the dataclasses to define parameters for configuration and settings, application_settings takes care of the logic."
What and why
Application_settings is a package for providing a python application with parameters for configuration and settings. It uses toml or json files that are parsed into dataclasses. This brings some benefits:
- Minimal work for the application designer
- Parameters are typed, which allows for improved static code analyses.
- IDEs will provide helpful hints and completion when using the parameters.
- More control over what happens when a file contains mistakes (by leveraging the power of pydantic).
- Possibility to specify defaults when no file is found or entries are missing.
- Configuration parameters are read-only (i.e., changed by editing the config file); we
recommend (and support) the use of
toml
for this, which is a human-oriented, flexible, standardardized and not overly complex format. - Settings parameters are read-write (i.e., mostly changed via the UI of the
application); we recommend (and support) use
json
for this, an established standardized machine-oriented format.
Parsing is done once during first access and the resulting set of parameters is stored as a singleton.
Interested? Then have a look at our quick start.
License
This project is licensed under the terms of the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file application_settings-0.2.0.tar.gz
.
File metadata
- Download URL: application_settings-0.2.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.1 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fd60c4e912af8697ff37b734b7be1250adf3949c6c86a666f9a9611caf07107 |
|
MD5 | fba8fb9a131bb141bf3785bca3650990 |
|
BLAKE2b-256 | ac8c2d22ebb887a4fb76311fbb073811cb5455e81196f3ededf0d91888cf244e |
File details
Details for the file application_settings-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: application_settings-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.1 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38b90d88360474829ac582db618a143f2bd79fd8b10bebd991233bfcbe682d69 |
|
MD5 | faa5f272a2e62ae02fa0be8cb1405e91 |
|
BLAKE2b-256 | f9bcf20f27485f74685ccb6a7c40ad502c4f8f614c3006691268129c2b40fa17 |