python-vagrant
Python bindings for interacting with Vagrant virtual machines.
What it is and what it does
Python-vagrant is a thin wrapper around the Vagrant command-line tool that lets you control virtual machines programmatically from Python code. Instead of running vagrant commands manually in a shell, you instantiate a Vagrant object and call methods like up(), destroy(), halt(), and status() to manage VMs. It also provides access to SSH configuration details and supports multi-VM environments, box management, and provisioning options.
The package requires Vagrant 2.2 or greater and a supported hypervisor to be installed separately; it does not bundle or replace Vagrant itself. It has no Python runtime dependencies, making installation straightforward. The module is useful for automation workflows—such as spinning up test environments, integrating VM management into deployment pipelines, or controlling Vagrant from Fabric tasks—where you need programmatic rather than manual control.
Use it for:
- Automate VM startup and teardown in CI/CD pipelines or test suites that need isolated environments
- Integrate Vagrant box control into Fabric deployment tasks to run remote commands on provisioned VMs
- Query and manage multiple VMs in a multi-VM Vagrantfile from a single Python script
- Log and monitor Vagrant subprocess output for debugging or auditing infrastructure changes
- Programmatically initialize VMs from base boxes and manage box lifecycle (add, remove, list)
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Programmatic control of Vagrant virtual machines through Python, wrapping the vagrant command-line tool to start, stop, query status, and manage VMs from code.
Yes, if you need to automate Vagrant VM management from Python and already have Vagrant and a hypervisor installed. The package is actively maintained, has no external Python dependencies, and carries a permissive license. The beta status and 2022 release date mean you should verify compatibility with your Vagrant version, but the straightforward API and low install friction make it a practical choice for automation workflows.
Install
python-vagrant on PyPI
pip
pip install python-vagrantuv
uv add python-vagrantpoetry
poetry add python-vagrantInstalling python-vagrant
Before you install
Low friction installation with no runtime dependencies. Maintenance is active with recent commits, though the latest release was in 2022 and the package is marked beta, so API stability is not guaranteed.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions.
Quickstart
pip install python-vagrant
import vagrant
v = vagrant.Vagrant()
v.up()
print(v.status())
v.halt()
Vagrant 2.2 or greater and a supported hypervisor (VirtualBox, VMWare, etc.) must be installed and configured on the system before python-vagrant can control VMs.
Verify before relying
- Whether Vagrant 2.2+ and a supported hypervisor (VirtualBox, VMWare, etc.) are already installed on the target system
- Performance characteristics when managing large numbers of VMs or complex multi-VM environments
- Compatibility with recent Vagrant versions beyond what the description states
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,597 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,944,441/month — #2,437 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_vagrant-1.0.0-py3-none-any.whl
Keywords: box, vagrant, vagrantfile, virtual-machine, virtualbox
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
molecule-vagrantMolecule Vagrant Plugin enables Vagrant-based…
permissive · top 15,000 on PyPI
EasyProcessEasyProcess wraps Python's subprocess module to…
permissive · top 5,000 on PyPI
python-terraformWraps the Terraform command-line tool, allowing…
permissive · top 15,000 on PyPI
bashProvides a Python wrapper for running bash…
copyleft · top 15,000 on PyPI
invokeInvoke is a Python library for defining and…
permissive · top 1,000 on PyPI
python-tools-scriptsBuilds CLI tools by auto-discovering Python…
permissive · top 15,000 on PyPI
fabricFabric executes shell commands remotely over…
permissive · top 5,000 on PyPI
subprocess.runProvides a simplified interface to run shell…
permissive · top 15,000 on PyPI
vmware-vcenterProvides Python bindings to VMware vCenter…
permissive · top 15,000 on PyPI
pylxdpylxd provides a Python interface to the LXD…
permissive · top 15,000 on PyPI