Skip to content

A library to con*py*gure little projects 😊

License

Notifications You must be signed in to change notification settings

LucaSoato/conpygure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Conpygure

A library to conpygure little projects :)

Conpygure is a library that eases the burden of configuring little python projects. Configurator objects are classes defined extending the conpygure.Conf class. Defining your configuration is as easy as:

>>> import conpygure as c
>>>
>>> class A(c.Conf):
>>>     option_one = "default_value"
>>>     option_two = 2
>>>
>>> @c.subconfig_of(A)
>>> class B(c.Conf):
>>>     option_three = ["ab", "cd"]
>>>     option_four = {"a":1}

To print your serialized configuration:

>>> print(c.dumps())

Dump and load your config to file:

>>> c.dump("/path/to/conf.toml")
>>> c.load("/path/to/conf.toml")

Serializers just need to define dumps and loads methods:

>>> import json
>>> c.serializer = json

About

A library to con*py*gure little projects 😊

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages