This project has been archived by its maintainers, and is no longer receiving any updates.
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
Local Installation Usage
Run the tool:
python ipf_tables_to_excel/main.py --help
🚀 IP Fabric Tables to Excel Exporter! 🚀
Retrieving only running, loading, loaded snapshots. To load all snapshots set `unloaded` to True.
usage: main.py [-h] [--ipf-tables tables/spanning-tree/inconsistencies/ports-multiple-neighbors [tables/spanning-tree/inconsistencies/ports-multiple-neighbors ...]]
[--device_hostname device_name [device_name ...]] [--print-tables PRINT_TABLES]
fetch tables from IP Fabric and insert into a single excel file with multiple sheets
options:
-h, --help show this help message and exit
--ipf-tables tables/spanning-tree/inconsistencies/ports-multiple-neighbors [tables/spanning-tree/inconsistencies/ports-multiple-neighbors ...]
API or Front end URL for IP Fabric tables to fetch. Can be used multiple times.
--device_hostname device_name [device_name ...]
Device Hostname to fetch data for. Can be used multiple times. If not provided, all devices will be used.
--print-tables PRINT_TABLES
Print first 3 rows of each table fetched
--output-file-name OUTPUT_FILE_NAME
Name or Path of the output file. Default is output.xlsx
Examples:
Poetry
poetry run ipfabric-tables-to-excel --ipf-tables tables/networks/routes --device_hostname L1EXOS1 --ipf-tables inventory/hosts --device_hostname L21PE192 --output-file-name "testing"
🚀 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-matrixis not supported. There is no 'sn' column.- This table has both a
local_snandremote_sncolumn. This tool only supports tables with a single 'sn' column. - This table is curated from
technology/interfaces/connectivity-matrix/unmanaged-neighbors-detailtable 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!
Metadata
Release files for ipfabric-tables-to-excel 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ipfabric_tables_to_excel-0.1.1.tar.gz | 4.0 kB | Without provenance | Details for ipfabric_tables_to_excel-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ipfabric_tables_to_excel-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for ipfabric_tables_to_excel-0.1.1-py3-none-any.whl |
Total release size: 8.8 kB
Release files / ipfabric_tables_to_excel-0.1.1.tar.gz
| Download URL | ipfabric_tables_to_excel-0.1.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b43b4cdc50f852d878ae3dbfae336038b4ef9e8b58174100f5e830270b0affc
|
|
BLAKE2b-256 checksum How to use checksums |
812b149f183d927ea19ea783c4ef89c6cb6cba026774294161304b8cc94af7b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.11.4 Darwin/23.4.0
|
Release files / ipfabric_tables_to_excel-0.1.1-py3-none-any.whl
| Download URL | ipfabric_tables_to_excel-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f5f0adc0b4e6c041266103296cb794542ef680b49f77e1e4aaaf169ad50f7cb
|
|
BLAKE2b-256 checksum How to use checksums |
9e883f4f7b816b2a8c1fdd5d54249aeef65b2232e856b454ffd30fb48e02963a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.11.4 Darwin/23.4.0
|
Security for ipfabric-tables-to-excel 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.