Tiny Portable Python Runner for hassle-free venv and dep handling
- Tiny command-line bash script to create and update venv versions
- Check if an existing venv (virtual env) is present and use that to run
- Automatically create/recreate the venv if needed (such as after updating Python)
- Installs dependencies from both requirements.txt and pyproject.toml in the venv
- Runs the provided file as-is within the activated venv without calling cd ever
- Supports the -c Python argument to pass code directly and have it run in the venv
curl -L https://raw.githubusercontent.com/Jelmerro/tppr/refs/heads/master/tppr -o ~/.local/bin/tppr
chmod +x ~/.local/bin/tpprDownload a stable installer or executable for your platform from Github.
I host a custom Fedora repository that you can use for automatic updates.
sudo dnf config-manager addrepo --from-repofile=https://jelmerro.nl/fedora/jelmerro.repo
sudo dnf install tpprOnce installed, simply run tppr with a Python script as an argument.
This will make a venv with Python and all the deps, then run the script with it.
With tppr ~/projects/example/file.py <args> you can pass all args to the Python script.
You can also supply options to tppr if you include them before the filename,
please see tppr -h for help, advanced usage and additional options.
You can support my work on ko-fi or Github sponsors. Another way to help is to report issues or suggest new features. Please try to follow recommendations by shellcheck when developing. For an example vimrc that can auto-format based on the included linters, you can check out my personal vimrc.
To create your own builds you can use jfpm.
Please clone or download both this repo and jfpm, then run ../jfpm/release_sh_simple.sh.
This will build releases for various platforms and output them to dist.