Minimalistic configuration finder with standard Python libraries.
Project description
Config Finder
Finds a configuration file (e.g. pyproject.toml) and returns some sub-configuration with only python standard libraries.
!!! note Supported formats:
* [TOML](https://en.wikipedia.org/wiki/TOML)
* [JSON](https://en.wikipedia.org/wiki/JSON)
Algorighm
- starts from the currently executed file (__main__.__file__)
- Checks if that folder contains the desired configuration file
- Goes to the parent directory and repeats at 2
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.
[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"
!!! tip Instead of defining global variables in your code or using dotenv, a configuration file such as the pyproject.toml can be used to store configurations.
Access works via
```python
find_configuration("pyproject.toml", ["tool", "some_tool", "default_config"])
```
```
{"important_key" : "some_value"}
```
This function can also be used to handle credentials.
!!! caution Do not write your credentials into the pyproject.toml and ensure that you do not check your credentials into the source control.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simpleconfigfinder-0.2.2.tar.gz.
File metadata
- Download URL: simpleconfigfinder-0.2.2.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c9622681bd082536e3fe802862269a98485d4e47477cce7ebbc4a0c5e0731a3
|
|
| MD5 |
83fc699812de14c9627bc02d81749bc9
|
|
| BLAKE2b-256 |
d96beb35033f22adff453cb3544053172bf16ecc082cd3d5389f4938d7ace6dc
|
Provenance
The following attestation bundles were made for simpleconfigfinder-0.2.2.tar.gz:
Publisher:
python-publish.yml on fabfabi/simpleconfigfinder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simpleconfigfinder-0.2.2.tar.gz -
Subject digest:
1c9622681bd082536e3fe802862269a98485d4e47477cce7ebbc4a0c5e0731a3 - Sigstore transparency entry: 264388012
- Sigstore integration time:
-
Permalink:
fabfabi/simpleconfigfinder@1678b532ca2dbeebf0ff419d49684e88989f2643 -
Branch / Tag:
refs/tags/0.2.2 - Owner: https://github.com/fabfabi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1678b532ca2dbeebf0ff419d49684e88989f2643 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simpleconfigfinder-0.2.2-py3-none-any.whl.
File metadata
- Download URL: simpleconfigfinder-0.2.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55b8cb07679733d4e5eb179fec2d2ea09aa9679ee82165b32d79ad432b368824
|
|
| MD5 |
20cf1223b7b5894e88822be77c1f2c1e
|
|
| BLAKE2b-256 |
0a4b3d52d29411b19ac543b0a318fcc7693abdc1ec19ddc074a76bb86c3ffc25
|
Provenance
The following attestation bundles were made for simpleconfigfinder-0.2.2-py3-none-any.whl:
Publisher:
python-publish.yml on fabfabi/simpleconfigfinder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simpleconfigfinder-0.2.2-py3-none-any.whl -
Subject digest:
55b8cb07679733d4e5eb179fec2d2ea09aa9679ee82165b32d79ad432b368824 - Sigstore transparency entry: 264388013
- Sigstore integration time:
-
Permalink:
fabfabi/simpleconfigfinder@1678b532ca2dbeebf0ff419d49684e88989f2643 -
Branch / Tag:
refs/tags/0.2.2 - Owner: https://github.com/fabfabi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1678b532ca2dbeebf0ff419d49684e88989f2643 -
Trigger Event:
release
-
Statement type: