One-liner Python pyproject config loader. Lightweight, simple, and VCS-aware with root auto-discovery.
Project description
loadfig
One-liner Python pyproject config loader. Lightweight, simple, and VCS-aware with root auto-discovery.
✨ Features 🚀 Quick start 📚 Documentation 🤝 Contribute 👍 Adopters 📜 Legal
Features
loadfig is a Python package designed to load
TOML configuration files adhering to modern standards:
- Unified: Load your configuration either from
.mytool.tomlorpyproject.toml(section[tool.mytool]). - One-liner:
loadfig.config(name="mytool")returns a basic Python dictionary and that is all you need. - No dependencies: Python-only, no third-party dependencies.
- Do one thing well: Only load the configuration,
use other libraries like
python-dotenvfor bells and whistles. - Git-aware: Automatically detects project's
rootusing git (or other VCS), no need to specify the path to your configuration file.
Quick start
Installation
> pip install loadfig
Usage
Assume you have the following section in your pyproject.toml
file at the root of your project:
[tool.mytool]
name = "My Tool"
version = "1.0.0"
You can load the configuration for mytool using:
import loadfig
config = loadfig.config("mytool")
config["name"] # "My Tool"
config["version"] # "1.0.0"
That is all you will likely need to do to load your configuration for your Python project (in a modern, unified way).
[!IMPORTANT]
pyproject.tomlcan be located at the root of your project, while the loading file can be in a subfolder (e.g.src/mytool/loader.py).
See documentation for more details about the arguments and options available.
Contribute
We welcome your contributions! Start here:
Legal
- This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
- This project is copyrighted by open-nudge - the appropriate copyright notice is included in each file.
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 loadfig-0.1.0.tar.gz.
File metadata
- Download URL: loadfig-0.1.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcf14e9f1daa027b90d4811314f97531de1f00aa3520e477f5025de36afbc158
|
|
| MD5 |
5e0da74c4d0582a7365d9be7dda7b7cc
|
|
| BLAKE2b-256 |
48f372dd40bd37ab26c40441f8b4235b9b35f0e757d491cb42c4108a521c0f5c
|
Provenance
The following attestation bundles were made for loadfig-0.1.0.tar.gz:
Publisher:
release.yml on open-nudge/loadfig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loadfig-0.1.0.tar.gz -
Subject digest:
dcf14e9f1daa027b90d4811314f97531de1f00aa3520e477f5025de36afbc158 - Sigstore transparency entry: 273546495
- Sigstore integration time:
-
Permalink:
open-nudge/loadfig@7d3d7736417228ad8cc649dd134790264d1e052e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/open-nudge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7d3d7736417228ad8cc649dd134790264d1e052e -
Trigger Event:
release
-
Statement type:
File details
Details for the file loadfig-0.1.0-py3-none-any.whl.
File metadata
- Download URL: loadfig-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 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 |
3c8d15fbb79888782e1e86e64a937881defd00df89a6f7990044f2f865fc41c0
|
|
| MD5 |
f01b25770cd0a4895e0b1135ea98fdd9
|
|
| BLAKE2b-256 |
5940f844b67648bd48e262528ef497a4c82f84a708445cdcb8e30792e8447281
|
Provenance
The following attestation bundles were made for loadfig-0.1.0-py3-none-any.whl:
Publisher:
release.yml on open-nudge/loadfig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loadfig-0.1.0-py3-none-any.whl -
Subject digest:
3c8d15fbb79888782e1e86e64a937881defd00df89a6f7990044f2f865fc41c0 - Sigstore transparency entry: 273546497
- Sigstore integration time:
-
Permalink:
open-nudge/loadfig@7d3d7736417228ad8cc649dd134790264d1e052e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/open-nudge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7d3d7736417228ad8cc649dd134790264d1e052e -
Trigger Event:
release
-
Statement type: