Installation
StagPy is available on the Python Package Index.
You can use uv to manage Python environments.
Installation as a CLI tool
If you are interested in using the stagpy
command line interface,
you can install it as a tool with uv:
This installs stagpy
in its own environment, isolated from other packages to
avoid conflicts.
You can then update StagPy with the following command:
More information about uv tools.
Installation in a uv managed environment
A convenient way to use StagPy in script is by leveraging uv environments.
With the following (setting versions as desired for your project):
[project]
name = "my-project"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
"stagpy~=0.20.1",
]
You can then run a script using stagpy
, for example:
with the following command
You can run any arbitrary command via uv, including stagpy
itself:
Shell completions
You can enable command-line auto-completion if you use either bash or zsh.
For bash:
# adapt path as appropriate for your system
mkdir -p ~/.local/share/bash-completion/completions
cd !$
stagpy completions --bash
For zsh, with fpath+=~/.zfunc
in your .zshrc
:
Enjoy!