# Water
[![codecov](https://codecov.io/gh/davidventura/water/branch/master/graph/badge.svg?token=m5obuvwZ0I)](https://codecov.io/gh/davidventura/water)
[![Documentation Status](https://readthedocs.org/projects/water-cli/badge/?version=latest)](https://water-cli.readthedocs.io/en/latest/?badge=latest)
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](https://github.com/google/python-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:
```python
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](https://water-cli.readthedocs.io/en/latest/?badge=latest).
## 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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/DavidVentura/water",
"name": "water_cli",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "david",
"author_email": "davidventura27@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c5/1c/62b57037722c237f1d592f3a25ab800eedf638f9c604442b39422e3e595e/water_cli-0.1.16.tar.gz",
"platform": null,
"description": "# Water\n\n[![codecov](https://codecov.io/gh/davidventura/water/branch/master/graph/badge.svg?token=m5obuvwZ0I)](https://codecov.io/gh/davidventura/water)\n[![Documentation Status](https://readthedocs.org/projects/water-cli/badge/?version=latest)](https://water-cli.readthedocs.io/en/latest/?badge=latest)\n\nWater is a Python library that allows you to generate command-line interfaces (CLIs) for your Python project. Water is similar to the [Google Fire](https://github.com/google/python-fire) library, with some key differences:\n\n- Water is type-safe. This means that Water uses type annotations to ensure that the input values are of the correct type.\n- 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.\n\n## Installation\n\nTo install Water, use `pip`:\n\n```\npip install water-cli\n```\n\n\n## Getting started\n\nHere's a simple example of how to use Water:\n\n```python\nimport water_cli\n\ndef greet(name: str):\n print(f\"Hello, {name}!\")\n\nif __name__ == '__main__':\n water_cli.simple_cli(greet)\n```\n\nIn this example, we define a function called greet that takes a single argument, name, with type str.\n\nWhen we run the script with `python script.py greet --name Alice`, Water will call the greet function with `name='Alice'`.\n\n## Advanced usage\n\nPlease follow [the docs](https://water-cli.readthedocs.io/en/latest/?badge=latest).\n\n\n## Contributing\n\nIf you find a bug or have a feature request, please open an issue on the GitHub repository. Pull requests are also welcome!\n\n## License\n\nWater is licensed under the MIT License.\n\n## Testing\n\nPython3.9, 3.11:\n```\ndocker build -f dockerfiles/3.9-Dockerfile .\ndocker build -f dockerfiles/3.11-Dockerfile .\n```\n\nDevelopment\n```\npoetry run pytest\n```\n\n## Releasing\n\n```\npoetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "",
"version": "0.1.16",
"project_urls": {
"Homepage": "https://github.com/DavidVentura/water",
"Repository": "https://github.com/DavidVentura/water"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a8bc651efef830ec27e229763ed8d4b84ecb89de645a07168a5183f3ea31f9eb",
"md5": "d96c4982994a0fba4bcd295f22c4aa28",
"sha256": "de190abbfe11d8558b30b8b3bf5097282bd2e4fb77189bdc2069f80d0d69da5e"
},
"downloads": -1,
"filename": "water_cli-0.1.16-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d96c4982994a0fba4bcd295f22c4aa28",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 6984,
"upload_time": "2023-10-25T19:10:25",
"upload_time_iso_8601": "2023-10-25T19:10:25.581984Z",
"url": "https://files.pythonhosted.org/packages/a8/bc/651efef830ec27e229763ed8d4b84ecb89de645a07168a5183f3ea31f9eb/water_cli-0.1.16-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c51c62b57037722c237f1d592f3a25ab800eedf638f9c604442b39422e3e595e",
"md5": "0c280a8fbd65fac920ec320c44432bac",
"sha256": "bebe6bb3642eef30f299b0e697af466ff028a68d83f0971efcf6d6c9c30aa2a1"
},
"downloads": -1,
"filename": "water_cli-0.1.16.tar.gz",
"has_sig": false,
"md5_digest": "0c280a8fbd65fac920ec320c44432bac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 5921,
"upload_time": "2023-10-25T19:10:31",
"upload_time_iso_8601": "2023-10-25T19:10:31.700604Z",
"url": "https://files.pythonhosted.org/packages/c5/1c/62b57037722c237f1d592f3a25ab800eedf638f9c604442b39422e3e595e/water_cli-0.1.16.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-25 19:10:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DavidVentura",
"github_project": "water",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "water_cli"
}