venv-notary
venv-notary is a simple utility to easily manage your Python environment needs. It follows the UNIX phylosophy of:
do one thing and do it well
venv-notary doesn’t try to manage packages or do dependency resolution. It only creates and manages python environments, so that you don’t need to worry about where to create them and how to activate them, or even remembering where the hell you created that environment you need now.
Requirements
- bash, zsh, fish or powershell
- go version 1.23
Install
1go install github.com/azr4e1/venv-notary/vn@latestMake sure your $GOPATH is in your $PATH.
Once installed, run vn completion <YOUR SHELL>, and append the result into your shell config in order to enable completions for venv-notary.
Shells supported for completion:
- bash
- zsh
- fish
- powershell
Usage
venv-notary distinguishes between two types of environments: local and global.
Global environments are environments that you would call from anywhere in the filesystem. They are meant to contain packages that you know you would need for various tasks, and not necessarily just for a single project. For example, you could have a data-science global environment for whenever you need to perform some eda on the fly, or a llm environment for whenever you want to just create a small script calling openai or gemini APIs.
Local environments are environments specific to a folder. They are meant to be used as project specific environments, and are similar in nature to poetry’s shell.
Remember to call vn help on any command if you’re stuck:
1vn help cleanCreate a new environment
Create a new global environment:
1vn create data-scienceCreate a new local environment:
1vn create -lCreate a new environment with a specific Python version:
1vn create python39-venv -p python3.9Activate an environment
Activate a global environment:
1vn activate data-scienceActivate a local environment:
1vn activate -lActivate a local environment with a specific version:
1vn activate -l -p python3.9Note: if the environment you want to activate doesn’t exist, it will automatically be created.
Delete an environment
Delete a global environment:
1vn delete data-scienceDelete a local environment:
1vn delete -lDelete a local environment with specific version:
1vn delete -l -p python3.9Clean local/global environments
clean is like delete on steroid. It allows to delete environments in batches.
You must specify whether to clean the global or the local environments. If no other flag is provided, all your local/global environments will be deleted!
You can also provide the -p/--python flag to delete only the environments with a specific Python version.
You can also provide the -n/--name flag to delete only the environments whose names match a regexp pattern.
Examples
Delete all global environments:
1vn clean -gDelete all local environments with this Python version:
1vn clean -l -p python3.9The argument to -p must be a Python executable.
Delete all local environments that match this pattern:
1vn clean -l -n "data.*$"List
Finally, you can list your local/global environments, optionally filtering by Python version.
List in interactive mode:
1vn listList only local environments:
1vn list -lList only global environment with Python version 3.12:
1vn list -g -p python3.12