neo4j-driver-python-skill

neo4j-driver-python-skill is a skill for Claude Code from neo4j-contrib/neo4j-skills. It costs 186 tokens per session (4,438 once invoked), scanned A, original, MIT.

A reference guide for using the Neo4j version 6 Python driver, which lets Python programs connect to and work with a Neo4j graph database. It covers connections, transactions, asynchronous code, results, errors, batching, and connection settings.

In plain words
What is it for?
Use it when writing or reviewing Python code that connects to Neo4j, including synchronous or asynchronous queries, transaction handling, result conversion, and UNWIND-based batch writes.
Why use it?
It helps developers avoid common mistakes when connecting Python applications to Neo4j, such as handling transactions, results, credentials, or connection pools incorrectly. It also clarifies which related Neo4j tasks belong to other guides.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the neo4j-skills plugin — 30 skills, 1 command shipped together

not rated 116repo changed 6d ago A scan Socket: passSnyk: passSkillSpector: warn 186 tokens original MIT

Good fit Use it when writing or reviewing Python code that connects to Neo4j, including synchronous or asynchronous queries, transaction handling, result conversion, and UNWIND-based batch writes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/neo4j-contrib/neo4j-skills/neo4j-driver-python-skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-driver-python-skill
Clone the repo
git clone --depth 1 https://github.com/neo4j-contrib/neo4j-skills

Made for: Claude Code.

Or install neo4j-skills, the plugin that ships this one along with the rest of its 30 skills, 1 command.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for neo4j-driver-python-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/neo4j-contrib/neo4j-skills/neo4j-driver-python-skill/github.svg)](https://agentmods.dev/skills/neo4j-contrib/neo4j-skills/neo4j-driver-python-skill)
Your own site
<a href="https://agentmods.dev/skills/neo4j-contrib/neo4j-skills/neo4j-driver-python-skill"><img src="https://agentmods.dev/badge/skills/neo4j-contrib/neo4j-skills/neo4j-driver-python-skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for neo4j-driver-python-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/neo4j-contrib/neo4j-skills/neo4j-driver-python-skill"><img src="https://agentmods.dev/badge/skills/neo4j-contrib/neo4j-skills/neo4j-driver-python-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 186 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,438 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 14 Oct 2026
  • Snyk pass 14 Oct 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 48
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00186 $0.04438
Opus 5.5 $0.00074 $0.01775
Sonnet 5.5 $0.00037 $0.00888
Haiku 4.5 $0.00019 $0.00444

Measured 6d ago against content hash f74bb8c2dc79, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

neo4j-driver-python-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

neo4j-driver-python-skill/SKILL.md · 435 lines

How it starts

The opening of the file, as written. The whole thing — 435 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

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. Python 3.14 supported [6.1+]. Pandas 3 and PyArrow 23/24 supported [6.2+]. PyArrow 25 and Bolt 6.1 uuid.UUID values supported [6.3+]; driver-created SSL contexts honour SSLKEYLOGFILE [6.3+]. Python 3.15 supported [6.4+]. Pin neo4j>=6.4.1 — 6.4.0 can spin forever on pool acquisition and double-encodes bearer tokens over HTTP Query API.

Neo4j 2026.08+ UUID properties require neo4j>=6.3 to round-trip as uuid.UUID. Storing UUID needs block store format (Enterprise); Community (aligned format) fails: storing properties of type UUID is not supported in aligned store format — store str(uuid).


Environment Variables

Load connection config from environment — never hardcode credentials.

import os
from dotenv import load_dotenv   # pip install python-dotenv

load_dotenv(".env")   # reads NEO4J_URI / NEO4J_USERNAME / NEO4J_PASSWORD / NEO4J_DATABASE

URI      = os.getenv("NEO4J_URI",      "neo4j://localhost:7687")
USER     = os.getenv("NEO4J_USERNAME", "neo4j")
PASSWORD = os.getenv("NEO4J_PASSWORD", "")
DATABASE = os.getenv("NEO4J_DATABASE", "neo4j")

.env file format:

NEO4J_URI=neo4j+s://xxx.databases.neo4j.io
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=secret
NEO4J_DATABASE=neo4j

Add .env to .gitignore. Without python-dotenv, use export in shell or os.getenv directly.

Read the full file on GitHub · 435 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago Changed f74bb8c2dc79
  2. 12d ago Changed · +3 lines ded7a1e8aff5
  3. 24d ago Changed 2dea03161fda
  4. 1mo ago Changed · +2 lines 46d20e23dc88
  5. 1mo ago First seen · 430 lines · 186 tokens per session scan A 537a1ab0789e

Subscribe to this mod's changes

neo4j-driver-python-skill is a skill published in the GitHub repository neo4j-contrib/neo4j-skills (116 stars, last pushed 4d ago), licensed MIT. It adds 186 tokens to every session and 4,438 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.