Skip to main content

Python library to auto parse command line args from function typing.

Project description

PyCLI2

Python library to auto parse command line args from function typing.

Overview

This package simplfies the creation of CLI apps, by analysing the typing of python functions and parsing command line arguments.

Installation

The python package, both wheel and source distribution is available at PyPI pycli2 project. Install using your python package manager of choice. E.g. pip or uv.

uv pip install pycli2

Usage

The package comes with a demo CLI, which the source can be view at src/pycli2/__main__.py. It can be accessed by running

python -m pycli --help

In order to make your own CLI, simply import pycli2 and use the pycli2.run function. Provide it with functions, and it'll automatically create a CLI app from the function typing and function docstring.

import pycli2

if __name__ == "__main__":
    # This will expose firstfunc, secondfunc, and thirdfunc to the CLI.
    pycli2.run(
        firstfunc,
        secondfunc,
        thirdfunc,
    )

Contributing

...

Install locally

Install in edit mode, with dev dependendencies using your python package manager of choice. E.g. pip or uv.

uv pip install -e .[dev]

Build

Build a distribution by setting the PYTHON_PACKAGE environment variable to the version and run

uv build

The documentation can also be built using the Sphinx.

sphinx-build -M html docs/ dist/

License

This project is licensed under the GNU General Public License v3.0 only.

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

pycli2-0.1.13.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycli2-0.1.13-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file pycli2-0.1.13.tar.gz.

File metadata

  • Download URL: pycli2-0.1.13.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycli2-0.1.13.tar.gz
Algorithm Hash digest
SHA256 b31b44392431d0be231fcabc62ce5b4c276715196b432b740b46e107f397fcc4
MD5 3e7cf2e87601a82fe44ad32adaafdddc
BLAKE2b-256 c252f41e70ff832caed8b39eb16d258dac066e3fb1e295b4379996ef2e3d8d19

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycli2-0.1.13.tar.gz:

Publisher: python-2-deploy.yml on Olindholm/pycli2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycli2-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: pycli2-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycli2-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 5ecb79e573e755ae8e6c9adf93fed3683b6b0b8aee59a3055b933f4c54a74bb4
MD5 64b5357234b0af4b2f285682520e9802
BLAKE2b-256 25fb856a03a485d29fd880f93dfa8b59fe1351d58ece4233a3b18e2c4532eeff

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycli2-0.1.13-py3-none-any.whl:

Publisher: python-2-deploy.yml on Olindholm/pycli2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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