Skip to main content

A TUI for managing Python runtimes and installs

Project description

Ducktools: PyTUI

A terminal based user interface for managing Python installs and virtual environments.

Usage

The easiest way to install ducktools.pytui is as a tool from PyPI using uv or pipx.

uv tool install ducktools-pytui or pipx install ducktools-pytui

Run with pytui or ducktools-pytui.

There is also now a zipapp available on the releases page and should be usable as long as you have Python 3.10 or newer.

Screenshots

Managing virtual environments

screenshot showing ducktools-pytui displaying a list of venvs and runtimes

Installing new runtimes

screenshot showing ducktools-pytui displaying a list of available runtimes to install

Listing packages installed in a virtual environment (3.9+ only)

screenshot showing ducktools-pytui listing packages installed in a virtual environment

Features

  • List Python Virtual Environments relative to the current folder alongside those installed in a configurable global folder
  • List Python Runtimes discovered by ducktools-pythonfinder
  • Launch a Terminal with a selected venv activated
    • Currently only fish, bash (and git bash on Windows), zsh, powershell and cmd are supported
      • zsh and cmd only have basic support
    • Use exit to close the shell and return to PyTUI
  • Launch a REPL with the selected venv
  • Launch a REPL with the selected runtime
  • List installed packages in a venv (Python 3.9 or later)
  • Create a venv from a specific runtime in the working directory or a global folder (Python 3.4 or later)
  • Delete a selected venv
  • Install a runtime (Requires either the Windows Python Manager or UV to be available)
  • Uninstall a runtime (Only those managed by the Windows Python Manager or UV)

Basic Configuration

Some configuration is available by editing the config.json file located here:

  • Windows: %LOCALAPPDATA%\ducktools\pytui\config.json
  • Non-Windows: ~/.config/ducktools/pytui/config.json

Config can be seen and edited from the commandline with the config subcommand.

Some example commands:

  • pytui config - Shows the location of the config file and its current state
  • pytui config -h - Shows the options for modifying the config file
  • pytui config --exclude-pip - Prevent pip from being included

Config Values

  • venv_search_mode - Where to search for VEnv folders
    • "cwd" - Search in the working directory only
    • "parents" - Search in the working directory and each parent folder (default)
    • "recursive" - Search in the working directory and subfolders recursively
    • "recursive_parents" - Combine the "recursive" and "parents" options (only the CWD is recursively searched)
  • include_pip - Whether to include pip (and setuptools where appropriate) in created VEnvs (default: True)
  • latest_pip - Download the latest pip for Python versions where it is available (default: True)
  • global_venv_folder - The folder to use for global pytui venvs, ~/.local/share/ducktools/pytui/venvs by default
  • shell_path - Path to the shell used to launch activated venvs

Clearing the discovered Python install cache

The Python install discovery cache is handled by the ducktools-pythonfinder package.

The easiest way to clear the cache is to use the ducktools-pythonfinder commandline.

  • With uv: uvx ducktools-pythonfinder clear-cache
  • With pipx: pipx run ducktools-pythonfinder clear-cache
  • With the pythonfinder zipapp: python pythonfinder.pyz clear-cache

Shell Discovery

By default PyTUI will check your $SHELL variable if it is set for the path to your default shell. If this exists and is a supported shell it will be used. Otherwise it will search PATH for shells in this order:

  • Windows: pwsh.exe, powershell.exe, cmd.exe, bash.exe
  • Non-Windows: fish, bash, zsh

On Windows as a last resort if none of these are found it will search for the COMSPEC environment variable to find a path to cmd.exe.

A data folder of shell scripts is kept in this location:

  • Windows: `%LOCALAPPDATA%\ducktools\pytui\shell_scripts
  • Non-Windows: ~/.local/share/ducktools/pytui/shell_scripts

Possible Extras

  • Support other common shells
  • Highlight broken venvs where the base install no longer exists

Not Planned

  • Handle PEP-723 inline scripts
    • ducktools-env is my project for managing these
    • Potentially that could gain a TUI, but I'm not sure I'd want to merge the two things
  • Handle Conda environments
    • Conda environments are a completely separate ecosystem, while everything this supports uses the standard PyPI ecosystem
    • Supporting Conda would basically require a whole separate parallel set of commands
  • Manage ducktools-pytui specific runtimes
    • I don't want to add yet another place Python can be installed
    • ducktools-pytui is intended to help manage the chaos of Python runtime installs and environments, not add a new dimension to it

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

ducktools_pytui-0.4.5.tar.gz (145.1 kB view details)

Uploaded Source

Built Distribution

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

ducktools_pytui-0.4.5-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

Details for the file ducktools_pytui-0.4.5.tar.gz.

File metadata

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

File hashes

Hashes for ducktools_pytui-0.4.5.tar.gz
Algorithm Hash digest
SHA256 d20eaf792e4caa5a9b13f46a6f1f5d693de9213dd82f703541e024e8f5e3fc1e
MD5 531c749242174f979b2ff3793babca19
BLAKE2b-256 4006dbd2de8b37f998bd4478ffca520dac5fa897a44498eeb64b43889e8a2c56

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducktools_pytui-0.4.5.tar.gz:

Publisher: publish_to_pypi.yml on DavidCEllis/ducktools-pytui

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

File details

Details for the file ducktools_pytui-0.4.5-py3-none-any.whl.

File metadata

File hashes

Hashes for ducktools_pytui-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 09359ac4c77a9d84e1eeef6597d1798de25a74795964ffd1307eaaeecd1469e5
MD5 210738961a261f0612c6b204e7e360b4
BLAKE2b-256 098fc241390aa5a291724956a7eef638083f7895d36ec23dd53eaf9cc451bb62

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducktools_pytui-0.4.5-py3-none-any.whl:

Publisher: publish_to_pypi.yml on DavidCEllis/ducktools-pytui

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