Key Features
- Async-first design - Built with asyncio for high-performance operations
- Type-safe models - Pydantic-based models with full type hints
- GraphQL abstraction - Simplified GraphQL query and mutation building
- Batch operations - Efficient bulk create/update operations
- Branch support - Work with multiple branches seamlessly
- Schema introspection - Dynamic schema loading and validation
Architecture
The SDK is organized into several key components:- InfrahubClient - Main client for API interactions
- Node objects - Represent Infrahub objects (devices, interfaces, etc.)
- Query builder - Construct GraphQL queries programmatically
- Batch operations - Handle multiple operations efficiently
- Schema management - Load and validate schemas
Use Cases
Infrastructure Automation
Automate infrastructure provisioning, configuration, and management:Data Migration
Migrate data from external sources into Infrahub:Custom Generators
Build custom generators to transform data and create artifacts:Integration Scripts
Integrate Infrahub with external systems:Next Steps
Installation
Install the Infrahub Python SDK
Quick Start
Get started with your first SDK script
Client Setup
Configure the InfrahubClient
Queries
Query data from Infrahub