neo4j-driver-python-skill

Implements Python applications connecting to Neo4j using the official driver v6 API.

Updated Aug 25, 2026
One-click install
npx skills add https://github.com/cardox6/steuer-graph --skill neo4j-driver-python-skill-cardox6
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: neo4j-driver-python-skill
Source: https://github.com/cardox6/steuer-graph/tree/main/.agents/skills/neo4j-driver-python-skill
Command: npx skills add https://github.com/cardox6/steuer-graph --skill neo4j-driver-python-skill-cardox6

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires neo4j, and includes references (resource) components.

What problem does it solve? Writing correct Python code against Neo4j involves many subtle pitfalls: driver lifecycle management, transaction retry semantics, result consumption rules, async patterns, and JSON serialization gotchas. This Skill provides authoritative guidance for the Neo4j Python Driver v6 so generated code avoids common bugs like leaked sessions, swallowed exceptions, and blocked event loops. ## Core Features & Use Cases - Driver & Transaction Patterns: Covers driver singletons, execute_query, managed transactions (execute_read/execute_write), implicit transactions, and explicit transactions with rollback handling. - Async & Framework Integration: Provides AsyncGraphDatabase patterns including the FastAPI lifespan pattern and asyncio.gather concurrency. - Error Handling & Data Mapping: Details exception hierarchy (ConstraintError before Neo4jError), Python↔Cypher type mapping, temporal/spatial types, and JSON-safe result access. - Use Case: You are building a FastAPI service backed by Neo4j Aura. Use this Skill to generate the lifespan-managed async driver, parameterized queries with database_ set, UNWIND batch writes, and correct exception handling. ## Quick Start Ask the assistant to write a Python script that connects to Neo4j Aura with the official driver and runs a parameterized query using execute_query.

Frequently Asked Questions about neo4j-driver-python-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to Neo4j from Python?▼

Install the neo4j package (not neo4j-driver, deprecated since v6) and create one driver with GraphDatabase.driver(URI, auth=(user, password)). Call verify_connectivity() at startup, keep the driver as a singleton, and close it on shutdown.

How do I run Cypher queries with parameters in the Neo4j Python driver?▼

Use driver.execute_query with $param placeholders and pass values as keyword arguments, always setting database_. Never use f-strings or .format() for parameters, since that enables injection and breaks plan caching.

Does the Neo4j Python driver support asyncio and FastAPI?▼

Yes, AsyncGraphDatabase mirrors the sync API for asyncio applications. Create one async driver in the FastAPI lifespan handler, await every call, and never use the sync GraphDatabase inside async code because it blocks the event loop.

Why does my Neo4j transaction callback raise ResultConsumedError?▼

A Result is a lazy cursor tied to the open transaction, so returning it unconsumed from an execute_read or execute_write callback fails. Always consume results into a list inside the callback before returning.

What are the limitations of the Neo4j Python driver skill?▼

It does not cover Cypher query authoring (use neo4j-cypher-skill), driver version upgrades (use neo4j-migration-skill), or GraphRAG pipelines with the neo4j-graphrag package (use neo4j-graphrag-skill).