https://github.com/tangledpath/auto-cli-py
CLI automatically created from function via introspection
https://github.com/tangledpath/auto-cli-py
Last synced: about 1 year ago
JSON representation
CLI automatically created from function via introspection
- Host: GitHub
- URL: https://github.com/tangledpath/auto-cli-py
- Owner: tangledpath
- License: mit
- Created: 2019-10-01T17:40:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-04T00:10:27.000Z (over 2 years ago)
- Last Synced: 2025-02-23T12:03:53.015Z (over 1 year ago)
- Language: Python
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# auto-cli-py
Python Library that builds a complete CLI given one or more functions.
Most options are set using introspection/signature and annotation functionality, so very little configuration has to be done.
## Setup
@@DEPRECATED; USE https://github.com/tiangolo/typer-cli instead.
### TL;DR Install for usage
```bash
# Install from github
pip install auto-cli-py
# See example code and output
python examples.py
```
### In python code
## Development
* Standard python packaging - Follows methodologies from: https://python-packaging.readthedocs.io/en/latest/minimal
.html
* Uses pytest
### Pytest
https://docs.pytest.org/en/latest/
### Python (Anaconda) environment
*(assumes anaconda is properly installed)*
```bash
# First time. Create conda environment from environment.yml and activate it:
conda env create -f environment.yml -n auto-cli-py
conda activate auto-cli-py
```
```bash
# If environment changes:
conda activate auto-cli-py
conda env update -f=environment.yml
# -- OR remove and restart --
conda remove --name auto-cli-py --all
conda env create -f environment.yml
```
### Activate environment
```bash
conda activate auto-cli-py
# This symlinks the installed auto_cli package to the source:
pip install -e .
```
### Preparation
```bash
conda activate auto-cli-py
```
### Linting and Testing
*pytest behavior and output is controlled through `auto_cli/tests/pytest.ini`*
```bash
# Lint all code:
pylint auto_cli
# Run all tests
pytest
# See more options for pytest:
pytest --help
# This is handy:
pytest --fixtures-per-test
```
### Installation (other)
```bash
# AND/OR Install from a specific github branch
pip uninstall auto-cli-py
pip install git+https://github.com/tangledpath/auto-cli-py.git@features/blah
```