Lightweight Python task runner that just gets it
Project description
🧙♂️ dony
A lightweight Python command runner providing a simple, consistent workflow for managing and executing project
commands. dony serves as an alternative to Justfile, leveraging Python for flexibility and extensibility.
Installation
Install via pipx:
pipx install dony
Ensure you have the following prerequisites:
- Python 3.8 or higher
pipxfor isolated installation (brew install pipxon macOSfzffor fuzzy command selection (brew install fzfon macOS)
Getting Started
Initialize your project:
dony init
This creates a dony/ directory containing:
- A
commands/directory containing a sample command - A virtual environment (
uv/directory)
Run commands interactively:
dony
Run a command directly:
dony <command_name> [--arg1 value --arg2 value]
Defining Commands
Create commands as Python functions. All parameters must have defaults to allow invocation without explicit arguments.
# dony/commands/my_global_command.py
from marklidenberg.dony import dony
@dony.command(path='my/custom/path')
def greet(
greeting: str = 'Hello',
suffix: str = lambda: ',',
real_greeting: str = lambda kwargs: kwargs['greeting'] + kwargs['suffix'],
name: str = lambda: dony.input('What is your name?')
):
dony.shell(f"echo {real_greeting}, {name}!")
- All arguments should have to be
strorList[str]for now. I plan to add support for other types in the future @dony.command(path)registers the function under a custom path (defaults to file-relative path).- Default values may be literals or callables:
- Simple defaults (
'Hello') - Lazily-evaluated callables (
lambda: ...) - Access to other arguments via
kwargs - Interactive prompts via
dony.input, select, confirm, etc.
- Simple defaults (
dony.shell(...)runs shell commands and raises on errors.
Project Structure
dony/
├── uv/ # virtual environment
├── commands/ # command modules
│ ├── my_global_command.py # single-file command
│ ├── my-service/ # grouped commands
│ │ ├── service_task.py # one command per file
│ │ └── _helper.py # private module (ignored)
- Files and directories under
commands/define your CLI tasks. - Files or folders prefixed with
_are excluded from discovery.
Udony Examples
Run an interactive command list:
dony
Execute a specific command:
dony my/custom/path --greeting Hi --suffix "!"
Combined with arguments and environment variables:
dony build --env production
Advanced Features
- Fuzzy search via
fzffor rapid command lookup. - Interactive prompts (
input,select,confirm) powered byquestionary. - Customizable command namespaces and paths.
License
MIT License. See LICENSE for details.
Author
Mark Lidenberg marklidenberg@gmail.com
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dony-0.1.0.tar.gz.
File metadata
- Download URL: dony-0.1.0.tar.gz
- Upload date:
- Size: 42.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0664bfbcbb56e6e69512ead2eabf0b1e7e92673747c4ef476d29c9cc6ac92cb5
|
|
| MD5 |
c78a2ca371ec60e8ca8d0f8b64ed6b9c
|
|
| BLAKE2b-256 |
b5e222fc36c98bf85f1e842860964af4360a49cbac51d232f9bdf57d9ddcdf35
|
File details
Details for the file dony-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dony-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94143f8fa71f9aae0e02d79ab8ea1cb46e6b4f664261627c965dc9667129ae1d
|
|
| MD5 |
be42d73b664cee42caf9e9bce5cb3762
|
|
| BLAKE2b-256 |
8383864a7b1488c88c82948a3c96e6fe150c1bc15f3ee8987b07770c69706c53
|