pygraphistry-connectors
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePyGraphistry Connectors
PyGraphistry 连接器
Doc routing (local + canonical)
文档路由(本地+规范)
- First route with .
../pygraphistry/references/pygraphistry-readthedocs-toc.md - Use for section-level shortcuts.
../pygraphistry/references/pygraphistry-readthedocs-top-level.tsv - Only scan when a needed page is missing.
../pygraphistry/references/pygraphistry-readthedocs-sitemap.xml - Use one batched discovery read before deep-page reads; avoid and serial micro-reads.
cat * - In user-facing answers, prefer canonical links.
https://pygraphistry.readthedocs.io/en/latest/...
- 首先使用 进行路由。
../pygraphistry/references/pygraphistry-readthedocs-toc.md - 使用 作为章节级快捷方式。
../pygraphistry/references/pygraphistry-readthedocs-top-level.tsv - 仅当所需页面缺失时,才扫描 。
../pygraphistry/references/pygraphistry-readthedocs-sitemap.xml - 在深度页面读取前先进行一次批量发现读取;避免使用 和串行微读取。
cat * - 在面向用户的回答中,优先使用规范的 链接。
https://pygraphistry.readthedocs.io/en/latest/...
Strategy
策略
- Prefer dataframe-first ingestion when practical, then bind with .
edges()/nodes() - Use connector-specific notebook patterns when auth/query semantics are specialized.
- For very large datasets, push filtering/aggregation upstream before plotting.
- Keep connector and Graphistry credentials in env vars or secret stores; no hardcoded keys.
- Never use placeholder literals like /
username='user'/password='pass'; useusername='...'oros.environ[...].os.environ.get(...) - For concise tasks, respond with a single compact code block and minimal prose.
- In concise snippets, prefer explicit privacy literals (or
'private') over placeholder variables.'organization'
- 实际可行时优先采用数据框优先的导入方式,然后通过 进行绑定。
edges()/nodes() - 当认证/查询语义特殊时,使用连接器特定的笔记本模式。
- 对于超大型数据集,在绘图前先在数据源端进行过滤/聚合操作。
- 将连接器和Graphistry凭证存储在环境变量或密钥存储中;不要硬编码密钥。
- 切勿使用 /
username='user'/password='pass'这类占位符字面量;请使用username='...'或os.environ[...]。os.environ.get(...) - 对于简洁任务,返回单个紧凑的代码块和最少的说明文字。
- 在简洁代码片段中,优先使用明确的隐私字面量(或
'private')而非占位符变量。'organization'
Connector triage rubric
连接器分类准则
- Use native graph-db connectors (, Neptune/TigerGraph flows) when traversal is best expressed upstream.
cypher() - For local Cypher-style queries on in-memory PyGraphistry graphs (no external DB), use . Note:
g.gfql("MATCH ...")is a distinct Neo4j/Memgraph/Neptune connector, not the same as local GFQL Cypher.graphistry.cypher() - Use SQL/log source extraction when your source is tabular or SIEM-centric, then bind in PyGraphistry.
- If unsure, start with source-native query -> dataframe -> , then optimize connector depth.
edges()/nodes()
- 当遍历操作在数据源端表达效果最佳时,使用原生图数据库连接器(、Neptune/TigerGraph工作流)。
cypher() - 对内存中的PyGraphistry图(无外部数据库)执行本地类Cypher查询时,使用 。注意:
g.gfql("MATCH ...")是一个独立的Neo4j/Memgraph/Neptune连接器,与本地GFQL Cypher不同。graphistry.cypher() - 当数据源为表格型或SIEM中心型时,使用SQL/日志源提取,然后在PyGraphistry中进行绑定。
- 若不确定,从数据源原生查询 -> 数据框 -> 开始,然后优化连接器深度。
edges()/nodes()
Connector families
连接器系列
- Graph DBs: Neo4j, Neptune, TigerGraph, Memgraph, Arango.
- Data/SQL: Databricks, PostgreSQL, Spanner, warehouse-style pipelines.
- Logs/SIEM: Splunk, Kusto, AlienVault.
- Compute/layout plugins: networkx, graphviz, cugraph, igraph, hypernetx.
- 图数据库:Neo4j、Neptune、TigerGraph、Memgraph、Arango。
- 数据/SQL:Databricks、PostgreSQL、Spanner、数据仓库式管道。
- 日志/SIEM:Splunk、Kusto、AlienVault。
- 计算/布局插件:networkx、graphviz、cugraph、igraph、hypernetx。
Minimal examples
最简示例
python
undefinedpython
undefinedNeo4j/Memgraph/Neptune connector (runs query on external DB server)
Neo4j/Memgraph/Neptune连接器(在外部数据库服务器上运行查询)
g = graphistry.cypher('MATCH (a)-[r]->(b) RETURN a,b,r')
g.plot()
```pythong = graphistry.cypher('MATCH (a)-[r]->(b) RETURN a,b,r')
g.plot()
```pythonLocal Cypher via GFQL (no external DB needed — preferred for local graphs)
通过GFQL执行本地Cypher(无需外部数据库 —— 适用于本地图)
g2 = g.gfql("MATCH (a)-[r]->(b) WHERE a.score > 10 RETURN a.id, b.id")
```pythong2 = g.gfql("MATCH (a)-[r]->(b) WHERE a.score > 10 RETURN a.id, b.id")
```pythonGraphistry org/service-account auth before connector workflows
连接器工作流前的Graphistry组织/服务账户认证
graphistry.register(
api=3,
org_name=os.environ.get('GRAPHISTRY_ORG_NAME'),
personal_key_id=os.environ.get('GRAPHISTRY_PERSONAL_KEY_ID'),
personal_key_secret=os.environ.get('GRAPHISTRY_PERSONAL_KEY_SECRET')
)
```pythongraphistry.register(
api=3,
org_name=os.environ.get('GRAPHISTRY_ORG_NAME'),
personal_key_id=os.environ.get('GRAPHISTRY_PERSONAL_KEY_ID'),
personal_key_secret=os.environ.get('GRAPHISTRY_PERSONAL_KEY_SECRET')
)
```pythonGeneric dataframe path after source-specific query/extract
数据源特定查询/提取后的通用数据框路径
edges_df: src,dst,...
edges_df: src,dst,...
g = graphistry.edges(edges_df, 'src', 'dst')
graphistry.privacy(mode='private')
plot_url = g.plot(render=False)
```pythong = graphistry.edges(edges_df, 'src', 'dst')
graphistry.privacy(mode='private')
plot_url = g.plot(render=False)
```pythonConnector-oriented flow with explicit nodes + focused GFQL slice
带有明确节点和聚焦GFQL切片的连接器导向工作流
Example source can be Neo4j/Splunk -> dataframe extraction
示例数据源可以是Neo4j/Splunk -> 数据框提取
g = graphistry.edges(edges_df, 'src', 'dst').nodes(nodes_df, 'id')
g_focus = g.gfql([...]).name('connector-slice')
graphistry.privacy(mode='organization')
plot_url = g_focus.plot(render=False)
undefinedg = graphistry.edges(edges_df, 'src', 'dst').nodes(nodes_df, 'id')
g_focus = g.gfql([...]).name('connector-slice')
graphistry.privacy(mode='organization')
plot_url = g_focus.plot(render=False)
undefinedCanonical docs
规范文档
- Plugins overview: https://pygraphistry.readthedocs.io/en/latest/plugins.html
- Connector notebooks: https://pygraphistry.readthedocs.io/en/latest/notebooks/plugins.connectors.html
- Compute/layout plugin notebooks: https://pygraphistry.readthedocs.io/en/latest/notebooks/plugins.compute.html
- Notebooks index: https://pygraphistry.readthedocs.io/en/latest/notebooks/index.html
- 插件概述:https://pygraphistry.readthedocs.io/en/latest/plugins.html
- 连接器笔记本:https://pygraphistry.readthedocs.io/en/latest/notebooks/plugins.connectors.html
- 计算/布局插件笔记本:https://pygraphistry.readthedocs.io/en/latest/notebooks/plugins.compute.html
- 笔记本索引:https://pygraphistry.readthedocs.io/en/latest/notebooks/index.html