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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: classy_config-0.6.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for classy_config-0.6.0.tar.gz
Algorithm Hash digest
SHA256 ef033a660e235779dbdaff688ecd40b425291b3200254709c6ee4da132346640
MD5 9a0f4145357212fe9a390d6c71d634ce
BLAKE2b-256 08a5093d11bacf1c35ff2affb5548061ff6b4ee9aef01a4ae4178ff4ea09f1bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for classy_config-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ea0a9348fc15bad764cb449002624f01fa892bab123ad8bdd29b92e9b961876
MD5 2715b5728d26d9213601b9e08219906c
BLAKE2b-256 3b45d491069c7f50bebafb3bae5362d904e364969c491a1a84e74f44d2716b2e

See more details on using hashes here.

Supported by

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