Network Programmability Basics (Cisco DevNet)
The official code and labs for Cisco DevNet's Network Programmability Basics course โ from Python and REST fundamentals to NETCONF/RESTCONF/YANG, controllers and Ansible NetDevOps.
Setup, modules & run commands
Install git, Python 3 and Postman, then clone the repo. The labs use Python 3 only (ignore the Python 2 in older videos).
# Clone the course code
git clone https://github.com/CiscoDevNet/netprog_basics.git
cd netprog_basics
# Create an isolated environment (recommended per-lesson)
python3 -m venv venv
source venv/bin/activateStart here: JSON/XML/YAML data formats, what APIs are, REST API calls (curl + Postman), and Python parts 1โ3 including libraries every network engineer needs.
cd programming_fundamentals/python_part_3
pip install -r requirements.txt
# Run a lesson example, e.g. parsing structured data
python3 example.pyModel-driven device management: YANG data models, NETCONF (the SNMP replacement), RESTCONF CRUD with GET/POST/DELETE, and NX-API on Nexus.
cd network_device_apis/netconf
pip install -r requirements.txt
# Many labs run against the Always-On IOS XE DevNet Sandbox
python3 netconf_example.pyProgramming controllers and cloud platforms: APIC-EM / DNA Center, ACI object model, and Cisco Meraki cloud APIs.
cd network_controllers/meraki
pip install -r requirements.txt
# Set your sandbox/API key, then run
python3 meraki_example.pyConfiguration management and 'your network as code': Ansible Part 1 (get started), Part 2 (network config), Part 3 (network as code).
cd netdevops/ansible_part_3
# Run the network-as-code playbook
ansible-playbook -i inventory site.ymlMost lessons ship a per-folder README and requirements.txt, and many run against the free Cisco DevNet Always-On / reservable Sandboxes โ no physical lab required. Use Python 3 for all labs.