Top-level package for optini.
Project description
Python class to get options from command line and config file
Free software: MIT license
Documentation: https://optini.readthedocs.io.
Features
Get options from command line, config file, or defaults
Simple intuitive way to specify options
Provide reasonable logging defaults as an option (-v, -d, etc.)
Use conventions as defaults where possible
Examples
import optini
spec = {
# boolean flag is the default type
'someopt': {
'help': 'set a flag',
},
'Another': {
'help': 'this option takes a string arg',
'type': str,
},
}
# implies -s and --someopt command line options
# implies -A and --Another command line options
confobj = optini.Config(appname="myapp", spec=spec, file=True)
# defaults to ~/.myapp.ini as config file
if optini.opt.someopt:
print("someopt flag is set")
print(optini.opt)
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
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
optini-0.1.0.tar.gz
(13.6 kB
view hashes)
Built Distribution
optini-0.1.0-py3-none-any.whl
(6.6 kB
view hashes)