garphield for Python
Explore graphs visually from a notebook. Pass a NetworkX graph or pandas
DataFrame to show() and get an interactive Garphield view inline - then
open the full workbench to build stories, apply layouts, and return the
result to Python.
import garphield as gf
import networkx as nx
G = nx.karate_club_graph()
view = gf.show(
G,
node_color="club",
node_size=G.degree,
node_label=str,
)
Once the view is displayed, drive it from Python:
view.select([0, 1, 2]).fit()
view.bind("node_color", gf.algorithm("louvain", resolution=1.1))
edited = view.to_project()
Install
pip install garphield
With NetworkX and pandas adapters:
pip install 'garphield[tables,networkx]'
From pandas
import pandas as pd
from garphield import Project
edges = pd.DataFrame({"source": ["a"], "target": ["b"], "weight": [1.5]})
project = Project.from_pandas(edges)
tables = project.to_pandas()
Project files
Read, validate, and write .gph project files:
from garphield import Project
project = Project.load("project.gph")
print(project.semantic_fingerprint())
project.save("project-copy.gph")
Project.save() writes deterministic, human-readable JSON. Semantic and
project fingerprints use RFC 8785/JCS canonical bytes.
Notebook round-trip
The wheel carries a version-matched notebook renderer, so the view works without a hosted renderer or CDN. Use Open in Garphield to continue in the full workbench at garphield.com, then Return to notebook to bring the result back to Python.
Use chrome=["minimap"] or chrome=["toolbar"] to keep embeds
lightweight. project.save_html("graph.html", chrome=["minimap"]) writes
a standalone interactive HTML file.
Environments
Local Jupyter, VS Code notebooks, JupyterHub, Google Colab, and Snowflake
Snowpark notebooks are resolved automatically. For Snowpark, use
show_snowpark() which materializes selected tables in the kernel before
handoff.
Links
Metadata
Release files for garphield 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| garphield-0.1.0.tar.gz | 64.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| garphield-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 141.8 kB
Release files / garphield-0.1.0.tar.gz
| Download URL | garphield-0.1.0.tar.gz |
|---|---|
| Size | 64.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2fad9826b6c5dea987d04a0b1f6fb36d921a8332ca537945202b172b6d93962d
|
|
BLAKE2b-256 checksum How to use checksums |
0e550bbce77718fb382c01224fc8bc1d47c8a18eb4259c93c2333815b475cd21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / garphield-0.1.0-py3-none-any.whl
| Download URL | garphield-0.1.0-py3-none-any.whl |
|---|---|
| Size | 77.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
471f29ebada10bc4a1cb02f8f96245f4b319815c768faad97c9bdd20b824f513
|
|
BLAKE2b-256 checksum How to use checksums |
dcfa8bed6a616fb99384bbb99fc3e3579039f555373c15cbaaa8465b728f9f34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|