A thin wrapper around runpy.run_module for use with uvx, pipx, etc.
Project description
run-module
An intentionally simple command-line wrapper around Python's built-in runpy.run_module.
Motivation
Tools like:
- pipx
- uv tool install
- uvx (convenience bin for
uv tool run)
are convenient. A single simple command can:
- Download a PyPI package (with additional deps specified if desired)
- Create a temporary out-of-sight venv dedicated to that package
- Have that package's bins placed on your PATH
- or just run the command directly without having the bins on your PATH
However, they have a limitation: they can't run a module ala python -m.
So if you find a package that'd you'd like to use these conveniences with,
but its entrypoint must be run with python -m, too bad.
A small and simple bin, like run-module, could help fill the gap.
Here is an example usage using pyftpdlib, a popular FTP server package:
uvx --with pyftpdlib run-module pyftpdlib [args_for_pyftpdlib...]
pipx --pip-args pyftpdlib run-module pyftpdlib [args_for_pyftpdlib...]
What about pip-run?
It's true that pip-run lets you run a module:
pip-run pyftpdlib -- -m pyftpdlib [args_for_pyftpdlib...]
But compared to run-module, pip-run is:
- Heavy: it reimplements or delegates downloading, caching, and venv logic
- Tools like
uvandpipxalready do this well.
- Tools like
- Has an unintuitive CLI surface often requiring invocations containing '--' or '!'
That said, if pip-run is working for you, great! No need to switch.
Comparatively run-module:
- Is incredibly lightweight: a single small wrapper around
runpy.run_module. - Will not (and cannot) download anything on its own.
- Has a simple and intuitive command line surface.
- Does one thing and does it well -- with no dependencies.
- Should work with virtually any launcher or tool that supports Python packages / modules.
- Allows you to reuse your
uvorpipxcache, saving space and download time.
License
MIT
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 run_module-0.1.2.tar.gz.
File metadata
- Download URL: run_module-0.1.2.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9adef6eb0aa35c2a976c359a7f2d2305ff709e77b7aab62f42322329a360aa6
|
|
| MD5 |
98f6516d79412655e567a29c2b63a772
|
|
| BLAKE2b-256 |
4c5dddfbc920ba7e3e7f71286d039c06ba366455e59af685dd24ae45df8ee5e2
|
Provenance
The following attestation bundles were made for run_module-0.1.2.tar.gz:
Publisher:
publish.yml on mevanlc/run-module
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
run_module-0.1.2.tar.gz -
Subject digest:
a9adef6eb0aa35c2a976c359a7f2d2305ff709e77b7aab62f42322329a360aa6 - Sigstore transparency entry: 843314500
- Sigstore integration time:
-
Permalink:
mevanlc/run-module@0df5b743e7c7ef4dbb8442bdd8379348338a36b0 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/mevanlc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0df5b743e7c7ef4dbb8442bdd8379348338a36b0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file run_module-0.1.2-py3-none-any.whl.
File metadata
- Download URL: run_module-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbf73684cc437c65946767ed4937f6171f79e11a6ec2038f86f56cde4382d8c7
|
|
| MD5 |
122143ac5640a4f71729bc54d61a49cc
|
|
| BLAKE2b-256 |
4cf590aaec08ad1b65fd4d80418716d41ffab9e01a2233203f4ef1a7f4b5f0e6
|
Provenance
The following attestation bundles were made for run_module-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on mevanlc/run-module
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
run_module-0.1.2-py3-none-any.whl -
Subject digest:
dbf73684cc437c65946767ed4937f6171f79e11a6ec2038f86f56cde4382d8c7 - Sigstore transparency entry: 843314503
- Sigstore integration time:
-
Permalink:
mevanlc/run-module@0df5b743e7c7ef4dbb8442bdd8379348338a36b0 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/mevanlc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0df5b743e7c7ef4dbb8442bdd8379348338a36b0 -
Trigger Event:
release
-
Statement type: