# rjyc/napalm architecture

> Architecture diagram of the GitHub repository rjyc/napalm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rjyc/napalm
- Repository: https://github.com/rjyc/napalm

## Overview

NAPALM is a Python library that gives automation clients a unified API for retrieving network-device data and manipulating configurations across vendors. The main path is a caller or CLI selecting a driver, using the shared driver contract, and reaching a vendor-specific device interface. Vendor drivers normalize device responses into shared models; configuration validation and transport helpers support that work. The README documents these capabilities, while source excerpts are partial, so edges are limited to documented or indexed references.

Main entry points: [`napalm/base/base.py`](https://github.com/rjyc/napalm/blob/develop/napalm/base/base.py) (Driver Contract), [`napalm/nxos/nxos.py`](https://github.com/rjyc/napalm/blob/develop/napalm/nxos/nxos.py) (Cisco NX-OS), [`napalm/iosxr/iosxr.py`](https://github.com/rjyc/napalm/blob/develop/napalm/iosxr/iosxr.py) (IOS XR), [`napalm/base/helpers.py`](https://github.com/rjyc/napalm/blob/develop/napalm/base/helpers.py) (Parsing Helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Shared API"]
  node_driver_loader["Driver Loader<br/>[__init__.py]"]
  node_driver_contract["Driver Contract<br/>[base.py]"]
  node_shared_models["Result Models<br/>[models.py]"]
  node_validation["Config Validation<br/>[validate.py]"]
  node_mock_driver["Mock Driver<br/>[mock.py]"]
  node_shared_helpers["Parsing Helpers<br/>[helpers.py]"]
  node_driver_errors["Driver Exceptions<br/>[exceptions.py]"]
end

subgraph group_tools["CLI and Validation"]
  node_cli["NAPALM CLI<br/>[cl_napalm.py]"]
  node_config_cli["Config CLI"]
  node_validate_cli["Validation CLI"]
end

subgraph group_drivers["Vendor Drivers"]
  node_eos["Arista EOS<br/>[eos.py]"]
  node_ios["Cisco IOS<br/>[ios.py]"]
  node_iosxr["IOS XR<br/>[iosxr.py]"]
  node_iosxr_netconf["IOS XR NETCONF<br/>[iosxr_netconf.py]"]
  node_junos["Juniper Junos<br/>[junos.py]"]
  node_nxos["Cisco NX-OS<br/>[nxos.py]"]
  node_nxos_ssh["NX-OS SSH<br/>[nxos_ssh.py]"]
end

subgraph group_transport["Device Transport"]
  node_pyiosxr["IOS XR Client<br/>[iosxr.py]"]
  node_nxapi_device["NX-API Device<br/>[device.py]"]
  node_nxapi_client["NX-API RPC Client<br/>[api_client.py]"]
  node_netmiko_helpers["Netmiko Helpers<br/>[netmiko_helpers.py]"]
end

node_caller(("Automation Caller"))
node_network_device(("Network Device"))

node_caller -->|"selects driver"| node_driver_loader
node_caller -->|"runs commands"| node_cli
node_cli -->|"loads driver"| node_driver_loader
node_config_cli -.->|"uses API"| node_driver_loader
node_validate_cli -->|"uses API"| node_driver_loader
node_driver_contract -->|"validates config"| node_validation
node_driver_contract -->|"defines results"| node_shared_models
node_mock_driver -->|"implements"| node_driver_contract
node_eos -->|"implements"| node_driver_contract
node_ios -->|"implements"| node_driver_contract
node_iosxr -->|"implements"| node_driver_contract
node_iosxr_netconf -->|"implements"| node_driver_contract
node_junos -->|"implements"| node_driver_contract
node_nxos -->|"implements"| node_driver_contract
node_nxos_ssh -->|"reuses driver"| node_nxos
node_iosxr -->|"uses client"| node_pyiosxr
node_nxos -->|"uses device API"| node_nxapi_device
node_nxapi_device -->|"dispatches RPC"| node_nxapi_client
node_eos -->|"uses helpers"| node_netmiko_helpers
node_ios -->|"uses helpers"| node_netmiko_helpers
node_iosxr -->|"uses helpers"| node_netmiko_helpers
node_nxos -->|"uses helpers"| node_netmiko_helpers
node_eos -->|"uses helpers"| node_shared_helpers
node_ios -->|"uses helpers"| node_shared_helpers
node_iosxr -->|"uses helpers"| node_shared_helpers
node_iosxr_netconf -->|"uses helpers"| node_shared_helpers
node_junos -->|"uses helpers"| node_shared_helpers
node_nxos -->|"uses helpers"| node_shared_helpers
node_eos -->|"raises errors"| node_driver_errors
node_ios -->|"raises errors"| node_driver_errors
node_iosxr -->|"raises errors"| node_driver_errors
node_iosxr_netconf -->|"raises errors"| node_driver_errors
node_junos -->|"raises errors"| node_driver_errors
node_nxos -->|"raises errors"| node_driver_errors
node_eos -.->|"communicates"| node_network_device
node_ios -.->|"communicates"| node_network_device
node_iosxr -.->|"communicates"| node_network_device
node_iosxr_netconf -.->|"communicates"| node_network_device
node_junos -.->|"communicates"| node_network_device
node_nxos -.->|"communicates"| node_network_device
node_nxos_ssh -.->|"communicates"| node_network_device

click node_cli "https://github.com/rjyc/napalm/blob/develop/napalm/base/clitools/cl_napalm.py"
click node_config_cli "https://github.com/rjyc/napalm/blob/develop/napalm/base/clitools/cl_napalm_configure.py"
click node_validate_cli "https://github.com/rjyc/napalm/blob/develop/napalm/base/clitools/cl_napalm_validate.py"
click node_driver_loader "https://github.com/rjyc/napalm/blob/develop/napalm/base/__init__.py"
click node_driver_contract "https://github.com/rjyc/napalm/blob/develop/napalm/base/base.py"
click node_shared_models "https://github.com/rjyc/napalm/blob/develop/napalm/base/models.py"
click node_validation "https://github.com/rjyc/napalm/blob/develop/napalm/base/validate.py"
click node_mock_driver "https://github.com/rjyc/napalm/blob/develop/napalm/base/mock.py"
click node_shared_helpers "https://github.com/rjyc/napalm/blob/develop/napalm/base/helpers.py"
click node_driver_errors "https://github.com/rjyc/napalm/blob/develop/napalm/base/exceptions.py"
click node_eos "https://github.com/rjyc/napalm/blob/develop/napalm/eos/eos.py"
click node_ios "https://github.com/rjyc/napalm/blob/develop/napalm/ios/ios.py"
click node_iosxr "https://github.com/rjyc/napalm/blob/develop/napalm/iosxr/iosxr.py"
click node_iosxr_netconf "https://github.com/rjyc/napalm/blob/develop/napalm/iosxr_netconf/iosxr_netconf.py"
click node_junos "https://github.com/rjyc/napalm/blob/develop/napalm/junos/junos.py"
click node_nxos "https://github.com/rjyc/napalm/blob/develop/napalm/nxos/nxos.py"
click node_nxos_ssh "https://github.com/rjyc/napalm/blob/develop/napalm/nxos_ssh/nxos_ssh.py"
click node_pyiosxr "https://github.com/rjyc/napalm/blob/develop/napalm/pyIOSXR/iosxr.py"
click node_nxapi_device "https://github.com/rjyc/napalm/blob/develop/napalm/nxapi_plumbing/device.py"
click node_nxapi_client "https://github.com/rjyc/napalm/blob/develop/napalm/nxapi_plumbing/api_client.py"
click node_netmiko_helpers "https://github.com/rjyc/napalm/blob/develop/napalm/base/netmiko_helpers.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_driver_loader,node_driver_contract,node_shared_models,node_validation,node_mock_driver,node_shared_helpers,node_driver_errors toneBlue
class node_cli,node_config_cli,node_validate_cli toneAmber
class node_eos,node_ios,node_iosxr,node_iosxr_netconf,node_junos,node_nxos,node_nxos_ssh toneMint
class node_pyiosxr,node_nxapi_device,node_nxapi_client,node_netmiko_helpers toneRose
class node_caller,node_network_device toneIndigo
```

## Components

### Shared API

- [Driver Loader](https://github.com/rjyc/napalm/blob/develop/napalm/base/__init__.py): `napalm/base/__init__.py`
- [Driver Contract](https://github.com/rjyc/napalm/blob/develop/napalm/base/base.py): `napalm/base/base.py`
- [Result Models](https://github.com/rjyc/napalm/blob/develop/napalm/base/models.py): `napalm/base/models.py`
- [Config Validation](https://github.com/rjyc/napalm/blob/develop/napalm/base/validate.py): `napalm/base/validate.py`
- [Mock Driver](https://github.com/rjyc/napalm/blob/develop/napalm/base/mock.py): `napalm/base/mock.py`
- [Parsing Helpers](https://github.com/rjyc/napalm/blob/develop/napalm/base/helpers.py): `napalm/base/helpers.py`
- [Driver Exceptions](https://github.com/rjyc/napalm/blob/develop/napalm/base/exceptions.py): `napalm/base/exceptions.py`

### CLI and Validation

- [NAPALM CLI](https://github.com/rjyc/napalm/blob/develop/napalm/base/clitools/cl_napalm.py): `napalm/base/clitools/cl_napalm.py`
- [Config CLI](https://github.com/rjyc/napalm/blob/develop/napalm/base/clitools/cl_napalm_configure.py): `napalm/base/clitools/cl_napalm_configure.py`
- [Validation CLI](https://github.com/rjyc/napalm/blob/develop/napalm/base/clitools/cl_napalm_validate.py): `napalm/base/clitools/cl_napalm_validate.py`

### Vendor Drivers

- [Arista EOS](https://github.com/rjyc/napalm/blob/develop/napalm/eos/eos.py): `napalm/eos/eos.py`
- [Cisco IOS](https://github.com/rjyc/napalm/blob/develop/napalm/ios/ios.py): `napalm/ios/ios.py`
- [IOS XR](https://github.com/rjyc/napalm/blob/develop/napalm/iosxr/iosxr.py): `napalm/iosxr/iosxr.py`
- [IOS XR NETCONF](https://github.com/rjyc/napalm/blob/develop/napalm/iosxr_netconf/iosxr_netconf.py): `napalm/iosxr_netconf/iosxr_netconf.py`
- [Juniper Junos](https://github.com/rjyc/napalm/blob/develop/napalm/junos/junos.py): `napalm/junos/junos.py`
- [Cisco NX-OS](https://github.com/rjyc/napalm/blob/develop/napalm/nxos/nxos.py): `napalm/nxos/nxos.py`
- [NX-OS SSH](https://github.com/rjyc/napalm/blob/develop/napalm/nxos_ssh/nxos_ssh.py): `napalm/nxos_ssh/nxos_ssh.py`

### Device Transport

- [IOS XR Client](https://github.com/rjyc/napalm/blob/develop/napalm/pyIOSXR/iosxr.py): `napalm/pyIOSXR/iosxr.py`
- [NX-API Device](https://github.com/rjyc/napalm/blob/develop/napalm/nxapi_plumbing/device.py): `napalm/nxapi_plumbing/device.py`
- [NX-API RPC Client](https://github.com/rjyc/napalm/blob/develop/napalm/nxapi_plumbing/api_client.py): `napalm/nxapi_plumbing/api_client.py`
- [Netmiko Helpers](https://github.com/rjyc/napalm/blob/develop/napalm/base/netmiko_helpers.py): `napalm/base/netmiko_helpers.py`

### Other components

- **Automation Caller**
- **Network Device**

## Connections

- Automation Caller → Driver Loader: selects driver (evidence: `napalm/base/__init__.py`)
- Automation Caller → NAPALM CLI: runs commands (evidence: `README.md`)
- NAPALM CLI → Driver Loader: loads driver (evidence: `napalm/base/clitools/cl_napalm.py`)
- Config CLI → Driver Loader: uses API
- Validation CLI → Driver Loader: uses API (evidence: `napalm/base/clitools/cl_napalm_validate.py`)
- Driver Contract → Config Validation: validates config (evidence: `napalm/base/base.py`)
- Driver Contract → Result Models: defines results (evidence: `napalm/base/base.py`)
- Mock Driver → Driver Contract: implements (evidence: `napalm/base/mock.py`)
- Arista EOS → Driver Contract: implements (evidence: `napalm/eos/eos.py`)
- Cisco IOS → Driver Contract: implements (evidence: `napalm/ios/ios.py`)
- IOS XR → Driver Contract: implements (evidence: `napalm/iosxr/iosxr.py`)
- IOS XR NETCONF → Driver Contract: implements (evidence: `napalm/iosxr_netconf/iosxr_netconf.py`)
- Juniper Junos → Driver Contract: implements (evidence: `napalm/junos/junos.py`)
- Cisco NX-OS → Driver Contract: implements (evidence: `napalm/nxos/nxos.py`)
- NX-OS SSH → Cisco NX-OS: reuses driver (evidence: `napalm/nxos_ssh/nxos_ssh.py`)
- IOS XR → IOS XR Client: uses client (evidence: `napalm/iosxr/iosxr.py`)
- Cisco NX-OS → NX-API Device: uses device API (evidence: `napalm/nxos/nxos.py`)
- NX-API Device → NX-API RPC Client: dispatches RPC (evidence: `napalm/nxapi_plumbing/device.py`)
- Arista EOS → Netmiko Helpers: uses helpers (evidence: `napalm/eos/eos.py`)
- Cisco IOS → Netmiko Helpers: uses helpers (evidence: `napalm/ios/ios.py`)
- IOS XR → Netmiko Helpers: uses helpers (evidence: `napalm/iosxr/iosxr.py`)
- Cisco NX-OS → Netmiko Helpers: uses helpers (evidence: `napalm/nxos/nxos.py`)
- Arista EOS → Parsing Helpers: uses helpers (evidence: `napalm/eos/eos.py`)
- Cisco IOS → Parsing Helpers: uses helpers (evidence: `napalm/ios/ios.py`)
- IOS XR → Parsing Helpers: uses helpers (evidence: `napalm/iosxr/iosxr.py`)
- IOS XR NETCONF → Parsing Helpers: uses helpers (evidence: `napalm/iosxr_netconf/iosxr_netconf.py`)
- Juniper Junos → Parsing Helpers: uses helpers (evidence: `napalm/junos/junos.py`)
- Cisco NX-OS → Parsing Helpers: uses helpers (evidence: `napalm/nxos/nxos.py`)
- Arista EOS → Driver Exceptions: raises errors (evidence: `napalm/eos/eos.py`)
- Cisco IOS → Driver Exceptions: raises errors (evidence: `napalm/ios/ios.py`)
- IOS XR → Driver Exceptions: raises errors (evidence: `napalm/iosxr/iosxr.py`)
- IOS XR NETCONF → Driver Exceptions: raises errors (evidence: `napalm/iosxr_netconf/iosxr_netconf.py`)
- Juniper Junos → Driver Exceptions: raises errors (evidence: `napalm/junos/junos.py`)
- Cisco NX-OS → Driver Exceptions: raises errors (evidence: `napalm/nxos/nxos.py`)
- Arista EOS → Network Device: communicates
- Cisco IOS → Network Device: communicates
- IOS XR → Network Device: communicates
- IOS XR NETCONF → Network Device: communicates
- Juniper Junos → Network Device: communicates
- Cisco NX-OS → Network Device: communicates
- NX-OS SSH → Network Device: communicates
