Skip to main content

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
  • pipx for isolated installation (brew install pipx on macOS)
  • fzf for fuzzy command selection (brew install fzf on 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 uv virtual 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dony-0.1.2.tar.gz (109.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dony-0.1.2-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file dony-0.1.2.tar.gz.

File metadata

  • Download URL: dony-0.1.2.tar.gz
  • Upload date:
  • Size: 109.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for dony-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6382823c2d8b215bf8266d2adbd1d5d08aaf94d282f77f65b3d127a8a035f8a7
MD5 d2d181b2379e483ecdba8bf34d8f24a2
BLAKE2b-256 8d92ae876a896a41bc65f3129c301059dfa21537f70552cb87c209915b0fa5a7

See more details on using hashes here.

File details

Details for the file dony-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dony-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for dony-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4da55350b664ccfa36ad2372932621c68fb10578dd71abd913723512c40d3edc
MD5 361cc4757c0f6192910c72cd92d5f794
BLAKE2b-256 e5847f823149233df0d5b9c45734f0feafbb6a3161faf0dd488937ebefaa35f9

See more details on using hashes here.

Supported by

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