PyGraphistry Core
Doc routing (local + canonical)
- First route with
../pygraphistry/references/pygraphistry-readthedocs-toc.md.
- Use
../pygraphistry/references/pygraphistry-readthedocs-top-level.tsv for section-level shortcuts.
- Only scan
../pygraphistry/references/pygraphistry-readthedocs-sitemap.xml when a needed page is missing.
- Use one batched discovery read before deep-page reads; avoid
cat * and serial micro-reads.
- In user-facing answers, prefer canonical
https://pygraphistry.readthedocs.io/en/latest/... links.
Quick workflow
- Register to a Graphistry server.
- Build graph from edges/nodes (or hypergraph from wide rows).
- Bind visual columns as needed.
- Plot and iterate.
Minimal baseline
import os
import graphistry
graphistry.register(
api=3,
username=os.environ.get('GRAPHISTRY_USERNAME'),
password=os.environ.get('GRAPHISTRY_PASSWORD')
)
Auth variants (org + key flows)
# Organization-scoped login (SSO or user/pass org routing)
graphistry.register(api=3, org_name=os.environ['GRAPHISTRY_ORG_NAME'], idp_name=os.environ.get('GRAPHISTRY_IDP_NAME'))
# Service account / personal key flow
graphistry.register(
api=3,
personal_key_id=os.environ['GRAPHISTRY_PERSONAL_KEY_ID'],
personal_key_secret=os.environ['GRAPHISTRY_PERSONAL_KEY_SECRET']
)
# edges_df: src,dst,... and nodes_df: id,...
edges_df['type'] = edges_df.get('type', 'transaction')
nodes_df['type'] = nodes_df.get('type', 'entity')
g = graphistry.edges(edges_df, 'src', 'dst').nodes(nodes_df, 'id')
g.plot()
Hypergraph baseline
# Build graph from multiple entity columns in one table
hg = graphistry.hypergraph(df, ['actor', 'event', 'location'], engine='pandas')
hg['graph'].plot()
ETL shaping checklist
- Normalize identifier columns before binding (
src/dst/id type consistency, null handling).
- Prefer a plain
type column on both edges and nodes for legend-friendly defaults and consistent category encodings.
- Deduplicate high-volume repeated rows before first upload.
- Materialize nodes for node-centric steps:
g = graphistry.edges(edges_df, 'src', 'dst').materialize_nodes()
Practical checks
- Confirm source/destination columns are non-null and correctly typed.
- Materialize nodes if needed (
g.materialize_nodes()) before node-centric operations.
- Start with smaller slices for first render on large data.
- For GFQL execution, explicitly request
engine='polars' to retain Polars results; the automatic/default path does not select Polars. The exact engine literals are 'pandas', 'cudf', 'dask', 'dask_cudf', 'polars', 'polars-gpu', 'auto' — 'polars-gpu' is hyphenated, and there is no polars_gpu spelling.
gfql() has no strict= argument. Off-engine analytic policy is set with graphistry.compute.gfql.lazy.set_call_mode('auto'|'strict') or the GFQL_POLARS_CALL_MODE env var; see pygraphistry-gfql for the engine section.
- Do not recommend
hypergraph(..., engine='polars'|'polars-gpu') yet: the current API annotation lists them, but the upstream hypergraph frame implementation still lacks their dispatch path. Use the supported pandas/cuDF hypergraph engines, then opt into Polars/Polars-GPU for subsequent GFQL work when appropriate.
- For neighborhood expansion and pattern mining, always use
.gfql([...]) or .gfql("MATCH ..."). The methods hop() and chain() are deprecated.
- Keep credentials in environment variables only; do not hardcode usernames/passwords/tokens.
Canonical docs
1---2name: pygraphistry-core3description: Core PyGraphistry workflow: auth, DataFrame-to-graph shaping, and first interactive plot. Use when asked to "register graphistry", "get started with pygraphistry", "plot my edges dataframe", "graphistry.register()", "bind src and dst columns", "make a hypergraph", "materialize nodes", or any first-graph / ETL-to-plot task. Also triggers on "first graphistry graph", "graphistry install", "api=3", or questions about graphistry auth credentials. Proactively suggest when the user is setting up graphistry for the first time or can't get a basic plot working from a DataFrame.4---56# PyGraphistry Core78## Doc routing (local + canonical)9- First route with `../pygraphistry/references/pygraphistry-readthedocs-toc.md`.10- Use `../pygraphistry/references/pygraphistry-readthedocs-top-level.tsv` for section-level shortcuts.11- Only scan `../pygraphistry/references/pygraphistry-readthedocs-sitemap.xml` when a needed page is missing.12- Use one batched discovery read before deep-page reads; avoid `cat *` and serial micro-reads.13- In user-facing answers, prefer canonical `https://pygraphistry.readthedocs.io/en/latest/...` links.1415## Quick workflow161. Register to a Graphistry server.172. Build graph from edges/nodes (or hypergraph from wide rows).183. Bind visual columns as needed.194. Plot and iterate.2021## Minimal baseline22```python23import os24import graphistry2526graphistry.register(27 api=3,28 username=os.environ.get('GRAPHISTRY_USERNAME'),29 password=os.environ.get('GRAPHISTRY_PASSWORD')30)31```3233## Auth variants (org + key flows)34```python35# Organization-scoped login (SSO or user/pass org routing)36graphistry.register(api=3, org_name=os.environ['GRAPHISTRY_ORG_NAME'], idp_name=os.environ.get('GRAPHISTRY_IDP_NAME'))37```3839```python40# Service account / personal key flow41graphistry.register(42 api=3,43 personal_key_id=os.environ['GRAPHISTRY_PERSONAL_KEY_ID'],44 personal_key_secret=os.environ['GRAPHISTRY_PERSONAL_KEY_SECRET']45)46```4748```python49# edges_df: src,dst,... and nodes_df: id,...50edges_df['type'] = edges_df.get('type', 'transaction')51nodes_df['type'] = nodes_df.get('type', 'entity')52g = graphistry.edges(edges_df, 'src', 'dst').nodes(nodes_df, 'id')53g.plot()54```5556## Hypergraph baseline57```python58# Build graph from multiple entity columns in one table59hg = graphistry.hypergraph(df, ['actor', 'event', 'location'], engine='pandas')60hg['graph'].plot()61```6263## ETL shaping checklist64- Normalize identifier columns before binding (`src/dst/id` type consistency, null handling).65- Prefer a plain `type` column on both edges and nodes for legend-friendly defaults and consistent category encodings.66- Deduplicate high-volume repeated rows before first upload.67- Materialize nodes for node-centric steps:68```python69g = graphistry.edges(edges_df, 'src', 'dst').materialize_nodes()70```7172## Practical checks73- Confirm source/destination columns are non-null and correctly typed.74- Materialize nodes if needed (`g.materialize_nodes()`) before node-centric operations.75- Start with smaller slices for first render on large data.76- For GFQL execution, explicitly request `engine='polars'` to retain Polars results; the automatic/default path does not select Polars. The exact engine literals are `'pandas'`, `'cudf'`, `'dask'`, `'dask_cudf'`, `'polars'`, `'polars-gpu'`, `'auto'` — `'polars-gpu'` is hyphenated, and there is no `polars_gpu` spelling.77- `gfql()` has no `strict=` argument. Off-engine analytic policy is set with `graphistry.compute.gfql.lazy.set_call_mode('auto'|'strict')` or the `GFQL_POLARS_CALL_MODE` env var; see `pygraphistry-gfql` for the engine section.78- Do not recommend `hypergraph(..., engine='polars'|'polars-gpu')` yet: the current API annotation lists them, but the upstream hypergraph frame implementation still lacks their dispatch path. Use the supported pandas/cuDF hypergraph engines, then opt into Polars/Polars-GPU for subsequent GFQL work when appropriate.79- For neighborhood expansion and pattern mining, always use `.gfql([...])` or `.gfql("MATCH ...")`. The methods `hop()` and `chain()` are deprecated.80- Keep credentials in environment variables only; do not hardcode usernames/passwords/tokens.8182## Canonical docs83- Core 10min: https://pygraphistry.readthedocs.io/en/latest/10min.html84- Register/auth: https://pygraphistry.readthedocs.io/en/latest/server/register.html85- Install: https://pygraphistry.readthedocs.io/en/latest/install/index.html86- For analysts/devs notebooks: https://pygraphistry.readthedocs.io/en/latest/notebooks/intro.html87- Loading/shaping + AI combos: https://pygraphistry.readthedocs.io/en/latest/gfql/combo.html