Skip to main content

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.

Source Distribution

bonfig-0.2.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

bonfig-0.2.1-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file bonfig-0.2.1.tar.gz.

File metadata

  • Download URL: bonfig-0.2.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.6.7 Windows/10

File hashes

Hashes for bonfig-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3ed339394a94661596b0767ef04a38cef1796c023e32b7c6812f43a9f369496d
MD5 fc953305965e131a692fc4a63e89d5d4
BLAKE2b-256 2ca4d6d40554d7eaaa31d393e82ed2da93f7a03fcd1aa42a76cd01532adc2c55

See more details on using hashes here.

File details

Details for the file bonfig-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: bonfig-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.6.7 Windows/10

File hashes

Hashes for bonfig-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60fbd96a7cc1703ca81e75cd087fb2c8c059604072fe56ee76dc4ac9f79aff43
MD5 39da320390d04de837ba2823617543dc
BLAKE2b-256 51f3b42cc0ecb85ce5dcb61faf1e37925e8298492fd4add506bb317c33131dda

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