pyinfra turns Python code into shell commands and runs them on your servers. Execute ad-hoc commands and write declarative operations. Target SSH servers, local machine and Docker containers. Fast and scales from one server to thousands.

Think ansible but Python instead of YAML, and a lot faster.

  • 🚀 Super fast execution over thousands of targets with predictable performance. Up to 10x faster than Ansible.
  • 🚨 Instant debugging with realtime output from shell commands being executed and no abstraction layer.
  • 🔄 Declarative operations that only make changes when needed and enable diff checking.
  • 📦 Extendable with the entire Python package ecosystem. Inventory and operations are written in Python.
  • 💻 Agentless execution against anything with POSIXish shell access, no dependencies on targets.
  • 🔌 Integrated with other tools. Pull inventory from Terraform, execute against Docker containers.
Getting Started Examples Repo