Skip to main content

No project description provided

Project description

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

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

water_cli-0.1.16.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

water_cli-0.1.16-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page