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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file application_settings-0.4.0.tar.gz.

File metadata

  • Download URL: application_settings-0.4.0.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for application_settings-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ac927c8e448ebcde4c262e36cee6730a0d0cef16ac7655a8e754d7f4f6bb209c
MD5 38763e00e0349463fcb064de3b7a1e90
BLAKE2b-256 50da549c83d52718a1f72c06b95e869fc9cd49a9c6698447520aed1ca98ddadb

See more details on using hashes here.

File details

Details for the file application_settings-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for application_settings-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8741897c4748109d900fd54d50af858bec0a0ffb7b5762f73ee056728382c86
MD5 d5dab5b7b36d4053818eb8daf71ee71b
BLAKE2b-256 0542f6088e2a84bc660782904a3be045ed89c9f626956bffd0f98151a23f82b2

See more details on using hashes here.

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