Skip to main content

Define custom scripts in your pyproject.toml and easily run them with this dependency free tool.

Project description

PyPI Version GitHub Release Version TOML Python Version PyPI Downloads Pepy Total Downloads Codecov Workflow Lint Workflow Test Deployment PyPi Deployment Docs GitHub Last Commit GitHub Repo Size GitHub Top Language GitHub Contributors GitHub Issues GitHub Discussions GitHub Forks GitHub Repo Stars GitHub Org Stars Discord Ko-fi

TOML Run

TOML Run

Define custom scripts in your pyproject.toml and easily run them with this dependency free tool. This tool is both inspired by and similar to NPM Scripts.

If you run into any issues or have any questions, support is available.

To get started Install the cli and view the Usage.

View Documentation

Features

  • Define scripts in your pyproject.toml
  • Easily run scripts with run [name]
  • Cross-platform support using subprocess
  • Supports pre and post scripts
  • Supports multiple commands per script
  • Pass additional arguments to scripts
  • Automatically finds the pyproject.toml
  • Runs scripts relative to the root directory
  • Evaluate python code 🧪 (experimental)

View Full Reference

Install

From PyPI: https://pypi.org/p/toml-run

pip install toml-run
pip install --group dev toml-run

uv tool install toml-run
uv add --dev toml-run

View Install Guide

Usage

First, add some scripts to the pyproject.toml using the [tool.scripts] section.

[tool.scripts]
prepare = "python scripts/prepare.py"
build = "run prepare && uv run hatch build"
prelint = "echo always runs before lint"
lint = ["black --check .", "ruff check ."]
postlint = "echo always runs after lint"
format = """
black .
ruff format .
"""
clean = "#py shutil.rmtree('.cache', True)"

View Scripts Guide

Run scripts with the run command.

run build

List available scripts with --list.

run -l

Run without installing using astral-sh/uv.

uvx toml-run build

View Usage Guide

Support

If you run into any issues or need help getting started, please do one of the following:

Features Issues Discussions Discord

Contributing

If you would like to submit a PR, please review the CONTRIBUTING.md.

Please consider making a donation to support the development of this project and additional open source projects.

Ko-fi

For a full list of current projects visit: https://cssnr.github.io/

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

toml_run-0.0.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

toml_run-0.0.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file toml_run-0.0.2.tar.gz.

File metadata

  • Download URL: toml_run-0.0.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for toml_run-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f94ef95267c2aee45c12121993b0a85cdd614c60a54e90542753226ed41d8b86
MD5 215269cc4062c886d6b5d6a7731f8d82
BLAKE2b-256 049fcc38ec7c7b94fbba9c50d9e1b0b7f0c08700a58d054ef8ad996d20b66415

See more details on using hashes here.

Provenance

The following attestation bundles were made for toml_run-0.0.2.tar.gz:

Publisher: release.yaml on cssnr/toml-run

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file toml_run-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: toml_run-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for toml_run-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0d473dfa384c2ce73e45a1152e20a4c75ce9f1dbff4de5ef5dd0a77d36c8032a
MD5 56d85cb2603493e1fcd1e32f3c0c7009
BLAKE2b-256 de9490edff2fdd55d29e5bec9633b6783017815ede6390278d260b219adbcffb

See more details on using hashes here.

Provenance

The following attestation bundles were made for toml_run-0.0.2-py3-none-any.whl:

Publisher: release.yaml on cssnr/toml-run

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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