==========
cluey
==========
.. start-badges
|pypi badge| |testing badge| |coverage badge| |docs badge| |black badge| |git3moji badge| |cluey badge|
.. |pypi badge| image:: https://img.shields.io/pypi/v/cluey?color=blue
:alt: PyPI - Version
:target: https://pypi.org/project/cluey/
.. |cluey badge| image:: https://img.shields.io/badge/cluey-B1230A.svg
:target: https://rbturnbull.github.io/cluey/
.. |testing badge| image:: https://github.com/rbturnbull/cluey/actions/workflows/testing.yml/badge.svg
:target: https://github.com/rbturnbull/cluey/actions
.. |docs badge| image:: https://github.com/rbturnbull/cluey/actions/workflows/docs.yml/badge.svg
:target: https://rbturnbull.github.io/cluey
.. |black badge| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
.. |coverage badge| image:: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/rbturnbull/b84e24e6b58498cfcdd7f19388e111ad/raw/coverage-badge.json
:target: https://rbturnbull.github.io/cluey/coverage/
.. |git3moji badge| image:: https://img.shields.io/badge/git3moji-%E2%9A%A1%EF%B8%8F%F0%9F%90%9B%F0%9F%93%BA%F0%9F%91%AE%F0%9F%94%A4-fffad8.svg
:target: https://robinpokorny.github.io/git3moji/
.. end-badges
**Cluey - Command Line Utility for Engineers & You**
Build clever, class-based command line apps with minimal boilerplate
Documentation at https://rbturnbull.github.io/cluey/
.. start-quickstart
Installation
=======================
The software can be installed using ``pip``
.. code-block:: bash
pip install cluey
To install the latest version from the repository, you can use this command:
.. code-block:: bash
pip install git+https://github.com/rbturnbull/cluey.git
Documentation is available here: https://rbturnbull.github.io/cluey/
Your first Cluey CLI
=======================
Here is a minimal example of a Cluey CLI app:
.. code-block:: Python
import cluey
class GreetApp(cluey.Cluey):
"""A minimal Cluey CLI app"""
@cluey.main
def greet(self, name: str = cluey.Argument(..., help="")):
"""Greet a person by name"""
print(f"Hello, {name}!")
if __name__ == "__main__":
GreetApp().main()
Then you can run this:
.. code-block:: bash
python cluey/examples/greet.py --help
Which will display:
.. code-block:: bash
╭─ Arguments ─────────────────────────────────────────────────────────────────╮
│ * name TEXT The name of the person to greet [required] │
╰─────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────╮
│ --version -v Show the version of this CLI │
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────╯
To run the app,
.. code-block:: bash
python cluey/examples/cluey/examples/greet.py Alice
This will display:
.. code-block:: bash
Hello, Alice!
Adding a flag
=================
.. code-block:: python
import cluey
class GreetApp(cluey.Cluey):
"""A minimal Cluey CLI app"""
@cluey.main
def greet(self, name: str = cluey.Argument(..., help="The name of the person to greet")):
"""Greet a person by name"""
print(f"Hello, {name}!")
@cluey.flag(shortcut="-v")
def version(self) -> str:
"""Show the version of this CLI"""
return "GreetApp version 0.1.0"
if __name__ == "__main__":
GreetApp().main()
To display the version of the app, run:
.. code-block :: bash
python cluey/examples/greet.py --version
# OR
python cluey/examples/greet.py -v
Adding a second command
=======================
.. code-block:: python
import cluey
class ArithmeticApp(cluey.Cluey):
""" Does basic arithmetic """
@cluey.main
def add(
self,
a: float = cluey.Argument(..., help="A value to start with."),
b: float = cluey.Argument(..., help="A value to add."),
):
""" Sums two values """
print(a+b)
@cluey.main
def subtract(
self,
a: float = cluey.Argument(..., help="A value to start with."),
b: float = cluey.Argument(..., help="A value to sub."),
):
""" Subtracts one value from another """
print(a-b)
if __name__ == "__main__":
ArithmeticApp().main()
Then you can run the following:
.. code-block :: bash
python cluey/examples/arithmetic.py --help
python cluey/examples/arithmetic.py add --help
python cluey/examples/arithmetic.py subtract --help
python cluey/examples/arithmetic.py add 3 2
python cluey/examples/arithmetic.py subtract 3 2
Add options with defaults
=========================
.. code-block:: python
import unicodedata
import cluey
class StringTools(cluey.Cluey):
""" Does simple string functions """
@cluey.main
def lowercase(
self,
string: str = cluey.Argument(..., help="The string to process."),
) -> str:
"""Converts the string to lowercase."""
string = string.lower()
print(string)
return string
@cluey.main
def clean(
self,
string: str = cluey.Argument(..., help="The string to process."),
strip_accents:bool = cluey.Option(False, help="Whether or not to strip accents."),
ascii:bool = cluey.Option(False, help="Whether or not to include only ascii characters."),
) -> str:
"""Cleans the given string."""
if strip_accents:
string = ''.join(
character for character in unicodedata.normalize('NFKD', string)
if not unicodedata.combining(character)
)
if ascii:
string = ''.join(character for character in string if character.isascii())
print(string)
return string
if __name__ == "__main__":
StringTools().main()
Now the optional arguments can be set via the command line:
.. code-block:: bash
python cluey/examples/stringtools.py clean "Café ☕️" --strip-accents --ascii
Cafe
Call one method from another
============================
So far, all of the above could have been done more easily with Typer, but with Cluey,
you are able to call one method from another and the function arguments get passed to the command line.
.. code-block:: python
import unicodedata
import cluey
class StringTools(cluey.Cluey):
""" Does simple string functions """
@cluey.main
def clean(
self,
string: str = cluey.Argument(..., help="The string to process."),
strip_accents:bool = cluey.Option(True, help="Whether or not to strip accents."),
ascii:bool = cluey.Option(False, help="Whether or not to include only ascii characters."),
) -> str:
"""Cleans the given string."""
if strip_accents:
string = ''.join(
character for character in unicodedata.normalize('NFKD', string)
if not unicodedata.combining(character)
)
if ascii:
string = ''.join(character for character in string if character.isascii())
print(string)
return string
@cluey.main('clean')
def count_vowels(self, string: str, **kwargs) -> int:
"""Counts the number of vowels in the string."""
string = self.clean(string, **kwargs).lower()
result = sum(1 for character in string if character in 'aeiou')
print("Vowels:", result)
return result
if __name__ == "__main__":
StringTools().main()
Now I can see that all the options for the ``clean`` command are available with ``count_vowels``:
.. code-block:: bash
python cluey/examples/stringtools.py count-vowels --help
.. code-block:: bash
Usage: stringtools.py count-vowels [OPTIONS] STRING
Counts the number of vowels in the string.
╭─ Arguments ─────────────────────────────────────────────────────╮
│ * string TEXT The string to process. [required] │
╰─────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────╮
│ --strip-accents --no-strip-accents Whether or not to │
│ strip accents. │
│ [default: │
│ no-strip-accents] │
│ --ascii --no-ascii Whether or not to │
│ include only ascii │
│ characters. │
│ [default: no-ascii] │
│ --help Show this message │
│ and exit. │
╰─────────────────────────────────────────────────────────────────╯
.. code-block:: bash
python cluey/examples/stringtools.py count-vowels "Café ☕️" --strip-accents
.. code-block:: bash
Cafe
Vowels: 2
Methods that are not commands
=============================
Not all methods need to be exposed as commands to the command-line interface.
.. code-block:: python
import cluey
class MLApp(cluey.Cluey):
"""A simple machine learning style CLI"""
@cluey.method
def get_batches(
self,
items: list[str] = cluey.Argument(..., help="List of items to process"),
batch_size: int = cluey.Option(
2,
help="Batch size for training and evaluation"
),
):
"""Split items into batches (not a command)."""
batches = [
items[i:i + batch_size]
for i in range(0, len(items), batch_size)
]
return batches
@cluey.main("get_batches")
def train(self, **kwargs):
"""Train a model in batches."""
batches = self.get_batches(**kwargs)
print(f"Training on {len(batches)} batches")
for batch in batches:
print(f"Training on batch: {batch}")
@cluey.main("get_batches")
def evaluate(self, **kwargs):
"""Evaluate a model in batches."""
batches = self.get_batches(**kwargs)
print(f"Evaluating {len(batches)} batches:")
for batch in batches:
print(f"Evaluating on batch: {batch}")
if __name__ == "__main__":
MLApp().main()
Now all the arguments and options for ``get_batches`` are available with ``train`` and ``evaluate`` but ``get_batches`` isn't a command.
.. code-block:: bash
$ python cluey/examples/ml.py --help
Usage: ml.py [OPTIONS] COMMAND [ARGS]...
╭─ Options ───────────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────╮
│ evaluate Evaluate a model in batches. │
│ train Train a model in batches. │
╰─────────────────────────────────────────────────────────────────────────────────────╯
$ python cluey/examples/ml.py train A B C D E
Training on 3 batches
Training on batch: ['A', 'B']
Training on batch: ['C', 'D']
Training on batch: ['E']
$ python cluey/examples/ml.py evaluate F G H I J K L M --batch-size 3
Evaluating 3 batches:
Evaluating on batch: ['F', 'G', 'H']
Evaluating on batch: ['I', 'J', 'K']
Evaluating on batch: ['L', 'M']
Inheritance
===========
Cluey allows you to have base classes and inherit from them to build more complex CLIs.
.. code-block:: python
import cluey
from cluey.examples.ml import MLApp
class ExtendedMLApp(MLApp):
"""Extends MLApp with an extra command"""
@cluey.main("get_batches")
def stats(self, **kwargs):
"""Show batch statistics."""
batches = self.get_batches(**kwargs)
sizes = [len(b) for b in batches]
total = sum(sizes)
print(f"{len(batches)} batches; sizes={sizes}; total_items={total}")
if __name__ == "__main__":
ExtendedMLApp().main()
This app contains all the commands of the base MLApp but it adds the extra ``stats`` command.
.. code-block:: bash
$ python cluey/examples/extendedml.py --help
Usage: extendedml.py [OPTIONS] COMMAND [ARGS]...
╭─ Options ────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────╮
│ evaluate Evaluate a model in batches. │
│ stats Show batch statistics. │
│ train Train a model in batches. │
╰──────────────────────────────────────────────────────────────────────────╯
$ python cluey/examples/extendedml.py stats A B C D E F G H I J K L M
7 batches; sizes=[2, 2, 2, 2, 2, 2, 1]; total_items=13
Calling Super
=============
You can also override methods from the parent class and extend the arguments and options, without redefining the arguments from the ``super`` method.
.. code-block:: python
import cluey
from cluey.examples.ml import MLApp
class ExtendedMLApp(MLApp):
"""Extends MLApp with an extra command"""
@cluey.method('super')
def get_batches(
self,
lowercase:bool=cluey.Option(False, help="Whether or not to lowercase items."),
**kwargs,
):
"""Split items into batches and optionally lowercase them."""
batches = super().get_batches(**kwargs)
if lowercase:
batches = [[item.lower() for item in batch] for batch in batches]
return batches
@cluey.main("get_batches")
def stats(self, **kwargs):
"""Show batch statistics."""
batches = self.get_batches(**kwargs)
sizes = [len(b) for b in batches]
total = sum(sizes)
print(f"{len(batches)} batches; sizes={sizes}; total_items={total}")
if __name__ == "__main__":
ExtendedMLApp().main()
Adding executable script using Poetry
=====================================
If you use Poetry as your package manager, you can add an executable script to your project by modifying the `pyproject.toml` file:
.. code-block:: toml
[tool.poetry.scripts]
cluey-example-extendedml = "cluey.examples.extendedml:ExtendedMLApp.main"
This will create a command-line script named `cluey-example-extendedml` that runs the `ExtendedMLApp` application.
A separate tools CLI
====================
Sometimes you want your main app to be a single command CLI, but you also want to provide a separate CLI executable with several helper subcommands.
.. code-block:: python
import cluey
from cluey.examples.ml import MLApp
class ProductionMLApp(MLApp):
"""Extends MLApp with an extra command"""
@cluey.main("get_batches")
def predict(self, **kwargs):
"""Predict using model in batches."""
batches = self.get_batches(**kwargs)
print(f"Evaluating {len(batches)} batches:")
for batch in batches:
print(f"Evaluating on batch: {batch}")
@cluey.tool("super")
def train(self, **kwargs):
"""Train the model."""
return super().train(**kwargs)
@cluey.tool("super")
def evaluate(self, **kwargs):
"""Evaluate the model."""
return super().evaluate(**kwargs)
@cluey.tool()
def cite(self, **kwargs):
"""Cite this model."""
print("Please cite the paper: Turnbull, Robert, 'Cluey: A Command Line Utility for Engineers and You', Fantastic Journal (2025), 1–25.")
if __name__ == "__main__":
ProductionMLApp().main()
This overrides the ``train`` and ``evaluate`` commands to turn them into tools instead of being on the main CLI. Then it adds a new tool.
You can create executables for both the main app and the tools app using Poetry:
.. code-block:: toml
[tool.poetry.scripts]
cluey-example-productionml = "cluey.examples.productionml:ProductionMLApp.main"
cluey-example-productionml-tools = "cluey.examples.productionml:ProductionMLApp.tools"
This allows the following:
.. code-block:: bash
$ cluey-example-productionml predict --help
Usage: cluey-example-productionml [OPTIONS] ITEMS...
Predict using model in batches.
╭─ Arguments ──────────────────────────────────────────────────────────────────────────╮
│ * items ITEMS... List of items to process [required] │
╰──────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────╮
│ --batch-size INTEGER Batch size for training and evaluation [default: 2] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────╯
$ cluey-example-productionml-tools --help
Usage: cluey-example-productionml-tools [OPTIONS] COMMAND [ARGS]...
╭─ Options ────────────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────╮
│ cite Cite this model. │
│ evaluate Evaluate the model. │
│ predict Predict using model in batches. │
│ train Train the model. │
╰──────────────────────────────────────────────────────────────────────────────────────╯
.. end-quickstart
Credits
=======================
.. start-credits
Cluey was created created by `Robert Turnbull <https://robturnbull.com>`_ with contributions from Wytamma Wirth and Ashkan Pakzad.
.. end-credits
Raw data
{
"_id": null,
"home_page": "https://github.com/rbturnbull/cluey",
"name": "cluey",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "command-line interface",
"author": "Robert Turnbull",
"author_email": "robert.turnbull@unimelb.edu.au",
"download_url": "https://files.pythonhosted.org/packages/55/c0/b3fa99b970282de2d09f2a330704075af917b2a6d298ee28292557a4f93c/cluey-0.1.0.tar.gz",
"platform": null,
"description": "==========\ncluey\n==========\n\n.. start-badges\n\n|pypi badge| |testing badge| |coverage badge| |docs badge| |black badge| |git3moji badge| |cluey badge|\n\n.. |pypi badge| image:: https://img.shields.io/pypi/v/cluey?color=blue\n :alt: PyPI - Version\n :target: https://pypi.org/project/cluey/\n\n.. |cluey badge| image:: https://img.shields.io/badge/cluey-B1230A.svg\n :target: https://rbturnbull.github.io/cluey/\n\n.. |testing badge| image:: https://github.com/rbturnbull/cluey/actions/workflows/testing.yml/badge.svg\n :target: https://github.com/rbturnbull/cluey/actions\n\n.. |docs badge| image:: https://github.com/rbturnbull/cluey/actions/workflows/docs.yml/badge.svg\n :target: https://rbturnbull.github.io/cluey\n \n.. |black badge| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n \n.. |coverage badge| image:: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/rbturnbull/b84e24e6b58498cfcdd7f19388e111ad/raw/coverage-badge.json\n :target: https://rbturnbull.github.io/cluey/coverage/\n\n.. |git3moji badge| image:: https://img.shields.io/badge/git3moji-%E2%9A%A1%EF%B8%8F%F0%9F%90%9B%F0%9F%93%BA%F0%9F%91%AE%F0%9F%94%A4-fffad8.svg\n :target: https://robinpokorny.github.io/git3moji/\n\n.. end-badges\n\n**Cluey - Command Line Utility for Engineers & You**\n\nBuild clever, class-based command line apps with minimal boilerplate\n\nDocumentation at https://rbturnbull.github.io/cluey/\n\n\n.. start-quickstart\n\nInstallation\n=======================\n\nThe software can be installed using ``pip``\n\n.. code-block:: bash\n\n pip install cluey\n\nTo install the latest version from the repository, you can use this command:\n\n.. code-block:: bash\n\n pip install git+https://github.com/rbturnbull/cluey.git\n\nDocumentation is available here: https://rbturnbull.github.io/cluey/\n\nYour first Cluey CLI\n=======================\n\nHere is a minimal example of a Cluey CLI app:\n\n.. code-block:: Python\n\n import cluey\n\n class GreetApp(cluey.Cluey):\n \"\"\"A minimal Cluey CLI app\"\"\"\n\n @cluey.main\n def greet(self, name: str = cluey.Argument(..., help=\"\")):\n \"\"\"Greet a person by name\"\"\"\n print(f\"Hello, {name}!\")\n\n\n if __name__ == \"__main__\":\n GreetApp().main()\n\n\nThen you can run this:\n\n.. code-block:: bash\n\n python cluey/examples/greet.py --help\n\nWhich will display:\n\n.. code-block:: bash\n\n \u256d\u2500 Arguments \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 * name TEXT The name of the person to greet [required] \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n \u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 --version -v Show the version of this CLI \u2502\n \u2502 --help Show this message and exit. \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\nTo run the app,\n\n.. code-block:: bash\n\n python cluey/examples/cluey/examples/greet.py Alice\n\nThis will display:\n\n.. code-block:: bash\n\n Hello, Alice!\n\nAdding a flag\n=================\n\n.. code-block:: python\n\n import cluey\n\n class GreetApp(cluey.Cluey):\n \"\"\"A minimal Cluey CLI app\"\"\"\n\n @cluey.main\n def greet(self, name: str = cluey.Argument(..., help=\"The name of the person to greet\")):\n \"\"\"Greet a person by name\"\"\"\n print(f\"Hello, {name}!\")\n\n @cluey.flag(shortcut=\"-v\")\n def version(self) -> str:\n \"\"\"Show the version of this CLI\"\"\"\n return \"GreetApp version 0.1.0\"\n\n\n if __name__ == \"__main__\":\n GreetApp().main() \n\n\nTo display the version of the app, run:\n\n.. code-block :: bash\n\n python cluey/examples/greet.py --version\n # OR\n python cluey/examples/greet.py -v\n\n\nAdding a second command\n=======================\n\n.. code-block:: python\n\n import cluey\n\n class ArithmeticApp(cluey.Cluey):\n \"\"\" Does basic arithmetic \"\"\"\n\n @cluey.main\n def add(\n self, \n a: float = cluey.Argument(..., help=\"A value to start with.\"),\n b: float = cluey.Argument(..., help=\"A value to add.\"),\n ):\n \"\"\" Sums two values \"\"\"\n print(a+b)\n\n @cluey.main\n def subtract(\n self, \n a: float = cluey.Argument(..., help=\"A value to start with.\"),\n b: float = cluey.Argument(..., help=\"A value to sub.\"),\n ):\n \"\"\" Subtracts one value from another \"\"\"\n print(a-b)\n\n\n if __name__ == \"__main__\":\n ArithmeticApp().main()\n\nThen you can run the following:\n\n.. code-block :: bash\n \n python cluey/examples/arithmetic.py --help\n python cluey/examples/arithmetic.py add --help\n python cluey/examples/arithmetic.py subtract --help\n python cluey/examples/arithmetic.py add 3 2\n python cluey/examples/arithmetic.py subtract 3 2\n\nAdd options with defaults\n=========================\n\n.. code-block:: python\n\n import unicodedata\n import cluey\n\n\n class StringTools(cluey.Cluey):\n \"\"\" Does simple string functions \"\"\"\n @cluey.main\n def lowercase(\n self,\n string: str = cluey.Argument(..., help=\"The string to process.\"),\n ) -> str:\n \"\"\"Converts the string to lowercase.\"\"\"\n string = string.lower()\n print(string)\n return string\n\n @cluey.main\n def clean(\n self, \n string: str = cluey.Argument(..., help=\"The string to process.\"),\n strip_accents:bool = cluey.Option(False, help=\"Whether or not to strip accents.\"),\n ascii:bool = cluey.Option(False, help=\"Whether or not to include only ascii characters.\"),\n ) -> str:\n \"\"\"Cleans the given string.\"\"\"\n if strip_accents:\n string = ''.join(\n character for character in unicodedata.normalize('NFKD', string)\n if not unicodedata.combining(character)\n )\n \n if ascii:\n string = ''.join(character for character in string if character.isascii())\n \n print(string)\n return string\n\n\n if __name__ == \"__main__\":\n StringTools().main() \n\n\nNow the optional arguments can be set via the command line:\n\n.. code-block:: bash\n\n python cluey/examples/stringtools.py clean \"Caf\u00e9 \u2615\ufe0f\" --strip-accents --ascii\n\n Cafe\n\n\nCall one method from another\n============================\n\nSo far, all of the above could have been done more easily with Typer, but with Cluey, \nyou are able to call one method from another and the function arguments get passed to the command line.\n\n.. code-block:: python\n\n import unicodedata\n import cluey\n\n\n class StringTools(cluey.Cluey):\n \"\"\" Does simple string functions \"\"\"\n\n @cluey.main\n def clean(\n self, \n string: str = cluey.Argument(..., help=\"The string to process.\"),\n strip_accents:bool = cluey.Option(True, help=\"Whether or not to strip accents.\"),\n ascii:bool = cluey.Option(False, help=\"Whether or not to include only ascii characters.\"),\n ) -> str:\n \"\"\"Cleans the given string.\"\"\"\n if strip_accents:\n string = ''.join(\n character for character in unicodedata.normalize('NFKD', string)\n if not unicodedata.combining(character)\n )\n \n if ascii:\n string = ''.join(character for character in string if character.isascii())\n \n print(string)\n return string\n\n @cluey.main('clean')\n def count_vowels(self, string: str, **kwargs) -> int:\n \"\"\"Counts the number of vowels in the string.\"\"\"\n \n string = self.clean(string, **kwargs).lower()\n\n result = sum(1 for character in string if character in 'aeiou')\n print(\"Vowels:\", result)\n return result\n\n\n if __name__ == \"__main__\":\n StringTools().main()\n\n\nNow I can see that all the options for the ``clean`` command are available with ``count_vowels``:\n\n.. code-block:: bash\n\n python cluey/examples/stringtools.py count-vowels --help\n\n.. code-block:: bash\n \n Usage: stringtools.py count-vowels [OPTIONS] STRING \n \n Counts the number of vowels in the string. \n \n \u256d\u2500 Arguments \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 * string TEXT The string to process. [required] \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n \u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 --strip-accents --no-strip-accents Whether or not to \u2502\n \u2502 strip accents. \u2502\n \u2502 [default: \u2502\n \u2502 no-strip-accents] \u2502\n \u2502 --ascii --no-ascii Whether or not to \u2502\n \u2502 include only ascii \u2502\n \u2502 characters. \u2502\n \u2502 [default: no-ascii] \u2502\n \u2502 --help Show this message \u2502\n \u2502 and exit. \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\n.. code-block:: bash\n\n python cluey/examples/stringtools.py count-vowels \"Caf\u00e9 \u2615\ufe0f\" --strip-accents\n\n.. code-block:: bash\n\n Cafe\n Vowels: 2\n\n\nMethods that are not commands\n=============================\n\nNot all methods need to be exposed as commands to the command-line interface.\n\n.. code-block:: python\n\n import cluey\n\n class MLApp(cluey.Cluey):\n \"\"\"A simple machine learning style CLI\"\"\"\n\n @cluey.method\n def get_batches(\n self,\n items: list[str] = cluey.Argument(..., help=\"List of items to process\"),\n batch_size: int = cluey.Option(\n 2,\n help=\"Batch size for training and evaluation\"\n ),\n ):\n \"\"\"Split items into batches (not a command).\"\"\"\n batches = [\n items[i:i + batch_size]\n for i in range(0, len(items), batch_size)\n ]\n return batches\n\n @cluey.main(\"get_batches\")\n def train(self, **kwargs):\n \"\"\"Train a model in batches.\"\"\"\n batches = self.get_batches(**kwargs)\n print(f\"Training on {len(batches)} batches\")\n for batch in batches:\n print(f\"Training on batch: {batch}\")\n\n @cluey.main(\"get_batches\")\n def evaluate(self, **kwargs):\n \"\"\"Evaluate a model in batches.\"\"\"\n batches = self.get_batches(**kwargs)\n print(f\"Evaluating {len(batches)} batches:\")\n for batch in batches:\n print(f\"Evaluating on batch: {batch}\")\n\n\n if __name__ == \"__main__\":\n MLApp().main()\n\nNow all the arguments and options for ``get_batches`` are available with ``train`` and ``evaluate`` but ``get_batches`` isn't a command.\n\n.. code-block:: bash\n\n $ python cluey/examples/ml.py --help\n\n Usage: ml.py [OPTIONS] COMMAND [ARGS]... \n \n \u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 --help Show this message and exit. \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n \u256d\u2500 Commands \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 evaluate Evaluate a model in batches. \u2502\n \u2502 train Train a model in batches. \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f \n\n $ python cluey/examples/ml.py train A B C D E\n Training on 3 batches\n Training on batch: ['A', 'B']\n Training on batch: ['C', 'D']\n Training on batch: ['E']\n\n $ python cluey/examples/ml.py evaluate F G H I J K L M --batch-size 3\n Evaluating 3 batches:\n Evaluating on batch: ['F', 'G', 'H']\n Evaluating on batch: ['I', 'J', 'K']\n Evaluating on batch: ['L', 'M']\n\nInheritance\n===========\n\nCluey allows you to have base classes and inherit from them to build more complex CLIs.\n\n.. code-block:: python\n\n import cluey\n from cluey.examples.ml import MLApp\n\n\n class ExtendedMLApp(MLApp):\n \"\"\"Extends MLApp with an extra command\"\"\"\n\n @cluey.main(\"get_batches\")\n def stats(self, **kwargs):\n \"\"\"Show batch statistics.\"\"\"\n batches = self.get_batches(**kwargs)\n sizes = [len(b) for b in batches]\n total = sum(sizes)\n print(f\"{len(batches)} batches; sizes={sizes}; total_items={total}\")\n\n\n if __name__ == \"__main__\":\n ExtendedMLApp().main()\n\nThis app contains all the commands of the base MLApp but it adds the extra ``stats`` command.\n\n.. code-block:: bash\n\n $ python cluey/examples/extendedml.py --help\n\n Usage: extendedml.py [OPTIONS] COMMAND [ARGS]... \n \n \u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 --help Show this message and exit. \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n \u256d\u2500 Commands \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 evaluate Evaluate a model in batches. \u2502\n \u2502 stats Show batch statistics. \u2502\n \u2502 train Train a model in batches. \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f \n\n $ python cluey/examples/extendedml.py stats A B C D E F G H I J K L M\n\n 7 batches; sizes=[2, 2, 2, 2, 2, 2, 1]; total_items=13\n\nCalling Super\n=============\n\nYou can also override methods from the parent class and extend the arguments and options, without redefining the arguments from the ``super`` method.\n\n.. code-block:: python\n\n import cluey\n from cluey.examples.ml import MLApp\n\n\n class ExtendedMLApp(MLApp):\n \"\"\"Extends MLApp with an extra command\"\"\"\n\n @cluey.method('super')\n def get_batches(\n self,\n lowercase:bool=cluey.Option(False, help=\"Whether or not to lowercase items.\"),\n **kwargs,\n ):\n \"\"\"Split items into batches and optionally lowercase them.\"\"\"\n batches = super().get_batches(**kwargs)\n if lowercase:\n batches = [[item.lower() for item in batch] for batch in batches]\n return batches\n\n @cluey.main(\"get_batches\")\n def stats(self, **kwargs):\n \"\"\"Show batch statistics.\"\"\"\n batches = self.get_batches(**kwargs)\n sizes = [len(b) for b in batches]\n total = sum(sizes)\n print(f\"{len(batches)} batches; sizes={sizes}; total_items={total}\")\n\n\n if __name__ == \"__main__\":\n ExtendedMLApp().main()\n\n\nAdding executable script using Poetry\n=====================================\n\nIf you use Poetry as your package manager, you can add an executable script to your project by modifying the `pyproject.toml` file:\n\n.. code-block:: toml\n\n [tool.poetry.scripts]\n cluey-example-extendedml = \"cluey.examples.extendedml:ExtendedMLApp.main\"\n\nThis will create a command-line script named `cluey-example-extendedml` that runs the `ExtendedMLApp` application.\n\n\nA separate tools CLI\n====================\n\nSometimes you want your main app to be a single command CLI, but you also want to provide a separate CLI executable with several helper subcommands.\n\n\n.. code-block:: python\n\n import cluey\n from cluey.examples.ml import MLApp\n\n\n class ProductionMLApp(MLApp):\n \"\"\"Extends MLApp with an extra command\"\"\"\n\n @cluey.main(\"get_batches\")\n def predict(self, **kwargs):\n \"\"\"Predict using model in batches.\"\"\"\n batches = self.get_batches(**kwargs)\n print(f\"Evaluating {len(batches)} batches:\")\n for batch in batches:\n print(f\"Evaluating on batch: {batch}\")\n\n @cluey.tool(\"super\")\n def train(self, **kwargs):\n \"\"\"Train the model.\"\"\"\n return super().train(**kwargs)\n\n @cluey.tool(\"super\")\n def evaluate(self, **kwargs):\n \"\"\"Evaluate the model.\"\"\"\n return super().evaluate(**kwargs)\n\n @cluey.tool()\n def cite(self, **kwargs):\n \"\"\"Cite this model.\"\"\"\n print(\"Please cite the paper: Turnbull, Robert, 'Cluey: A Command Line Utility for Engineers and You', Fantastic Journal (2025), 1\u201325.\")\n\n\n if __name__ == \"__main__\":\n ProductionMLApp().main()\n\nThis overrides the ``train`` and ``evaluate`` commands to turn them into tools instead of being on the main CLI. Then it adds a new tool.\nYou can create executables for both the main app and the tools app using Poetry:\n\n.. code-block:: toml\n\n [tool.poetry.scripts]\n cluey-example-productionml = \"cluey.examples.productionml:ProductionMLApp.main\"\n cluey-example-productionml-tools = \"cluey.examples.productionml:ProductionMLApp.tools\"\n\nThis allows the following:\n\n.. code-block:: bash\n\n $ cluey-example-productionml predict --help\n Usage: cluey-example-productionml [OPTIONS] ITEMS... \n \n Predict using model in batches. \n \n \u256d\u2500 Arguments \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 * items ITEMS... List of items to process [required] \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n \u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 --batch-size INTEGER Batch size for training and evaluation [default: 2] \u2502\n \u2502 --help Show this message and exit. \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\n $ cluey-example-productionml-tools --help\n Usage: cluey-example-productionml-tools [OPTIONS] COMMAND [ARGS]... \n \n \u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 --help Show this message and exit. \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n \u256d\u2500 Commands \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n \u2502 cite Cite this model. \u2502\n \u2502 evaluate Evaluate the model. \u2502\n \u2502 predict Predict using model in batches. \u2502\n \u2502 train Train the model. \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\n.. end-quickstart\n\nCredits\n=======================\n\n.. start-credits\n\nCluey was created created by `Robert Turnbull <https://robturnbull.com>`_ with contributions from Wytamma Wirth and Ashkan Pakzad.\n\n.. end-credits",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Build clever, class-based command line apps with minimal boilerplate.",
"version": "0.1.0",
"project_urls": {
"Documentation": "https://rbturnbull.github.io/cluey/",
"Homepage": "https://github.com/rbturnbull/cluey",
"Repository": "https://github.com/rbturnbull/cluey"
},
"split_keywords": [
"command-line",
"interface"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4577881676914a9e7e446a57f95d4ac3542082ea912a3cbbfdcd81f341415daa",
"md5": "4f9443605a9ca1474746a17ee89fe78d",
"sha256": "ade7e297bbd6d50b45751dcc32c68a682855adeb24c5ab34fcae2b36d9d8a475"
},
"downloads": -1,
"filename": "cluey-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4f9443605a9ca1474746a17ee89fe78d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 17111,
"upload_time": "2025-09-02T02:53:37",
"upload_time_iso_8601": "2025-09-02T02:53:37.857126Z",
"url": "https://files.pythonhosted.org/packages/45/77/881676914a9e7e446a57f95d4ac3542082ea912a3cbbfdcd81f341415daa/cluey-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "55c0b3fa99b970282de2d09f2a330704075af917b2a6d298ee28292557a4f93c",
"md5": "73c479c602a4318a53a4463738a5b39f",
"sha256": "f772b1c4b1f5cd0e18eaa779ed2f6aa718033d0a7f54c5fc93b1df7dba2aa884"
},
"downloads": -1,
"filename": "cluey-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "73c479c602a4318a53a4463738a5b39f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 16351,
"upload_time": "2025-09-02T02:53:39",
"upload_time_iso_8601": "2025-09-02T02:53:39.431748Z",
"url": "https://files.pythonhosted.org/packages/55/c0/b3fa99b970282de2d09f2a330704075af917b2a6d298ee28292557a4f93c/cluey-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-02 02:53:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rbturnbull",
"github_project": "cluey",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "cluey"
}