ClassyConfig is a Python3 package aiming to remove the need for a config.py or settings.py file.
Project description
ClassyConfig
ClassyConfig is a Python3 package aiming to remove the need for a config.py or settings.py file.
Documentation
Installation
ClassyConfig is avliable via Pypi, so it can be installed using pip
$ pip install classy_config
Usage
from classy_config import ConfigValue, register_config
from pydantic import BaseModel
# Register your config file to be used
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)
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
classy_config-0.8.1.tar.gz
(4.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 classy_config-0.8.1.tar.gz.
File metadata
- Download URL: classy_config-0.8.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dd96245d8147b5e427abaed64ab50964c7b55fe72f0cb4dfa8ff42ff3bb5d17
|
|
| MD5 |
9baa3720b676cbb53b4ad8d1f175e37d
|
|
| BLAKE2b-256 |
03233df541eb245d3ad8f1e969d267fcd3fc2e3cfac68b70108be1d8c4ec6119
|
File details
Details for the file classy_config-0.8.1-py3-none-any.whl.
File metadata
- Download URL: classy_config-0.8.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc288b383b3811ba422f982e21365e1c42f816d7a1981fdf75374a5ff6afad74
|
|
| MD5 |
b73562337e6e1538ed6fa3275f934390
|
|
| BLAKE2b-256 |
b1e8245ceaf9f164bbf81d594a10f0bf21a21da3150269abc5a70711c0b8b356
|