Wingpy: Cisco APIs for humans

wingpy is an elegant and simple Cisco API library for Python, built for network engineers by Wingmen Solutions.

All Cisco APIs differ in how they handle authentication, session management, rate limiting, path construction, pagination and concurrency. With wingpy you don't need to wory about all of the complexities associated with this.

Although many Cisco platforms have dedicated SDKs, each of them is designed and maintained individually and have notable differences. With wingpy, just start coding and interact directly with API endpoints! This makes it much easier to work with new Cisco platform APIs and automate across domains.

Plenty of examples and explanations are available in the User Guide

Features

  • Session maintenance
  • Rate limit handling
  • Authentication
  • Path building
  • Concurrency
  • Fully typed
  • Pagination
  • Headers

Installation

Install via uv

uv add wingpy

Install via pip

pip install wingpy

Install via poetry

poetry add wingpy

Supported APIs

  • Cisco APIC (Application Centri Infrastructure / ACI)

    from wingpy import CiscoAPIC
  • Cisco Catalyst Center

    from wingpy import CiscoCatalystCenter
  • Cisco FMC (Secure Firewall Management Center)

    from wingpy import CiscoFMC
  • Cisco Hyperfabric

    from wingpy import CiscoHyperfabric
  • Cisco ISE (Identity Service Engine)

    from wingpy import CiscoISE

Configuration

The recommended way to specify API authentication parameters is through environment variables:

  • WINGPY_*_BASE_URL
  • WINGPY_*_USERNAME
  • WINGPY_*_PASSWORD
  • WINGPY_*_TOKEN

See more in the User Guide

Usage

Import the class matching the API you want to use. See full list in the User Guide, API section

Connect to an API

Parameters can be specified as environment variables or with static values. It is your responsibility to keep your secrets safe!

from wingpy import CiscoFMC
fmc = CiscoFMC(base_url="https://1.2.3.4", username="admin", password="passw0rd")

Retrieve all items from a paginated API endpoint

Pages are retrieved in parallel for max. performance.

networks = fmc.get_all("/api/fmc_config/v1/domain/{domainUUID}/object/hosts")
# Domain UUID is automatically substituted.
# Authentication is done automatically when needed.
# Paginated results are automatically fetched and combined.
for network in networks:
    print(network["name"])

Getting help

Check the FAQ or search the documentation

To report bugs or request features, please open a GitHub issue.

View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.