neo4j-driver-python-skill
对 async 与批量导入场景支持完善,适合 Python 开发者
介绍 Neo4j Python 驱动 v6 的连接、事务、异步与数据映射用法
讲清怎么用 Neo4j Python 驱动 v6 建立连接、开会话、管理事务(显式或托管)以及 asyncio 异步模式,包含结果处理、类型映射、UNWIND 批量写和连接池调优。适合在 Python(需 ≥3.10)代码中与 Neo4j 交互、实现批量写入或调试驱动行为时使用。特别提醒包名是 `neo4j`(v6 起),并覆盖错误处理与一致性要点,便于工程化使用。
▸ 展开 SKILL.md 英文原文
Neo4j Python Driver v6 — driver lifecycle, execute_query, managed and explicit transactions, async (AsyncGraphDatabase), result handling, data type mapping, error handling, UNWIND batching, connection pool tuning, and causal consistency. Use when writing Python code that connects to Neo4j via GraphDatabase.driver, execute_query, execute_read, execute_write, AsyncGraphDatabase, neo4j.Result, or RoutingControl. Package name is `neo4j` (not neo4j-driver) since v6. Python >=3.10 required. Does NOT handle Cypher query authoring — use neo4j-cypher-skill. Does NOT cover driver upgrades or breaking changes — use neo4j-migration-skill. Does NOT cover GraphRAG pipelines (neo4j-graphrag package) — use neo4j-graphrag-skill.
帮我安装这个 skill:https://raw.githubusercontent.com/neo4j-contrib/neo4j-skills/main/neo4j-driver-python-skill/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/neo4j-contrib/neo4j-skills/main/neo4j-driver-python-skill/SKILL.md"## When to Use - Writing Python code that connects to Neo4j - Setting up driver, sessions, transactions, or async patterns - Debugging result handling, serialization, or UNWIND batching - Reviewing Neo4j driver usage in Python code ## When NOT to Use - **Writing/optimizing Cypher** → `neo4j-cypher-skill` - **Driver version upgrades** → `neo4j-migration-skill` - **GraphRAG pipelines** (`neo4j-graphrag` package) → `neo4j-graphrag-skill` --- ## Installation ```bash pip install neo4j # package name is `neo4j`, NOT `neo4j-driver` (deprecated since v6) pip install neo4j-rust-ext # optional: 3–10× faster serialization, same API ``` **Python >=3.10 required** for v6.x.