Lightweight Python task runner that just gets it
Project description
🍥️ dony
A lightweight Python command runner with simple and consistent workflow for managing project
commands. A Justfile alternative.
How it works
Define your commands in dony/ in the root of your project.
# dony/commands/hello_world.py
import dony
@dony.command()
def hello_world(name: str = "John"):
print(f"Hello, {name}!")
Run dony to fuzzy-search your commands from anywhere in your project.
Common use cases: build, release, publish, test, deploy, configure, format, run static analyzers, manage databases, generate documentation, run benchmarks, get useful links, create release notes and much more
Defining Commands
Create commands as Python functions
import dony
@dony.command()
def greet(
greeting: str = 'Hello',
name: str = None
):
name = name or dony.input('What is your name?')
dony.shell(f"echo {greeting}, {name}!")
- All parameters must provide defaults to allow invocation with no arguments, and any missing values should be requested via user prompts
- Currently, only str and List[str] parameter types are supported.
Running commands
Run commands interactively:
dony
Run commands directly:
dony <command_name> [--arg1 value --arg2 value]
Installation
Ensure you have the following prerequisites:
- Python 3.8 or higher
pipxfor isolated installation (brew install pipxon macOS)fzffor fuzzy command selection (brew install fzfon macOS)
Then install the package with pipx:
pipx install dony
Initialize your project:
dony --init
This creates a dony/ directory:
- A
commands/directory containing a sample command - A dedicated
uvvirtual environment
Dony directory structure
dony/
... (uv environment)
├── commands/
│ ├── my_global_command.py # one command per file
│ ├── my-service/
│ │ ├── service_command.py # will be displayed as `my-service/service_command`
│ │ └── _helper.py # private module (ignored)
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.3.tar.gz.
File metadata
- Download URL: dony-0.1.3.tar.gz
- Upload date:
- Size: 79.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79b9dcfcc7caff12d161288aa91ded70d07803b3c776408d965c44edd35bb360
|
|
| MD5 |
608ffa8c58df2696c3079084aad5cc39
|
|
| BLAKE2b-256 |
99c63ac199f11525db55ab74c27a53e1ed3362afc40a6e057b1b4540845acb37
|
File details
Details for the file dony-0.1.3-py3-none-any.whl.
File metadata
- Download URL: dony-0.1.3-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d50351960b65704a6a6b66d87ad9dff65df59fff76cb108c3707bbd8d5416bd2
|
|
| MD5 |
a48bf351f365ceafaea151ddb1d560d6
|
|
| BLAKE2b-256 |
e88f6b697dcc04759a1f0316240934301b82a608f7a9a001ae41358be40aef86
|