Convert argparse.ArgumentParser to json compatible with JSON Form
Project description
argparse-to-json
Convert Python argparse parsers to json compatible with JSON Form.
Usage
import argparse
from argparse_to_json import convert_parser_to_json
parser = argparse.ArgumentParser()
parser.add_argument('input')
json_schema = convert_parser_to_json(parser)
See the example
folder for a Flask app that renders forms for command line interfaces using JSON Form. You can run the example as follows:
pip install flask
FLASK_APP=app.py
flask run
Why?
Because maybe I wanted to have a simple way to create GUIs for my Python CLI's.
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
argparse-to-json-0.0.1.tar.gz
(3.7 kB
view hashes)
Built Distributions
Close
Hashes for argparse_to_json-0.0.1-py3.10.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecbebab1253337a37dab76e0bf1ac520deffd0b330986a4f21d198f150e4ed03 |
|
MD5 | ade0b8a67ca637992492478bf61bc705 |
|
BLAKE2b-256 | c6fd54c0c76fd740488dbd12f8a2db6b0245d79b694e62f3886a6b069642898f |
Close
Hashes for argparse_to_json-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6b80c9b5e6075a50ca85a86176d90937ea03b75108d1ba0c5fdb4b65f39575d |
|
MD5 | 893f54e242f24d23699c48696c985110 |
|
BLAKE2b-256 | 796f42048f98d02d22b398f306e64687255b34b43fac90c86e58d44f86d2e578 |