Command Line tool to export IP Fabric Tables to Excel
Project description
IP Fabric Tables to Excel
This Command Line Tool is used to convert IP Fabric tables to a single Microsoft Excel file.
Requirements:
- Python 3.8+
- IP Fabric Python SDK
- IP Fabric API Token or Username/Password
Set up .env file:
cat .env
IPF_TOKEN='mylongtokenstring123456789'
IPF_URL='https://ipfabric.is.awesome'
Installation:
Pip/PyPI
pip install ipfabric-tables-to-excel
Local Installation
- Clone the repository:
git clone
- Change directory to the repository:
cd ipfabric-tables-to-excel
- Install the package:
pip install -r requirements.txt
Usage:
Poetry
Ensure you have Poetry installed:
pip install -U poetry
Install the dependencies:
poetry install
Run the tool:
poetry run ipfabric-tables-to-excel --help
Pip/PyPI
Run the tool:
ipfabric-tables-to-excel --help
Examples:
Poetry
poetry run ipfabric-tables-to-excel --ipf-tables tables/networks/routes --device_hostname L1EXOS1 --ipf-tables inventory/hosts --device_hostname L21PE192
🚀 IP Fabric Tables to Excel Exporter! 🚀
Retrieving only running, loading, loaded snapshots. To load all snapshots set `unloaded` to True.
🔄Fetching data for tables/networks/routes...for device L1EXOS1...
🔄Fetching data for tables/networks/routes...for device L21PE192...
🔄Fetching data for inventory/hosts...for device L1EXOS1...
🔄Fetching data for inventory/hosts...for device L21PE192...
Exporting data to excel...
Export complete. Check output.xlsx
👋 Bye!
Pip/PyPI
ipfabric-tables-to-excel --ipf-tables tables/management/dns/settings --device_hostname L1EXOS1 --ipf-tables inventory/hosts --device_hostname L21PE192
🚀 IP Fabric Tables to Excel Exporter! 🚀
Retrieving only running, loading, loaded snapshots. To load all snapshots set `unloaded` to True.
🔄Fetching data for tables/management/dns/settings...for device L1EXOS1...
🔄Fetching data for tables/management/dns/settings...for device L21PE192...
🔄Fetching data for inventory/hosts...for device L1EXOS1...
🔄Fetching data for inventory/hosts...for device L21PE192...
Exporting data to excel...
Sheet name L21PE192_management_dns_settings is too long. Truncating to 31 characters.
Export complete. Check output.xlsx
👋 Bye!
Known Limitations
- Not all tables are supported. Only tables with a 'sn' and the 'inventory/hosts' table are supported.
- Example,
technology/interfaces/connectivity-matrix/connectivity-matrix
is not supported. There is no 'sn' column.- This table has both a
local_sn
andremote_sn
column. This tool only supports tables with a single 'sn' column. - This table is curated from
technology/interfaces/connectivity-matrix/unmanaged-neighbors-detail
table which has a 'sn' column.
- This table has both a
- Example,
ipfabric-tables-to-excel --ipf-tables technology/interfaces/connectivity-matrix/connectivity-matrix --device_hostname L1EXOS1 --ipf-tables technology/interfaces/connectivity-matrix/unmanaged-neighbors-detail --device_hostname L21PE192
🚀 IP Fabric Tables to Excel Exporter! 🚀
Retrieving only running, loading, loaded snapshots. To load all snapshots set `unloaded` to True.
🔄Fetching data for technology/interfaces/connectivity-matrix/connectivity-matrix...for device L1EXOS1...
Cant fetch data for technology/interfaces/connectivity-matrix/connectivity-matrix.
Error: Client error '422 Unprocessable Entity' for url
'https://sa-eu-demo-main01a.hel1-cloud.ipf.cx/api/v6.7/tables/interfaces/connectivity-matrix?format=%7B%22dataType%22:%22json%22%7D&filters=%7B%22and%22:[%7B%22sn%22:[%22eq%22,%22SIM0
067-0000%22]%7D]%7D&columns=[%22localMedia%22,%22siteName%22,%22id%22,%22remoteInt%22,%22localInt%22,%22remoteHost%22,%22localHost%22,%22protocol%22,%22remoteSn%22,%22remoteMedia%22,%
22localSn%22]&snapshot=4253eade-b1af-4061-ac07-caf84bf0626c'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422
Does Table technology/interfaces/connectivity-matrix/connectivity-matrix support the filter {'and': [{'sn': ['eq', 'SIM0067-0000']}]}?
🔄Fetching data for technology/interfaces/connectivity-matrix/connectivity-matrix...for device L21PE192...
Cant fetch data for technology/interfaces/connectivity-matrix/connectivity-matrix.
Error: Client error '422 Unprocessable Entity' for url
'https://sa-eu-demo-main01a.hel1-cloud.ipf.cx/api/v6.7/tables/interfaces/connectivity-matrix?format=%7B%22dataType%22:%22json%22%7D&filters=%7B%22and%22:[%7B%22sn%22:[%22eq%22,%227798
8032%22]%7D]%7D&columns=[%22localMedia%22,%22siteName%22,%22id%22,%22remoteInt%22,%22localInt%22,%22remoteHost%22,%22localHost%22,%22protocol%22,%22remoteSn%22,%22remoteMedia%22,%22lo
calSn%22]&snapshot=4253eade-b1af-4061-ac07-caf84bf0626c'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422
Does Table technology/interfaces/connectivity-matrix/connectivity-matrix support the filter {'and': [{'sn': ['eq', '77988032']}]}?
🔄Fetching data for technology/interfaces/connectivity-matrix/unmanaged-neighbors-detail...for device L1EXOS1...
🔄Fetching data for technology/interfaces/connectivity-matrix/unmanaged-neighbors-detail...for device L21PE192...
Exporting data to excel...
Sheet name L1EXOS1_technology_interfaces_connectivity-matrix_unmanaged-neighbors-detail is too long. Truncating to 31 characters.
Sheet name L21PE192_technology_interfaces_connectivity-matrix_unmanaged-neighbors-detail is too long. Truncating to 31 characters.
Export complete. Check output.xlsx
👋 Bye!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ipfabric_tables_to_excel-0.1.0.tar.gz
.
File metadata
- Download URL: ipfabric_tables_to_excel-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.4 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b49a1a3c1dbccef5b55223b68143789e0fd7c7a07dd0d75f73a15f8c5ed08dd0 |
|
MD5 | e99bc609b961504c28ff5c79d1681749 |
|
BLAKE2b-256 | c141edc3e4344549f4f57c168fa7b2fd2c9bc2c290ae324f33b15d73f5f1b9cd |
File details
Details for the file ipfabric_tables_to_excel-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ipfabric_tables_to_excel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.4 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22c1fb0cbafb07a4dd6a205ad5b4e18463799f45fb351eb4ebf65e89b82eb6ca |
|
MD5 | 894fb292847effcff1acb7f1c37df622 |
|
BLAKE2b-256 | 3cc8fc0e16a71140c3ef8f3f9a31efcd2a9681e5e458d0715e1a220ce9e89f2c |