Skip to main content

For providing a python application with configuration and/or settings

Project description

application_settings - version 0.4.0

pypi versions Build Status codecov Checked with mypy linting: pylint Code style: black Imports: isort License: MIT

"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 or library 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 developer of the application / library
  • 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, i.e., aim for "zeroconf".
  • 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 before or during first access and the resulting set of parameters is stored as a singleton.

Interested? Then have a look at our quick start or dive into the full documentation.

If you appreciate this library package, then please give us a star on Github.

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

application_settings-0.4.0.tar.gz (18.7 kB view hashes)

Uploaded Source

Built Distribution

application_settings-0.4.0-py3-none-any.whl (16.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page