Metadata-Version: 2.1
Name: classy-config
Version: 0.2.0a3
Summary: ClassyConfig is a Python3 package aiming to remove the need for a config.py or settings.py file.
Home-page: https://github.com/GDWR/classy-config
License: MIT
Author: GDWR
Author-email: gregory.dwr@gmail.com
Requires-Python: >=3.6.2,<4.0.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: pydantic (>=1.9.0,<2.0.0)
Requires-Dist: pyright (>=0.0.13,<0.0.14)
Requires-Dist: toml (>=0.10.2,<0.11.0)
Requires-Dist: typing-inspect (>=0.7.1,<0.8.0)
Project-URL: Repository, https://github.com/GDWR/classy-config
Description-Content-Type: text/markdown

# ClassyConfig

`ClassyConfig` is a Python3 package aiming to remove the need for a `config.py` or `settings.py` file.

```py

from classy_config import BaseModel, ConfigValue, register_config

# Create your global config manager (example test-config.json below)
register_config(filepath="config.toml")


# Resolve default values based on your config
def print_current_version(version: str = ConfigValue("package", str)) -> None:
    print(version)


# Use Pydantic Models for your config
class Author(BaseModel):
    username: str
    email: str
    lucky_number: int


# Resolve default values based on your config
def print_author(author: Author = ConfigValue("author", Author)) -> None:
    print(author)


# Allows for nested values
def print_value(value: int = ConfigValue("nested.value", int)) -> None:
    print(value)
```

```toml
package="ClassyConfig"

[author]
username="GDWR"
email="gregory.dwr@gmail.com"
lucky_number=17

[nested]
value=10
```

