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.3.tar.gz (79.6 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.3-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

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

Hashes for dony-0.1.3.tar.gz
Algorithm Hash digest
SHA256 79b9dcfcc7caff12d161288aa91ded70d07803b3c776408d965c44edd35bb360
MD5 608ffa8c58df2696c3079084aad5cc39
BLAKE2b-256 99c63ac199f11525db55ab74c27a53e1ed3362afc40a6e057b1b4540845acb37

See more details on using hashes here.

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

Hashes for dony-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d50351960b65704a6a6b66d87ad9dff65df59fff76cb108c3707bbd8d5416bd2
MD5 a48bf351f365ceafaea151ddb1d560d6
BLAKE2b-256 e88f6b697dcc04759a1f0316240934301b82a608f7a9a001ae41358be40aef86

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