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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b31b44392431d0be231fcabc62ce5b4c276715196b432b740b46e107f397fcc4
|
|
| MD5 |
3e7cf2e87601a82fe44ad32adaafdddc
|
|
| BLAKE2b-256 |
c252f41e70ff832caed8b39eb16d258dac066e3fb1e295b4379996ef2e3d8d19
|
Provenance
The following attestation bundles were made for pycli2-0.1.13.tar.gz:
Publisher:
python-2-deploy.yml on Olindholm/pycli2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycli2-0.1.13.tar.gz -
Subject digest:
b31b44392431d0be231fcabc62ce5b4c276715196b432b740b46e107f397fcc4 - Sigstore transparency entry: 774469660
- Sigstore integration time:
-
Permalink:
Olindholm/pycli2@e03572ea7361c36aec89f0499b9b7fef0abb83a8 -
Branch / Tag:
refs/tags/v0.1.13 - Owner: https://github.com/Olindholm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-2-deploy.yml@e03572ea7361c36aec89f0499b9b7fef0abb83a8 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ecb79e573e755ae8e6c9adf93fed3683b6b0b8aee59a3055b933f4c54a74bb4
|
|
| MD5 |
64b5357234b0af4b2f285682520e9802
|
|
| BLAKE2b-256 |
25fb856a03a485d29fd880f93dfa8b59fe1351d58ece4233a3b18e2c4532eeff
|
Provenance
The following attestation bundles were made for pycli2-0.1.13-py3-none-any.whl:
Publisher:
python-2-deploy.yml on Olindholm/pycli2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycli2-0.1.13-py3-none-any.whl -
Subject digest:
5ecb79e573e755ae8e6c9adf93fed3683b6b0b8aee59a3055b933f4c54a74bb4 - Sigstore transparency entry: 774469662
- Sigstore integration time:
-
Permalink:
Olindholm/pycli2@e03572ea7361c36aec89f0499b9b7fef0abb83a8 -
Branch / Tag:
refs/tags/v0.1.13 - Owner: https://github.com/Olindholm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-2-deploy.yml@e03572ea7361c36aec89f0499b9b7fef0abb83a8 -
Trigger Event:
workflow_dispatch
-
Statement type: