Skip to main content

Smart Python virtual environment manager โ€” like package.json but for Python

Project description

venvy ๐Ÿ

Smart Python virtual environment manager โ€” like package.json for Python.

venvy takes the pain out of managing Python virtual environments and requirements.txt. It works cross-platform (Windows CMD/PowerShell + macOS/Linux bash/zsh) with zero shell setup required.


Features

Feature Description
venvy create venv Interactively create & configure a venv
venvy + Activate venv โ€” no setup needed, works everywhere
venvy - Deactivate / exit venv shell
venvy pip install <pkg> Install + auto-add to requirements
venvy pip uninstall <pkg> Uninstall + auto-remove from requirements
venvy status Show venv & requirements info
venvy sync Install all packages from requirements
venvy list List tracked packages

Installation

# Recommended: install globally with pipx
pipx install venvy

# Or with pip (global)
pip install venvy

Quick Start

1. Create a virtual environment

cd my-project
venvy create venv

You'll be asked two questions:

venvy โ€” virtual environment setup
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  [1/2] Install ipykernel (for Jupyter notebook support)? [y/N]: n
  [2/2] Requirements file name [requirements.txt]:

venvy then creates the venv, upgrades pip, installs any existing requirements, and saves config.


2. Activate / deactivate โ€” zero setup, works everywhere

venvy +

That's it. venvy spawns a new interactive shell with the venv already activated. Your prompt changes automatically:

# Windows CMD:
(.venv) D:\my-project>

# macOS/Linux bash:
(.venv) user@machine:~/my-project$

To deactivate โ€” just exit the shell:

exit
# or:
venvy -

How it works: venvy + spawns a new shell process with the venv's Scripts/ (Windows) or bin/ (macOS/Linux) prepended to PATH and VIRTUAL_ENV set โ€” exactly what source activate does, but without needing to modify the parent shell's environment. No eval, no source, no configuration.


3. Install packages (auto-tracked in requirements.txt)

venvy pip install requests httpx
# โ†’ installs packages AND adds them to requirements.txt automatically

venvy pip uninstall requests
# โ†’ uninstalls AND removes from requirements.txt

Or use plain pip when the venv is active (via venvy +) โ€” then use venvy pip for requirement tracking.


4. Clone a project and restore dependencies

git clone https://github.com/user/project
cd project
venvy create venv    # reads existing requirements.txt and installs everything
# or if venv already exists:
venvy sync

All Commands

venvy create venv [options]     Create virtual environment
  --name  -n    Venv directory name (default: .venv)
  --requirements -r   Requirements file name (prompted if not given)
  --ipykernel         Pre-select ipykernel installation
  --yes -y            Skip all prompts, use defaults

venvy +                         Activate venv (spawns shell, no setup needed)
venvy -                         Deactivate venv / exit

venvy pip install <packages>    Install & track packages
  --upgrade -U  Upgrade packages
venvy pip uninstall <packages>  Uninstall & untrack packages
  --yes -y      Skip confirmation

venvy status                    Show environment info
venvy list                      List tracked packages
venvy sync                      Install all requirements

venvy shell-init                (Optional) print shell integration for native pip tracking

venvy --version                 Show version

Works With Existing Venvs

venvy works with any existing virtual environment โ€” it doesn't need to have created it. If a .venv, venv, env, or .env directory exists, venvy finds it and manages requirements.txt accordingly.

python -m venv .venv            # created manually
venvy +                         # venvy finds and activates it โœ“
venvy pip install flask         # tracked in requirements.txt โœ“

Project Structure

After venvy create venv:

my-project/
โ”œโ”€โ”€ .venv/                  โ† virtual environment
โ”œโ”€โ”€ .venvy/
โ”‚   โ””โ”€โ”€ config.json         โ† venvy project config
โ”œโ”€โ”€ requirements.txt        โ† auto-managed
โ””โ”€โ”€ your code...

.venvy/config.json example:

{
  "venv_name": ".venv",
  "requirements_file": "requirements.txt",
  "install_ipykernel": false
}

Optional: Native pip auto-tracking

For plain pip install to auto-update requirements.txt without using venvy pip, add the optional shell integration:

macOS/Linux โ€” add to ~/.bashrc or ~/.zshrc:

eval "$(venvy shell-init)"

Windows PowerShell โ€” add to $PROFILE:

venvy shell-init | Invoke-Expression

This is entirely optional โ€” venvy pip install always works without it.


Philosophy

venvy brings package.json-style dependency management to Python:

npm / Node venvy / Python
npm init venvy create venv
npm install <pkg> venvy pip install <pkg>
npm uninstall <pkg> venvy pip uninstall <pkg>
npm install (restore) venvy sync
package.json requirements.txt
node_modules/ .venv/

Development

git clone https://github.com/yourorg/venvy
cd venvy
python -m venv .venv
source .venv/bin/activate   # or: venvy +
pip install -e ".[dev]"
pytest

License

MIT

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

vvenv-0.1.1.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

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

vvenv-0.1.1-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vvenv-0.1.1.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for vvenv-0.1.1.tar.gz
Algorithm Hash digest
SHA256 794018e147c3426943ad01351c9b854f4e60dfb9b317c19f31a998acb15e47d8
MD5 4e0728dfa95b9150cdf0755118314260
BLAKE2b-256 d0c91e4d2b39a7eb8e0aeb5a0929060bcd769589227c342ae20814c3f751f079

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vvenv-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for vvenv-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c3715c7d75361402451e8d681adf9f0bdceec1062b1be6678cdccfedf5c9d13
MD5 8dda8fcc366b29ced7e8ca1e9c242697
BLAKE2b-256 3be1a3c06a387dea72b68ffcc81569bbe90360fbd2b7ca96ea49ef242ae3dfd3

See more details on using hashes here.

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