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
.pyinto a compressed string or plain text. - Module mode – zip up a package with
__main__.pyor a specifiedmodule:functionentrypoint. - 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.pyinto a script.module– Package a directory and run__main__.pyor 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.pyzarchives runnable with Python. - shiv, pex – Build self-contained Python executables with full dependency resolution.
- pyinstaller – Freezes Python programs into standalone executables.
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f40a8f0290c944adbb947d2f2a13d03d46bc4988cd0bb4665f34d7eefcb00302
|
|
| MD5 |
ccee497ad6c91c508a5786e9e24c3bf6
|
|
| BLAKE2b-256 |
e2907a9b3be9d44a312c3c5e77245343e2ff2f7745aa4983c5c84560d2369025
|
Provenance
The following attestation bundles were made for dashc-0.1.1.tar.gz:
Publisher:
publish_to_pypi.yml on matthewdeanmartin/dashc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dashc-0.1.1.tar.gz -
Subject digest:
f40a8f0290c944adbb947d2f2a13d03d46bc4988cd0bb4665f34d7eefcb00302 - Sigstore transparency entry: 454750824
- Sigstore integration time:
-
Permalink:
matthewdeanmartin/dashc@a6c801bd08d3d71ddced703d8bf518f1a45cad55 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/matthewdeanmartin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@a6c801bd08d3d71ddced703d8bf518f1a45cad55 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76a444dabc2563f4a3251a3d066c2dc69b9e6a6d1adb2c1ee6bee740d02e2541
|
|
| MD5 |
ff91f17e6cb499441030f93bdf3ed2e4
|
|
| BLAKE2b-256 |
b7b0fa8a931913611f166ebb3852bcd08bb440b0b837112c43607b3c88882b95
|
Provenance
The following attestation bundles were made for dashc-0.1.1-py3-none-any.whl:
Publisher:
publish_to_pypi.yml on matthewdeanmartin/dashc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dashc-0.1.1-py3-none-any.whl -
Subject digest:
76a444dabc2563f4a3251a3d066c2dc69b9e6a6d1adb2c1ee6bee740d02e2541 - Sigstore transparency entry: 454750825
- Sigstore integration time:
-
Permalink:
matthewdeanmartin/dashc@a6c801bd08d3d71ddced703d8bf518f1a45cad55 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/matthewdeanmartin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@a6c801bd08d3d71ddced703d8bf518f1a45cad55 -
Trigger Event:
workflow_dispatch
-
Statement type: