Skip to main content

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

Project description

ClassyConfig Logo

ClassyConfig

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

Checks Pipeline Badge Create Documentation Badge Build and Publish Badge
PyPI MIT License Downloads

Documentation

Installation

ClassyConfig is avliable via Pypi, so it can be installed using pip

$ pip install classy_config

Usage

View on the docs

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


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.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

classy_config-0.8.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file classy_config-0.8.0.tar.gz.

File metadata

  • Download URL: classy_config-0.8.0.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

Hashes for classy_config-0.8.0.tar.gz
Algorithm Hash digest
SHA256 abdaeb83724fe19d317ed14827810e088481cbdb2444a08469b602d875f5b8b8
MD5 a743380217bd277a902e945782db7c5a
BLAKE2b-256 e6afce9603d01ede56fc53665a611930ac6a2f22ee93c930447b03b664991afa

See more details on using hashes here.

File details

Details for the file classy_config-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: classy_config-0.8.0-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

Hashes for classy_config-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45386841cdf00748dd557e01eb773e7d2ec74e3292d516fc5e06d5777416eea9
MD5 d2361c311d51b09ba7a852a1adad67ec
BLAKE2b-256 f99ce360b40cb4ba300fd8645fddbcfd8b3e95c03d70f573cbcfa3d1a19a5900

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page