No project description provided
Project description
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
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file water_cli-0.1.16.tar.gz
.
File metadata
- Download URL: water_cli-0.1.16.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Linux/6.2.0-32-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bebe6bb3642eef30f299b0e697af466ff028a68d83f0971efcf6d6c9c30aa2a1 |
|
MD5 | 0c280a8fbd65fac920ec320c44432bac |
|
BLAKE2b-256 | c51c62b57037722c237f1d592f3a25ab800eedf638f9c604442b39422e3e595e |
File details
Details for the file water_cli-0.1.16-py3-none-any.whl
.
File metadata
- Download URL: water_cli-0.1.16-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Linux/6.2.0-32-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de190abbfe11d8558b30b8b3bf5097282bd2e4fb77189bdc2069f80d0d69da5e |
|
MD5 | d96c4982994a0fba4bcd295f22c4aa28 |
|
BLAKE2b-256 | a8bc651efef830ec27e229763ed8d4b84ecb89de645a07168a5183f3ea31f9eb |