pygraphistry-connectors

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PyGraphistry Connectors

PyGraphistry 连接器

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.
  • 首先使用
    ../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'
    /
    username='...'
    ; use
    os.environ[...]
    or
    os.environ.get(...)
    .
  • For concise tasks, respond with a single compact code block and minimal prose.
  • In concise snippets, prefer explicit privacy literals (
    'private'
    or
    'organization'
    ) over placeholder variables.
  • 实际可行时优先采用数据框优先的导入方式,然后通过
    edges()/nodes()
    进行绑定。
  • 当认证/查询语义特殊时,使用连接器特定的笔记本模式。
  • 对于超大型数据集,在绘图前先在数据源端进行过滤/聚合操作。
  • 将连接器和Graphistry凭证存储在环境变量或密钥存储中;不要硬编码密钥。
  • 切勿使用
    username='user'
    /
    password='pass'
    /
    username='...'
    这类占位符字面量;请使用
    os.environ[...]
    os.environ.get(...)
  • 对于简洁任务,返回单个紧凑的代码块和最少的说明文字。
  • 在简洁代码片段中,优先使用明确的隐私字面量(
    'private'
    'organization'
    )而非占位符变量。

Connector triage rubric

连接器分类准则

  • Use native graph-db connectors (
    cypher()
    , Neptune/TigerGraph flows) when traversal is best expressed upstream.
  • For local Cypher-style queries on in-memory PyGraphistry graphs (no external DB), use
    g.gfql("MATCH ...")
    . Note:
    graphistry.cypher()
    is a distinct Neo4j/Memgraph/Neptune connector, not the same as local GFQL 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 ->
    edges()/nodes()
    , then optimize connector depth.
  • 当遍历操作在数据源端表达效果最佳时,使用原生图数据库连接器(
    cypher()
    、Neptune/TigerGraph工作流)。
  • 对内存中的PyGraphistry图(无外部数据库)执行本地类Cypher查询时,使用
    g.gfql("MATCH ...")
    。注意:
    graphistry.cypher()
    是一个独立的Neo4j/Memgraph/Neptune连接器,与本地GFQL 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
undefined
python
undefined

Neo4j/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()

```python
g = graphistry.cypher('MATCH (a)-[r]->(b) RETURN a,b,r') g.plot()

```python

Local 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")

```python
g2 = g.gfql("MATCH (a)-[r]->(b) WHERE a.score > 10 RETURN a.id, b.id")

```python

Graphistry 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') )

```python
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') )

```python

Generic 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)

```python
g = graphistry.edges(edges_df, 'src', 'dst') graphistry.privacy(mode='private') plot_url = g.plot(render=False)

```python

Connector-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)
undefined
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)
undefined

Canonical docs

规范文档