Skip to content

feat: expose graph_diff in public API + add worked example to README - #164

Open
Koushik-Salammagari wants to merge 1 commit into
Graphify-Labs:v3from
Koushik-Salammagari:feat/graph-diff-public-api
Open

Koushik-Salammagari wants to merge 1 commit into
Graphify-Labs:v3from
Koushik-Salammagari:feat/graph-diff-public-api

Conversation

@Koushik-Salammagari

Copy link
Copy Markdown

Summary

  • graph_diff is now accessible as graphify.graph_diff() via the lazy-import map in __init__.py — no need to import from the internal graphify.analyze module.
  • Add 2 tests verifying the public API is callable and returns the expected schema (new_nodes, removed_nodes, new_edges, removed_edges, summary).
  • Add a "What it looks like" section to README with a worked example showing god nodes, surprising connections, and community output from running graphify on httpx.

Motivation

god_nodes, surprising_connections, and suggest_questions were already in the public API — graph_diff (added recently) was the only analyze function missing from __init__.py. This closes the gap and makes the diff workflow scriptable without internal imports.

The README example closes issues #12 and #160 (requests for a visual/output demo).

Test plan

  • pytest tests/test_analyze.py -q — all tests pass (including 2 new public API tests)
  • No regressions in full suite

- Add `graph_diff` to the lazy-import map in `__init__.py` so callers
  can do `import graphify; graphify.graph_diff(G_old, G_new)` without
  importing from the internal `analyze` module directly.
- Add 2 tests verifying the public API is callable and returns the
  expected schema (new_nodes, removed_nodes, new_edges, removed_edges,
  summary).
- Add a "What it looks like" section to README with a worked example
  showing god nodes, surprising connections, and community output from
  running graphify on httpx.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@Koushik-Salammagari

Copy link
Copy Markdown
Author

Hi! Just checking in on this PR — happy to make any changes if needed. Let me know if there's anything blocking review.

phreakocious added a commit to phreakocious/graphify that referenced this pull request May 6, 2026
Adds graph_diff to graphify's lazy __getattr__ map so it's accessible
as graphify.graph_diff() without importing graphify.analyze. The
underlying function and graphify diff CLI verb already exist; this
just promotes it to the public surface.

Adapted from upstream PR Graphify-Labs#164 by Koushik-Salammagari.

Co-Authored-By: Claude Opus 4.7 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant