Skip to main content

Water

codecov Documentation Status

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)

Source distribution for water_cli 0.1.16
File Size Uploaded
water_cli-0.1.16.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for water_cli 0.1.16
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.16 This release

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page