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.2.tar.gz
(3.5 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.2.tar.gz.
File metadata
- Download URL: toomanyconfigs-0.1.2.tar.gz
- Upload date:
- Size: 3.5 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 |
bb66d57a468c84b60d44eccc019e6bf35d605286c5ec1791f788e58cc1551b58
|
|
| MD5 |
5fa46297f73416cfe98fdf4c3b03dbed
|
|
| BLAKE2b-256 |
f8fe021357e180e0d86c58021d927632ef86a158f4816068cca49dea7f19f81d
|
File details
Details for the file toomanyconfigs-0.1.2-py3-none-any.whl.
File metadata
- Download URL: toomanyconfigs-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.3 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 |
08b213f941fd618d15ad2aa3fb2a229033c005917ee0a01d7cad7c3778cb365c
|
|
| MD5 |
00b30f2ef02bec7347fba4d4ae0f7116
|
|
| BLAKE2b-256 |
ea0e66b4c90f763ea0d29a7beac6c7274a6d67e83f2120de973b703d9c871d39
|