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"}    

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.3.3.tar.gz (4.4 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.3.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for simpleconfigfinder-0.3.3.tar.gz
Algorithm Hash digest
SHA256 8d82d6ca6cb9c60b237c702bcc37bf2d2b4666cd747d94d26c791ac5110ad5df
MD5 a7f07a0f5e5003f1be177b9464fddde1
BLAKE2b-256 6d14da6f4af467555b05dcb9764d4b033049f958ec0360d29f7cce957dacd229

See more details on using hashes here.

Provenance

The following attestation bundles were made for simpleconfigfinder-0.3.3.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.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for simpleconfigfinder-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3b3808b0306e1abf0c4833acbdefee156cfe5b59806874feef00c2ebba0138b2
MD5 a77746512eff7f0d5fdac9d4ad48e821
BLAKE2b-256 7c71b7c667e7e20687b17a1ddeab04807c7952fff05ec81bfe939e56ec736351

See more details on using hashes here.

Provenance

The following attestation bundles were made for simpleconfigfinder-0.3.3-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