Skip to main content

Fast, precise, and user-friendly Python virtual environment management

Project description

๐Ÿ EnvFy - Professional Virtual Environment Manager

Python 3.7+ License: MIT PyPI version

EnvFy is a fast, precise, and user-friendly Python virtual environment management tool that makes working with virtual environments as easy as using pip!

โœจ Features

  • ๐Ÿš€ Lightning-fast environment creation and management
  • ๐ŸŽจ Beautiful CLI with rich output and progress bars
  • ๐Ÿ” Smart Python detection - automatically finds all Python versions
  • ๐Ÿ“ฆ Package management - install, uninstall, and manage packages effortlessly
  • ๐ŸŽฏ Environment templates - quickly create environments from predefined templates
  • ๐Ÿ”„ Environment cloning - duplicate environments with all packages
  • ๐Ÿ’พ Backup & restore - safely backup and restore environments
  • ๐Ÿ”ง Advanced configuration - customize everything to your needs
  • ๐ŸŒ Cross-platform - works on Windows, macOS, and Linux
  • โšก Performance optimized - smart caching for faster operations

๐Ÿš€ Quick Start

Installation

๐ŸŒ Cross-Platform Installation (Recommended)

One-Line Installation:

# Unix-like systems (macOS/Linux)
curl -fsSL https://raw.githubusercontent.com/Pymmdrza/envfy/main/install.sh | bash

# Windows PowerShell
iwr -useb https://raw.githubusercontent.com/Pymmdrza/envfy/main/install.ps1 | iex

๐Ÿ“ฆ Package Manager Installation

๐Ÿง Linux:

# Ubuntu/Debian
sudo apt update && sudo apt install python3-pip
pip install envfy[uv]

# Fedora/RHEL/CentOS
sudo dnf install python3-pip
pip install envfy[uv]

# Arch Linux
sudo pacman -S python-pip
pip install envfy[uv]

# openSUSE
sudo zypper install python3-pip
pip install envfy[uv]

๐ŸŽ macOS:

# Homebrew (recommended)
brew install python3
pip3 install envfy[uv]

# MacPorts
sudo port install py311-pip
pip install envfy[uv]

# Direct Python installation
pip3 install envfy[uv]

๐ŸชŸ Windows:

# Using winget (Windows Package Manager)
winget install Python.Python.3.11
pip install envfy[uv]

# Using Chocolatey
choco install python3
pip install envfy[uv]

# Using Scoop
scoop install python
pip install envfy[uv]

# Direct pip installation
pip install envfy[uv]

๐Ÿš€ Manual Installation

# Basic installation
pip install envfy

# With UV support (ultra-fast package installation)
pip install envfy[uv]

# Development version with all features
pip install envfy[all]

# From source
git clone https://github.com/Pymmdrza/envfy.git
cd envfy
pip install -e .[uv]

โœ… Verify Installation

# Check installation
envfy --version

# Show platform information
envfy platform

# Test basic functionality
envfy create test-env --packages requests
envfy list
envfy delete test-env --force

Basic Usage

# Create a new environment
envfy create myproject

# Create with shorthand syntax
envfy --create --new myproject
envfy -c -n myproject

# Create with specific Python version
envfy create myproject --python 3.9
envfy --create --new myproject --python 3.9

# Create with packages
envfy create myproject --packages requests pandas numpy
envfy -c -n myproject --packages requests pandas

# Create with UV for ultra-fast installation
envfy create myproject --packages "fastapi uvicorn" --uv
envfy -c -n myproject --packages "django redis" --uv

# Create from requirements file
envfy create myproject --requirements requirements.txt
envfy --create --new myproject --requirements requirements.txt

# Create from requirements with UV
envfy create myproject --requirements requirements.txt --uv

# List all environments
envfy list

# Activate an environment (shows activation command)
envfy activate myproject

# Install packages in an environment
envfy install myproject requests beautifulsoup4

# Install packages with UV (ultra-fast!)
envfy install myproject --packages "numpy scipy matplotlib" --uv

# Clone an environment
envfy clone myproject myproject-backup

# Delete an environment
envfy delete myproject

๐Ÿ“– Documentation

Environment Management

Creating Environments

# Basic environment
envfy create webproject

# Basic environment (shorthand)
envfy --create --new webproject
envfy -c -n webproject

# With specific Python version
envfy create webproject --python 3.10
envfy -c -n webproject --python 3.10

# With description
envfy create webproject --description "Web scraping project"
envfy -c -n webproject --description "Web scraping project"

# With template
envfy create webproject --template web
envfy -c -n webproject --template web

# With packages and requirements
envfy create webproject \
    --packages flask requests \
    --requirements requirements.txt \
    --python 3.9

# Shorthand with packages and requirements
envfy -c -n webproject \
    --packages flask requests \
    --requirements requirements.txt \
    --python 3.9

Environment Information

# List all environments
envfy list

# Detailed listing
envfy list --detailed

# JSON output
envfy list --json

# Show specific environment info
envfy info webproject

Environment Operations

# Clone environment
envfy clone webproject webproject-v2

# Backup environment
envfy backup webproject

# Restore from backup
envfy restore backup.tar.gz newproject

# Delete environment
envfy delete webproject

# Rename environment
envfy rename oldname newname

Package Management

# Install packages
envfy install myproject requests pandas

# Install with options
envfy install myproject --upgrade requests
envfy install myproject --editable ./my-package

# Install from requirements
envfy install myproject --requirements requirements.txt

# Uninstall packages
envfy uninstall myproject requests

# Export requirements
envfy freeze myproject > requirements.txt
envfy freeze myproject --output requirements.txt

Python Version Management

# Show available Python versions
envfy python

# Create environment with specific version
envfy create project39 --python 3.9.7
envfy create project310 --python python3.10

Configuration

# Show current configuration
envfy config show

# Set configuration values
envfy config set default_python_version 3.9
envfy config set show_banner false

# Reset configuration
envfy config reset

Maintenance

# Diagnose issues
envfy doctor

# Clean caches
envfy clean

# Clean specific caches
envfy clean --environments
envfy clean --downloads

๐ŸŽฏ Advanced Usage

Environment Templates

Create reusable environment templates:

# ~/.envfy/templates/web.toml
[template]
name = "web"
description = "Web development environment"
python_version = "3.9"

[packages]
base = [
    "flask>=2.0.0",
    "requests>=2.25.0",
    "beautifulsoup4",
    "pytest",
    "black",
    "flake8"
]

[optional]
database = ["sqlalchemy", "alembic"]
async = ["aiohttp", "asyncio"]

Use template:

envfy create mywebapp --template web

Configuration File

Customize EnvFy behavior:

# ~/.envfy/config/config.toml
[global]
default_python_version = "3.9"
auto_activate = false
show_banner = true
colored_output = true
parallel_installs = true
max_workers = 4

[network]
timeout = 30
retries = 3
index_url = "https://pypi.org/simple/"

[cache]
enabled = true
ttl = 3600

Programmatic Usage

Use EnvFy in your Python scripts:

from envfy import EnvironmentManager, Environment

# Create manager
manager = EnvironmentManager()

# Create environment
env = manager.create_environment(
    name="myproject",
    python_version="3.9",
    packages=["requests", "pandas"]
)

# Use environment
if env:
    env.install_package("numpy")
    packages = env.get_packages()
    print(f"Installed packages: {len(packages)}")

# List environments
environments = manager.list_environments()
for env_name in environments:
    env = manager.get_environment(env_name)
    info = env.get_info()
    print(f"{env_name}: {info.python_version}")

๐Ÿ› ๏ธ Commands Reference

Core Commands

Command Description Cross-Platform
create Create a new virtual environment โœ… All platforms
delete Delete a virtual environment โœ… All platforms
list List all environments โœ… All platforms
info Show detailed environment information โœ… All platforms
activate Show activation command โœ… All platforms
clone Clone an environment โœ… All platforms

Package Commands

Command Description Cross-Platform
install Install packages in environment โœ… All platforms
uninstall Uninstall packages from environment โœ… All platforms
freeze Export environment packages โœ… All platforms

System Commands

Command Description Cross-Platform
python Show available Python versions โœ… All platforms
platform Show platform info and installation methods โœ… All platforms
config Configuration management โœ… All platforms
clean Clean caches and temporary files โœ… All platforms
doctor Diagnose and fix issues โœ… All platforms

Platform-Specific Features

Windows:

  • PowerShell and Command Prompt support
  • Windows Terminal integration
  • Automatic PATH configuration
  • UAC-aware installation

macOS:

  • Homebrew integration
  • Apple Silicon (M1/M2) support
  • Xcode command line tools detection
  • Framework Python support

Linux:

  • Distribution package manager integration
  • Snap/Flatpak support
  • pyenv compatibility
  • SELinux compatibility

Command Options

Most commands support these common options:

Option Description
--force Force operation without confirmation
--verbose Enable verbose output
--help Show command help

๐Ÿ”ง Configuration

Environment Variables

Variable Description Default
ENVFY_HOME EnvFy home directory ~/.envfy
ENVFY_CONFIG Configuration file path ~/.envfy/config/config.toml

Directory Structure

~/.envfy/
โ”œโ”€โ”€ config/
โ”‚   โ”œโ”€โ”€ config.toml          # Global configuration
โ”‚   โ””โ”€โ”€ environments/        # Environment-specific configs
โ”œโ”€โ”€ environments/            # Virtual environments
โ”œโ”€โ”€ templates/              # Environment templates
โ””โ”€โ”€ cache/                 # Cache and temporary files

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone repository
git clone https://github.com/pymmdrza/envfy.git
cd envfy

# Create development environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install in development mode
pip install -e .[dev]

# Run tests
pytest

# Format code
black envfy/
isort envfy/

# Lint code
flake8 envfy/
mypy envfy/

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™‹ Support

๐ŸŒŸ Acknowledgments

  • Built with Click for the CLI
  • Beautiful output powered by Rich
  • Virtual environments created with virtualenv
  • Configuration management using TOML

โšก UV Integration - Ultra-Fast Package Installation

EnvFy integrates seamlessly with UV, the ultra-fast Python package installer and resolver written in Rust. UV can be 10-100x faster than pip for package installation!

๐Ÿš€ Why Use UV with EnvFy?

  • ๐Ÿ”ฅ Blazing Fast: 10-100x faster than pip
  • ๐Ÿง  Smart Caching: Intelligent dependency resolution
  • ๐Ÿ”’ Reliable: Production-ready with excellent compatibility
  • ๐Ÿชถ Lightweight: Minimal overhead, maximum performance

๐Ÿ“ฆ Installation

# Install EnvFy with UV support
pip install envfy[uv]

# Or install UV separately
pip install uv

# Or use UV to install EnvFy itself!
uv pip install envfy

๐ŸŽฏ Usage Examples

Environment Creation with UV

# Create environment and install packages with UV
envfy create myproject --packages "fastapi uvicorn" --uv

# Shorthand with UV
envfy -c -n myproject --packages "django psycopg2-binary" --uv

# From requirements file with UV
envfy create webapp --requirements requirements.txt --uv

Package Management with UV

# Install packages using UV (ultra-fast!)
envfy install myproject --packages "numpy pandas matplotlib" --uv

# Upgrade packages with UV
envfy install myproject --upgrade "requests aiohttp" --uv

# Install from requirements with UV
envfy install myproject --requirements requirements.txt --uv

โšก Performance Comparison

Operation pip UV Speedup
Install numpy 8.2s 0.9s 9.1x
Install Django 12.4s 1.2s 10.3x
Install 50 packages 3m 21s 24s 8.4x
Cold dependency resolution 45s 3s 15x

๐Ÿ”ง Configuration

You can set UV as the default package manager:

# Set UV as default for new environments
envfy config set default_package_manager uv

# Always use UV for installations
envfy config set always_use_uv true

๐Ÿ’ก Pro Tips

  1. First-time setup: Install UV globally for maximum benefit

    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. Hybrid approach: Use UV for fast installs, pip for compatibility

    envfy install myproject --packages "common-package" --uv
    envfy install myproject --packages "edge-case-package"  # uses pip
    
  3. CI/CD optimization: UV dramatically speeds up CI pipelines

    # .github/workflows/test.yml
    - name: Create test environment
      run: envfy create test-env --requirements requirements.txt --uv
    

๐Ÿค UV + EnvFy Integration Features

  • ๐Ÿ”„ Automatic fallback: Falls back to pip if UV is not available
  • ๐ŸŽฏ Selective usage: Choose UV per command with --uv flag
  • ๐Ÿ“Š Performance monitoring: Track installation speeds
  • ๐Ÿ”ง Full compatibility: All EnvFy features work with UV
  • โš™๏ธ Configuration: Set UV as default in global config

๐Ÿ› ๏ธ Advanced UV Usage

# Create environment with UV and specific Python version
envfy -c -n ml-project --python 3.11 --packages "torch tensorflow" --uv

# Clone environment and upgrade all packages with UV
envfy clone old-env new-env
envfy install new-env --upgrade-all --uv

# Export and recreate with UV for faster setup
envfy freeze old-env > requirements.txt
envfy create fast-env --requirements requirements.txt --uv

Made with โค๏ธ by the EnvFy team

Fast, Precise, Professional Virtual Environment Management

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

envfy-1.0.6.tar.gz (46.9 kB view details)

Uploaded Source

Built Distribution

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

envfy-1.0.6-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

Details for the file envfy-1.0.6.tar.gz.

File metadata

  • Download URL: envfy-1.0.6.tar.gz
  • Upload date:
  • Size: 46.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for envfy-1.0.6.tar.gz
Algorithm Hash digest
SHA256 61b0c0b66cbe83330644136d170d779367fa81540950492bc19d83d9883e4311
MD5 a41b694505312a758cf8d37d5e92129b
BLAKE2b-256 b59efe35efb5221999c87b698d5dd54a84da3c2e9939ca2711c226c174e6c0a9

See more details on using hashes here.

File details

Details for the file envfy-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: envfy-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 47.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for envfy-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4ce4ba8afe47e8367af555a0ed939cade168b41b94e4a8431d2e40e60901b957
MD5 bd0c549cbed1b4fc7aa983b680b2abaf
BLAKE2b-256 e9576e7bb4da018e63d2d299fc6c651afc89aafca363be799490d30375f46313

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