Skip to main content

This is a small module you can use to make using config files easy

Project description

Bored Config Parser

This is a small module you can use to make using config files easy

Example

A config like this:

general:
  name: "test"
  frequency: 22

targets:
  - name: "t1"
    size: "2G"
  - name: "t2"
    size: "1G"

can be easily used with the following code:

from typing import List

from config_parser import load_config


class General:
    name: str
    frequency: int


class Target:
    name: str
    size: str

    
@load_config("path/to/config.yaml")
class Config:
    general: General
    targets: List[Target]


print(Config.general.name)

for target in Config.targets:
    print(target.name)

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

bored-config-parser-0.1.1.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

bored_config_parser-0.1.1-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

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