Skip to main content

uvn

PyPI version License Python version Downloads Contributions Welcome

uvn is a centralized Python virtual environment manager designed to work alongside uv, similar to conda for general environment management.

Highlights

  • 🎯 Centralized Environments: Manage all environments from a single location.
  • 🛠️ uv Integration: Complements uv to streamline virtual environment management.
  • ⚡️ Simple CLI Interface: Easily list, create, activate, and remove environments with straightforward commands.
  • 🗂️ Export Options: Quickly export configurations as requirements.txt or inline script metadata.
  • 💾 Cloning: Easily clone environments to create new ones.
  • 🚀 Minimal Dependencies: Designed for simplicity and speed.

Installation

Install uv first.

# On macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# On Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Then, install uvn with the cli extra.

# From PyPI
uv tool install uvn[cli]

# From GitHub
uv tool install uvn[cli] @ git+https://github.com/xmodar/uvn

Finally, install uvna for easy shell activation (e.g., in ~/.bashrc for bash).

target="~/.bashrc"
uvna=$(cat <<'EOF'
uvna() {
    activate=$(uvn activate --quiet "$1")
    if [[ -n "$activate" ]]; then
        eval "$activate"
    else
        uvn list
        echo "Could not activate '"$1"'!" >&2
    fi
}
EOF
)
target="${target/#\~/$HOME}"
if [[ -f "$target" ]] && grep -q "uvna() {" "$target"; then
  sed -i "/^uvna() {/,/^}$/d" "$target"
fi
echo "$uvna" >> "$target"
source "$target"

Usage

After installing uvn, manage virtual environments that are centralized and accessible from any directory, similar to conda.

Quick Start

To begin, create and activate an environment.

uvn create test --python 3.12
uvna test

The list and remove commands are simple.

# List environments with their sizes
uvn list --size

# Remove the 'test' environment
uvn remove test

To install packages, you can simply use uv pip in an activated environment.

uvna test
uv pip install # ...

The export command offers various options for exporting environment configurations.

# Print dependencies as in requirements.txt
uvn export test

# Export inline script metadata
uvn export test py --short --lower

# Generate a requirements.txt file
uvn export test requirements.txt

# Prepend inline script metadata (automatically detects ".py")
uvn export test script.py

# Clone the environment
uvn fork test test2

Commands

Available commands in uvn:

Usage: uvn [OPTIONS] COMMAND [ARGS]...

╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────╮
  list       List all virtual environments.
  create     Create a virtual environment.
  remove     Remove a virtual environment.
  export     Export a virtual environment.
  fork       Copy a virtual environment.
  activate   Show environment command.
  version    Show uvn version.
╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯

╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────╮
 --install-completion Install completion for the current shell.
 --show-completion    Show completion for the current shell, to copy it or customize the installation.
 --help               Show this message and exit.
╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯

Contributing

Contributions are welcome! For suggestions or issues, please submit a pull request or open an issue on GitHub.

Metadata

Release files for uvn 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uvn 0.1.0
File Size Uploaded Provenance
uvn-0.1.0.tar.gz 24.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for uvn 0.1.0
File Interpreter ABI Platform
uvn-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.6 kB

Release files / uvn-0.1.0.tar.gz

Download URL uvn-0.1.0.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
80e2e2a4e39e8186ff89d2413699bc7717984258ce09eb237d6153092b6f8aaa
BLAKE2b-256 checksum
How to use checksums
dacfe7a5444b3a1a6f2be2055cbceef42a991f3529815ee76f2f7159f333a997
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.29

Release files / uvn-0.1.0-py3-none-any.whl

Download URL uvn-0.1.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e874f73826a410959342c1dc9a6e636c123a613defa460a3c0a5c48c7a4d3f14
BLAKE2b-256 checksum
How to use checksums
98c40b1ecf45b3849ea94d3efdb3a7d57432e0ee27f528cc9e437bb535ea2f27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.29

Security for uvn 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page