Comprehensive virtual environment management tool
Project description
Virtual Environment Manager
A comprehensive Python package for managing virtual environments, providing equivalent functionality to the bash venv.sh script with enhanced features.
Features
- Environment Creation: Create virtual environments using
uv,python3, orpythonwith automatic fallback - Smart Activation: Activate environments with directory mapping for auto-activation
- Package Management: Install, uninstall, update, and search packages using
uvorpip - History Tracking: Track directory-to-environment mappings for automatic activation
- Cross-Platform: Works on Linux, macOS, and Windows with Python 3.7+
Installation
From Source
pip install git+https://github.com/anhvth/uv-virtual-environs-manager
From PyPI (once published)
pip install pyve
Quick Start
# Create a new virtual environment
ve create myproject --python=3.12
# Activate an environment (creates directory mapping)
atv myproject
# List all environments
ve list
# Install packages
ve install requests numpy
# Show environment info
ve info
# Auto-activation: when you cd back to this directory,
# the environment will be suggested for activation
Commands
Main Commands
ve create <name> [options]- Create a new virtual environmentve activate <name>- Activate a virtual environmentve deactivate- Deactivate current virtual environmentve list- List all virtual environmentsve delete <name>- Delete a virtual environmentve info- Show current virtual environment infove which <name>- Show path to virtual environment
Package Management
ve install <pkg>...- Install packages in active venvve installed- List installed packages in active venvve uninstall <pkg>...- Uninstall packages from active venvve search <pkg>- Search for packages on PyPIve update <pkg>...- Update packages in active venvve run <cmd>...- Run command in active venv
History & Auto-Activation
ve history- Show directory → environment mappingsve clear-history- Clear all atv historyatv <name>- Activate with directory mapping (alias forve activate)
Utility Commands
create_env <name>- Alternative create commandinstall_uv- Install uv package manager
Configuration
The package uses the following files for tracking:
~/.venv_all_env- Global environment tracking~/.config/atv_history- Directory-to-environment mappings~/.venvs/- Default location for virtual environments~/.last_venv- Last activated environment
Shell Integration
For full shell integration (auto-activation on directory change), add this to your shell configuration:
Zsh
# Add to ~/.zshrc
eval "$(ve shell-integration zsh)" # Future feature
Bash
# Add to ~/.bashrc
eval "$(ve shell-integration bash)" # Future feature
Auto-Activation
When you use atv <name> to activate an environment, the current directory is mapped to that environment. When you navigate back to that directory later, you'll be reminded to activate the environment.
Examples
# Create a new project environment
ve create myproject --python=3.12
cd /path/to/myproject
# Install dependencies
ve install requests flask pytest
# Later, when you cd back to the project
cd /path/to/myproject
# The tool will remind you about the mapped environment
# View all mappings
# Clean up
ve delete myproject
Differences from Shell Version
- Shell Integration: The Python version can't directly modify the current shell environment. It provides activation commands to run.
- Auto-Activation: Requires shell integration for automatic activation on directory change.
- Browser Opening: Package search opens browser when available.
Development
Local Development
# Clone and install in development mode
git clone <repo-url>
cd virtual_envs_manager
pip install -e .
# Run tests (if available)
python -m pytest
# Type checking
mypy pyve/
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details.
Author
anhvth5
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 pyve-1.0.1.tar.gz.
File metadata
- Download URL: pyve-1.0.1.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba947648a79c8f6d997f1c34e6c4d3efae4269029cd187891b3e5d2738e6bb5f
|
|
| MD5 |
b01aa2bfef04881af9f6feb4bb822764
|
|
| BLAKE2b-256 |
68b94acbf3b805879864a981a8c2de3f2e96ab14dd0d14802416bee4df8e3fe9
|
File details
Details for the file pyve-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pyve-1.0.1-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
626a0cf4c2ad2d785e1274c6a052df5d28e347fd84490157a0106e8874af35f1
|
|
| MD5 |
925cf4380441fda9b37d01bdb6777916
|
|
| BLAKE2b-256 |
edc6e70352a8132a698a58445021f9730a86156436d0ab7036b858ef00143b31
|