Skip to main content

Tool to generate python -c bash as if it were a package format.

Project description

dashc

Tool to generate python -c bash scripts as if they were a package format.


About

dashc lets you bundle Python source code (a single file or an entire package) into a executable shell script. Instead of shipping loose files, you can hand over a bash command (or .sh script) that self-contains your Python logic and runs without needing to touch the filesystem.

Features:

  • Single file mode – wrap a single .py into a compressed string or plain text.
  • Module mode – zip up a package with __main__.py or a specified module:function entrypoint.
  • Bash-friendly – outputs either a plain (python -c '...') or a script with a shebang.
  • Validates syntax – checks both Python and Bash syntax before generating.

Installation

It is recommended to install with pipx:

pipx install dashc

This keeps dashc isolated in its own environment while making the CLI available globally.


Usage

Run with:

dashc [--version] [--verbose|--quiet|--dry-run] <command> [options]

Global options:

  • --version – show version
  • --verbose – debug logging
  • --quiet – suppress logs except errors
  • --dry-run – simulate actions without writing files

Commands

  • file – Compile a single .py into a script.
  • module – Package a directory and run __main__.py or a chosen entrypoint.

Example

Single file to script:

dashc file send_email.py --out run_send_email.sh
./run_send_email.sh --to test@example.com

Single file to script:

dashc file send_email.py --one-line
# -> prints a bash command like: python -c '...'

Module with __main__.py:

dashc module ./send_email --out run_pkg.sh
./run_pkg.sh --config config.yaml

Module with function entrypoint:

dashc module ./send_email --entrypoint send_email.cli:main --out run_cli.sh
./run_cli.sh --to test@example.com

Prior Art / Alternatives

  • zipapp (python -m zipapp) – Standard library tool for packaging Python code into .pyz archives runnable with Python.
  • shiv, pex – Build self-contained Python executables with full dependency resolution.
  • pyinstaller – Freezes Python programs into standalone executables.

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

dashc-0.1.1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

dashc-0.1.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file dashc-0.1.1.tar.gz.

File metadata

  • Download URL: dashc-0.1.1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dashc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f40a8f0290c944adbb947d2f2a13d03d46bc4988cd0bb4665f34d7eefcb00302
MD5 ccee497ad6c91c508a5786e9e24c3bf6
BLAKE2b-256 e2907a9b3be9d44a312c3c5e77245343e2ff2f7745aa4983c5c84560d2369025

See more details on using hashes here.

Provenance

The following attestation bundles were made for dashc-0.1.1.tar.gz:

Publisher: publish_to_pypi.yml on matthewdeanmartin/dashc

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

File details

Details for the file dashc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dashc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dashc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 76a444dabc2563f4a3251a3d066c2dc69b9e6a6d1adb2c1ee6bee740d02e2541
MD5 ff91f17e6cb499441030f93bdf3ed2e4
BLAKE2b-256 b7b0fa8a931913611f166ebb3852bcd08bb440b0b837112c43607b3c88882b95

See more details on using hashes here.

Provenance

The following attestation bundles were made for dashc-0.1.1-py3-none-any.whl:

Publisher: publish_to_pypi.yml on matthewdeanmartin/dashc

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