Skip to main content

A prompting option parser

Project description


A prompting option parser


import optprompt

parser = optprompt.OptionPrompter(config_files=['./example.toml'])
parser.add_argument('-n', '--name', prompt='What is your name')
parser.add_argument('-r', '--race', prompt='What is your race', opt_default='elf')
parser.add_argument('-e', '--edition')
opts = parser.parse_args()

With the config file

edition = '3.5'

Will produce the following output

(venv) [dylan@voyager examples]$ PYTHONPATH=$(pwd)/.. python
What is your name : Bob
What is your race [elf]:
Namespace(edition='3.5', name='Bob', race='elf')

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for optprompt, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size optprompt-0.3.0-py3-none-any.whl (5.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size optprompt-0.3.0.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page