Water
Water is a Python library that allows you to generate command-line interfaces (CLIs) for your Python project. Water is similar to the Google Fire library, with some key differences:
- Water is type-safe. This means that Water uses type annotations to ensure that the input values are of the correct type.
- Water is designed with easy integration testing in mind. This means that you can easily test your Water CLI by invoking it from your test code, making it simple to write thorough and comprehensive tests for your CLI.
Installation
To install Water, use pip:
pip install water-cli
Getting started
Here's a simple example of how to use Water:
import water_cli
def greet(name: str):
print(f"Hello, {name}!")
if __name__ == '__main__':
water_cli.simple_cli(greet)
In this example, we define a function called greet that takes a single argument, name, with type str.
When we run the script with python script.py greet --name Alice, Water will call the greet function with name='Alice'.
Advanced usage
Please follow the docs.
Contributing
If you find a bug or have a feature request, please open an issue on the GitHub repository. Pull requests are also welcome!
License
Water is licensed under the MIT License.
Testing
Python3.9, 3.11:
docker build -f dockerfiles/3.9-Dockerfile .
docker build -f dockerfiles/3.11-Dockerfile .
Development
poetry run pytest
Releasing
poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD
Release files for water_cli 0.1.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| water_cli-0.1.16.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| water_cli-0.1.16-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / water_cli-0.1.16.tar.gz
| Download URL | water_cli-0.1.16.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bebe6bb3642eef30f299b0e697af466ff028a68d83f0971efcf6d6c9c30aa2a1
|
|
BLAKE2b-256 checksum How to use checksums |
c51c62b57037722c237f1d592f3a25ab800eedf638f9c604442b39422e3e595e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.4 Linux/6.2.0-32-generic
|
Release files / water_cli-0.1.16-py3-none-any.whl
| Download URL | water_cli-0.1.16-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de190abbfe11d8558b30b8b3bf5097282bd2e4fb77189bdc2069f80d0d69da5e
|
|
BLAKE2b-256 checksum How to use checksums |
a8bc651efef830ec27e229763ed8d4b84ecb89de645a07168a5183f3ea31f9eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.4 Linux/6.2.0-32-generic
|