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
andDatetimeField
.
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 hashes)
Built Distribution
bonfig-0.2.1-py3-none-any.whl
(24.7 kB
view hashes)