Skip to main content

Minimalistic configuration finder with standard Python libraries.

Project description

Config Finder

Finds a configuration file (e.g. pyproject.toml) and returns some sub-configuration by only using python standard libraries.

Supported formats:

Use Case

When defining machine learning projects and handling the project configuration by e.g. a pyproject.toml (e.g. with Astral UV or Poetry) you can utilize the configuration files to define and store important variables.

Instead of defining global variables in your code or using dotenv, a configuration file such as the pyproject.toml can be used for those values.

Example

Instead of defining global variables, just define these parameters in the pyproject.toml

[tool.some_tool]
key1 = "some_value_1"
key2 = "some_value_2"

[tool.some_tool.default_config]
important_key = "some_value"

[tool.some_tool.special_config]
important_key = "another_value"

To get the key for your default_config just call

find_configuration("pyproject.toml", ["tool", "some_tool", "default_config", "important_key"])
"some_value"

and respectively for your special_config use

find_configuration("pyproject.toml", ["tool", "some_tool", "special_config", "important_key"])
"another_value"

Or you could get one full set of the configuration as dictionary via

find_configuration("pyproject.toml", ["tool", "some_tool", "special_config"])
{ "important_key" : "another_value" }

Link to full documentation

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

simpleconfigfinder-0.5.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simpleconfigfinder-0.5.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file simpleconfigfinder-0.5.0.tar.gz.

File metadata

  • Download URL: simpleconfigfinder-0.5.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simpleconfigfinder-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1ba927907c8c0435eed3d4d07c79bac4f4ef26639d015a7d5dce4e63d1fb7ae4
MD5 adbec55364ffd3bad0eaf7b77df1e2cd
BLAKE2b-256 34b130d78c523616da3b0cf0458b1d17123dffaa12bdf2eec542b1b76a22bb6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for simpleconfigfinder-0.5.0.tar.gz:

Publisher: python-publish.yml on fabfabi/simpleconfigfinder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simpleconfigfinder-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simpleconfigfinder-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77448005aa6de8552cf2d3b18c02bbf1a94388dd0ea18c2ad31e44a862a04415
MD5 be09421c0b7bfd5f1265527eab8b81dc
BLAKE2b-256 d6adaef370b68d5911cd364a4f4fc8c13d6b115267fd809001d0ec8dbf41c97f

See more details on using hashes here.

Provenance

The following attestation bundles were made for simpleconfigfinder-0.5.0-py3-none-any.whl:

Publisher: python-publish.yml on fabfabi/simpleconfigfinder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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