Ingenious Framework for Configuration
Project description
Ingenious Framework for Configuration
Alternative configuration framework using argparse and configparser. Designed for the following purposes.
-
Integration of command line args and configuration files
-
Generation of default configuration files
-
Class initialization procedure using parameter object pattern
-
SAMPLE
** main.py
from ifconf import configure_main
if name == "main": configure_main()
** server.py
from ifconf import configure_module, config_callback
@config_callback def config(loader): loader.add_attr('addr', '0.0.0.0') loader.add_attr_int('port', 8080)
class MyClass:
def __init__(self, main_config=None):
self.conf = configure_module(configure)
self.addr = self.conf.addr
self.port = self.conf.port
self.conf.logger.info(self.conf)
** config.ini
[server_config]
#addr = 0.0.0.0 port = 8888
You can print config.ini template
python -m ifconf server.config
This is the README file for the project.
The file should use UTF-8 encoding and can be written using reStructuredText or markdown with the appropriate key set. It will be used to generate the project webpage on PyPI and will be displayed as the project homepage on common code-hosting services, and should be written for that purpose.
Typical contents for this file would include an overview of the project, basic usage examples, etc. Generally, including the project changelog in here is not a good idea, although a simple “What's New” section for the most recent version may be appropriate.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ifconf-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3b1e18c38ae9bfa25824a93e43aaeb84660cc7fa5184f4e37d9ad57ff7bb607 |
|
MD5 | 792c3502ff8eca6440ee8e2b640f08f0 |
|
BLAKE2b-256 | 33406a2718ff3ecdd1bf4765427002f42dfa8cd013ced03ec95336a907538b40 |