Cisco Catalyst WAN SDK

raw JSON →
0.41.5 verified Fri May 01 auth: no python

Official Python SDK for automating Cisco Catalyst SD-WAN (Viptela) solutions. Current version 0.41.5, released monthly. Supports Python 3.8+ and provides both synchronous and asynchronous clients to interact with vManage API endpoints, including device configuration, policy management, templates, and monitoring.

pip install catalystwan
error ModuleNotFoundError: No module named 'catalystwan'
cause Package not installed.
fix
Run: pip install catalystwan
error ImportError: cannot import name 'ManagerSession' from 'catalystwan'
cause Incorrect import path - ManagerSession is not at package root.
fix
Use: from catalystwan.session import ManagerSession
error catalystwan.exceptions.CatalystWanError: Login failed. Check your credentials.
cause Invalid username, password, or vManage URL.
fix
Verify VMANAGE_URL, VMANAGE_USERNAME, VMANAGE_PASSWORD environment variables or arguments.
breaking In v0.41.0, the import path for session functions changed. Use 'catalystwan.session' instead of 'catalystwan'.
fix Update imports: from catalystwan.session import ManagerSession, create_manager_session
deprecated The 'ManagerSession' class is deprecated in favor of 'create_manager_session' context manager.
fix Replace ManagerSession() with create_manager_session() in a with statement.
gotcha vManage API requires port 443; do not include port in URL if default, but if custom port needed, include it as :port.
fix Use full URL like 'https://vmanage.example.com:8443' if non-default port.

Authenticate and list devices using synchronous session.

from catalystwan.session import create_manager_session
import os

url = os.environ.get('VMANAGE_URL', 'https://10.0.0.1')
username = os.environ.get('VMANAGE_USERNAME', 'admin')
password = os.environ.get('VMANAGE_PASSWORD', 'admin')

with create_manager_session(url=url, username=username, password=password) as session:
    devices = session.api.devices.get()
    print(len(devices))