Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Don't write configurations, write class declarations.

Project description

Bonfig

from Bonfig import *
import configparser
class INIConfig(Bonfig):
    store = Store()
    SECTION = store.Section()
    A = SECTION.FloatField()

    def load(self):
        self.store = configparser.ConfigParser()
        self.store.read_string("[SECTION]\nA = 3.14159")

Stop writing your configurations as dictionaries and strange floating dataclasses, make them Bonfigs and make use of a whole bunch of great features:

  • Declare your configurations as easy to read classes.
  • Get all the power that comes with classes built into your configurations - polymorphism, custom methods and custom initialisation.
  • Sleep safe in the knowledge your config won't change unexpectedly.
  • Ready made serialisation and deserialisation with readmade custom Fields - IntField, FloatField, BoolField and DatetimeField.

Installation

pip install bonfig

Please checkout the project on github for more information: https://0hughman0.github.io/bonfig/index.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
bonfig-0.2.1-py3-none-any.whl (24.7 kB) Copy SHA256 hash SHA256 Wheel py3
bonfig-0.2.1.tar.gz (7.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page