Skip to main content

Excel Dependency Graph

Installation

You can install the package from PyPI using the following command:

pip install excel-dependency-graph==0.1.0

Overview

This Python script reads an Excel file and builds a dependency graph of cell formulas using the networkx library. Each cell that contains a formula referencing other cells is represented as a directed graph node, with edges representing the dependencies. The dependency graph can be visualized and analyzed to understand how different cells are interrelated.

Features

  • Parses formulas in Excel sheets to identify cell dependencies.
  • Builds a directed dependency graph using networkx.
  • Visualizes the dependency graph with matplotlib.
  • Allows retrieval of dependencies and dependents of specific cells.
  • Saves the dependency graph in GML format.

Requirements

This script requires the following Python libraries:

  • openpyxl for reading Excel files
  • networkx for creating and handling the dependency graph
  • matplotlib for graph visualization

Install these libraries using pip:

pip install openpyxl networkx matplotlib

Usage

  1. Initialize the Graph: Instantiate the ExcelDependencyGraph class with the path to the Excel file.
  2. Build the Dependency Graph: Call the build_dependency_graph() method to parse the file and build the graph.
  3. Visualize the Graph: Use visualize_graph() to display the dependency graph.
  4. Retrieve Dependencies and Dependents:
    • get_dependencies(cell) returns cells a given cell depends on.
    • get_dependents(cell) returns cells that depend on a given cell.
  5. Save the Graph: Save the graph structure in GML format using save_graph(output_path).

Example usage

graph = ExcelDependencyGraph("example/example.xlsx")
graph.build_dependency_graph()
graph.visualize_graph()
print(graph.get_dependencies("Sheet1!A1"))
print(graph.get_dependents("Sheet1!A1"))
graph.save_graph("dependency_graph.gml")

Sample Output

image

Metadata

Release files for excel-dependency-graph 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for excel-dependency-graph 0.1.1
File Size Uploaded Provenance Actions
excel_dependency_graph-0.1.1.tar.gz 75.6 kB Without provenance Details for excel_dependency_graph-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for excel-dependency-graph 0.1.1
File Interpreter ABI Platform Actions
excel_dependency_graph-0.1.1-py3-none-any.whl Python 3 none any Details for excel_dependency_graph-0.1.1-py3-none-any.whl

Total release size: 89.4 kB

Release files / excel_dependency_graph-0.1.1.tar.gz

Download URL excel_dependency_graph-0.1.1.tar.gz
Size 75.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9adaef6f71ec78c6d802b6b942b6d021fec9e3a4ab2ae0717c99bae3ff083441
BLAKE2b-256 checksum
How to use checksums
05bc177bb3b15baa8e3cda8cc912e3ee1a1c5209ae3d7c206f50f00ac2333eea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.5

Release files / excel_dependency_graph-0.1.1-py3-none-any.whl

Download URL excel_dependency_graph-0.1.1-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03b4f2d214eb005ed2d90aa50f2559bb9cdba5e3d2992ab0ce45b32112f77fd6
BLAKE2b-256 checksum
How to use checksums
5e56729f59dda8ee28d62b00d78b28bc379422d1c24a60409cadf8533b2faecb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.5

Security for excel-dependency-graph 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page