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.7.1.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.7.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for classy_config-0.7.1.tar.gz
Algorithm Hash digest
SHA256 75432bf510b6dc6686682ea8c0e61004289a7a3bf3bf1b8ecc9aa241cd936402
MD5 f47e52d4ec6057028591b312dcaeee90
BLAKE2b-256 d6f1d5eb0df6a81806a2e9d256820f470cd58aee80eb8f5b5e9dd8969a46b2b1

See more details on using hashes here.

File details

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

File metadata

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

Hashes for classy_config-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 333008bc6d851480effd9d87300bff8345590481b716e852b9ca293ed49b06f3
MD5 31954361ce7104f396425593d47f4f9c
BLAKE2b-256 29453e4607ec44e7eed6fe752d1158c7cede017a0ce677d08feced6c93102dd8

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