Skip to main content

A lightweight, dynamic arg parser for fun, but not profit.

Project description

A lightweight, dynamic argument parsing library for Python programs with klugy support for typing variables.

I made this for a teaching machine project I’m working on (I needed a custom argument parser for _reasons_), and I’m always too impatient to use argparse.

Installation

Find this tool on PyPI: pip install arglite

Usage

Check this out:

import arglite

`python |def main(): | print(arglite.parser.a) | print(arglite.parser.b) | print(arglite.parser.c) | | arglite.parser.display() | |if __name__ == "__main__": | main() ` Run using:

` python main.py -a Yo --b that is -c. `

Notes

Flags with no value are automatically converted to True boolean The module uses ast.literal_eval, so “{‘a’:’b’}” will convert to a dict (all quotes required) Programs will produce error messages when flags are missing

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

arglite-0.3.tar.gz (3.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page