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 + macOS/Linux) and integrates seamlessly into your shell so that pip install automatically tracks packages.


Features

Feature Description
venvy create venv Interactively create & configure a venv
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
Shell integration venvy + / venvy - for activate/deactivate
Existing venv support Works with any venv, not just venvy-created ones

Installation

# Recommended: install globally with pipx
pipx install venvy

# Or with pip (global)
pip install venvy

# Or with pip --user
pip install --user venvy

Quick Start

1. Initialize a project

cd my-project
venvy create venv

You'll be asked:

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 .venv/
  • Upgrades pip
  • Installs ipykernel (if chosen)
  • Installs existing requirements (if any)
  • Saves config to .venvy/config.json

2. Activate / deactivate

Without shell integration (always works):

# macOS / Linux
source .venv/bin/activate

# Windows (cmd)
.venv\Scripts\activate.bat

# Windows (PowerShell)
.venv\Scripts\Activate.ps1

With shell integration (recommended):

# Set up once:
echo 'eval "$(venvy shell-init)"' >> ~/.bashrc  # or ~/.zshrc
source ~/.bashrc

# Then use anywhere:
venvy +    # activate
venvy -    # deactivate

3. Install packages (auto-tracked)

# With venvy (always works):
venvy pip install requests httpx

# With shell integration, plain pip works too:
pip install requests httpx
# โ†’ automatically added to requirements.txt!

pip uninstall requests
# โ†’ automatically removed from requirements.txt!

4. Clone a project and restore dependencies

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

Shell Integration (Recommended)

Add to your ~/.bashrc or ~/.zshrc:

eval "$(venvy shell-init)"

Restart your terminal. Now:

venvy +              # activates the venv (like npm run)
venvy -              # deactivates the venv

pip install <pkg>    # auto-updates requirements.txt โœ“
pip uninstall <pkg>  # auto-removes from requirements.txt โœ“

Windows (PowerShell)

Add to your $PROFILE:

venvy shell-init | Invoke-Expression

Commands Reference

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

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                Print shell integration script
venvy +                         Activation hint / activate (shell integration)
venvy -                         Deactivation hint / deactivate (shell integration)

venvy --version                 Show version

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
}

Add .venvy/ to your .gitignore or commit it โ€” your choice. Commit requirements.txt always.


Using an Existing Venv

venvy works with any existing virtual environment โ€” it doesn't need to have created it. As long as:

  1. The venv is active ($VIRTUAL_ENV is set), or
  2. A .venv, venv, env, or .env directory exists in the project

venvy will find it and manage requirements.txt accordingly.


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
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.0.tar.gz (27.6 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.0-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vvenv-0.1.0.tar.gz
  • Upload date:
  • Size: 27.6 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.0.tar.gz
Algorithm Hash digest
SHA256 2a6ffe41c2b81d77b76bf904c1dbd0a4d0b787da3f094f2a4491c6996a17c7d5
MD5 4660cb26c37456bf3a19a4f3ae8d7aad
BLAKE2b-256 8dce1a9e5accd8492f5b688abdd134d3ed6cbd4b3b31c2df62bae60707a7f00c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vvenv-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05001f8bf85050ca4f6b1d2bf2e185a9b2bb0397403054e66c870ba7c7000113
MD5 6b2d29646dc91edce42f2b225dc08d95
BLAKE2b-256 d68a0c689a0af74a7a41988898a72138af5c8cea5c4d46f762623d9c702dbbfe

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