pygraphistry-core
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePyGraphistry Core
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/...
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.
- 注册Graphistry服务器。
- 基于边/节点构建图(或基于宽行构建超图)。
- 根据需要绑定可视化列。
- 绘图并迭代优化。
Minimal baseline
最简基准代码
python
import os
import graphistry
graphistry.register(
api=3,
username=os.environ.get('GRAPHISTRY_USERNAME'),
password=os.environ.get('GRAPHISTRY_PASSWORD')
)python
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)
认证变体(组织+密钥流程)
python
undefinedpython
undefinedOrganization-scoped login (SSO or user/pass org routing)
组织范围登录(SSO或用户名/密码组织路由)
graphistry.register(api=3, org_name=os.environ['GRAPHISTRY_ORG_NAME'], idp_name=os.environ.get('GRAPHISTRY_IDP_NAME'))
```pythongraphistry.register(api=3, org_name=os.environ['GRAPHISTRY_ORG_NAME'], idp_name=os.environ.get('GRAPHISTRY_IDP_NAME'))
```pythonService 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']
)
```pythongraphistry.register(
api=3,
personal_key_id=os.environ['GRAPHISTRY_PERSONAL_KEY_ID'],
personal_key_secret=os.environ['GRAPHISTRY_PERSONAL_KEY_SECRET']
)
```pythonedges_df: src,dst,... and nodes_df: id,...
edges_df:包含src、dst等列;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()
undefinededges_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()
undefinedHypergraph baseline
超图基准代码
python
undefinedpython
undefinedBuild graph from multiple entity columns in one table
从单表中的多个实体列构建图
hg = graphistry.hypergraph(df, ['actor', 'event', 'location'])
hg['graph'].plot()
undefinedhg = graphistry.hypergraph(df, ['actor', 'event', 'location'])
hg['graph'].plot()
undefinedETL shaping checklist
ETL构建检查清单
- Normalize identifier columns before binding (type consistency, null handling).
src/dst/id - Prefer a plain column on both edges and nodes for legend-friendly defaults and consistent category encodings.
type - Deduplicate high-volume repeated rows before first upload.
- Materialize nodes for node-centric steps:
python
g = graphistry.edges(edges_df, 'src', 'dst').materialize_nodes()- 绑定前标准化标识符列(确保类型一致,处理空值)。
src/dst/id - 建议在边和节点表中都添加一个普通的列,以获得便于图例展示的默认设置和一致的类别编码。
type - 首次上传前对大量重复行进行去重。
- 针对以节点为中心的操作,生成实体节点表:
python
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 () before node-centric operations.
g.materialize_nodes() - Start with smaller slices for first render on large data.
- For neighborhood expansion and pattern mining, always use or
.gfql([...]). The methods.gfql("MATCH ...")andhop()are deprecated.chain() - Keep credentials in environment variables only; do not hardcode usernames/passwords/tokens.
- 确认源/目标列非空且类型正确。
- 在执行以节点为中心的操作前,按需生成实体节点表()。
g.materialize_nodes() - 处理大数据时,先使用小数据片段进行首次渲染。
- 进行邻域扩展和模式挖掘时,请始终使用或
.gfql([...])。.gfql("MATCH ...")和hop()方法已被弃用。chain() - 仅将凭证存储在环境变量中;请勿硬编码用户名/密码/令牌。
Canonical docs
规范文档
- Core 10min: https://pygraphistry.readthedocs.io/en/latest/10min.html
- Register/auth: https://pygraphistry.readthedocs.io/en/latest/server/register.html
- Install: https://pygraphistry.readthedocs.io/en/latest/install/index.html
- For analysts/devs notebooks: https://pygraphistry.readthedocs.io/en/latest/notebooks/intro.html
- Loading/shaping + AI combos: https://pygraphistry.readthedocs.io/en/latest/gfql/combo.html
- 核心10分钟教程:https://pygraphistry.readthedocs.io/en/latest/10min.html
- 注册/认证:https://pygraphistry.readthedocs.io/en/latest/server/register.html
- 安装指南:https://pygraphistry.readthedocs.io/en/latest/install/index.html
- 分析师/开发者笔记本教程:https://pygraphistry.readthedocs.io/en/latest/notebooks/intro.html
- 加载/构建+AI组合:https://pygraphistry.readthedocs.io/en/latest/gfql/combo.html ",