No project description provided
Project description
TooManyConfigs
A simple Python library for TOML-based configuration with interactive setup and clipboard integration.
Installation
pip install toomanyconfigs
Basic Usage
from dataclasses import dataclass
from toomanyconfigs import TOMLDataclass
@dataclass #You must inherit TOMLDataclass on another dataclass
class Test(TOMLDataclass):
foo: str = None #Each field that should prompt user input should be 'None'
if __name__ == "__main__":
Test.from_toml() #Without specifying a path, TOMLDataclass will automatically make a .toml in your cwd with the name of your inheriting class.
2025-07-25 14:04:37.151 | WARNING | toomanyconfigs.core:from_toml:37 - [TooManyConfigs]: Config file not found at C:\Users\foobar\PycharmProjects\TooManyConfigs\src\test.toml, creating new one
Test(foo=None): Enter value for 'foo' (or press Enter to paste from clipboard): bar
2025-07-25 14:04:45.721 | SUCCESS | toomanyconfigs.core:_prompt_field:91 - Test(foo='bar'): Set foo
2025-07-25 14:04:45.721 | DEBUG | toomanyconfigs.core:write:101 - [TooManyConfigs]: Writing config to C:\Users\foobar\PycharmProjects\TooManyConfigs\src\test.toml
2025-07-25 14:09:30.142 | DEBUG | toomanyconfigs.core:read:110 - [TooManyConfigs] Reading config from C:\Users\foobar\PycharmProjects\TooManyConfigs\src\test.toml
2025-07-25 14:09:30.143 | DEBUG | toomanyconfigs.core:_load_from_data:59 - Test(foo='bar'): Loaded foo from config
Advanced Usage
from loguru import logger as log
@dataclass
class Test2(TOMLDataclass):
foo: str = None
bar: int = 33 #We'll set bar at 33 to demonstrate the translation ease between dynamic python objects and .toml
if __name__ == "__main__":
t = Test2.from_toml() #initialize a dataclass from a .toml
log.debug(t.bar) #view t.bar
t.bar = 34 #override python memory
log.debug(t.bar) #view updated t.bar
t.write() #write to the specified .toml file
data = t.read() #ensure overwriting
log.debug(data)
2025-07-25 14:36:16.836 | DEBUG | toomanyconfigs.core:read:111 - [TooManyConfigs] Reading config from C:\Users\foobar\PycharmProjects\TooManyConfigs\src\test.toml
2025-07-25 14:36:16.837 | DEBUG | toomanyconfigs.core:_load_from_data:59 - Test(foo='bar'): Loaded foo from config
2025-07-25 14:36:16.838 | WARNING | toomanyconfigs.core:from_toml:37 - [TooManyConfigs]: Config file not found at C:\Users\foobar\PycharmProjects\TooManyConfigs\src\test2.toml, creating new one
Test2(foo=None, bar=33): Enter value for 'foo' (or press Enter to paste from clipboard): val
2025-07-25 14:36:18.826 | SUCCESS | toomanyconfigs.core:_prompt_field:92 - Test2(foo='val', bar=33): Set foo
2025-07-25 14:36:18.826 | DEBUG | toomanyconfigs.core:write:102 - [TooManyConfigs]: Writing config to C:\Users\foobar\PycharmProjects\TooManyConfigs\src\test2.toml
2025-07-25 14:36:18.827 | DEBUG | __main__:<module>:34 - 33
2025-07-25 14:36:18.828 | DEBUG | __main__:<module>:36 - 34
2025-07-25 14:36:18.828 | DEBUG | toomanyconfigs.core:write:102 - [TooManyConfigs]: Writing config to C:\Users\foobar\PycharmProjects\TooManyConfigs\src\test2.toml
2025-07-25 14:36:18.829 | DEBUG | toomanyconfigs.core:read:111 - [TooManyConfigs] Reading config from C:\Users\foobar\PycharmProjects\TooManyConfigs\src\test2.toml
2025-07-25 14:36:18.831 | DEBUG | __main__:<module>:39 - {'foo': 'val', 'bar': 34}
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
toomanyconfigs-0.1.3.tar.gz
(3.6 kB
view details)
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 toomanyconfigs-0.1.3.tar.gz.
File metadata
- Download URL: toomanyconfigs-0.1.3.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.2 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c3244541e7255bb8e192a2f39406015fbb6e50b1a8f1964dd7f4d0fb63e77fc
|
|
| MD5 |
0d7da1b8c877adfc800cf0c635fb08ba
|
|
| BLAKE2b-256 |
0f0157b43b02664c3f98f7375a9057af9faa09583b84dffd730ff1ad549bac7e
|
File details
Details for the file toomanyconfigs-0.1.3-py3-none-any.whl.
File metadata
- Download URL: toomanyconfigs-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.2 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7530b7786a76e325198d4a6129d9df1319d7612a9e427512d0f449efbb34bc44
|
|
| MD5 |
65b7e94d4a8554b28ada8b86fc58ca85
|
|
| BLAKE2b-256 |
d58f3c3b0bf8c4d44895adb8e5a293950244ac26a41a9e62d24f6fef36998a71
|