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 (3,933 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 — 29 skills, 1 command shipped together

not rated 109repo +2 3d 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 29 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 3,933 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 20 May 2026
  • Snyk pass 20 May 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.03933
Opus 5 $0.00093 $0.01966
Sonnet 5 $0.00037 $0.00787
Haiku 4.5 $0.00019 $0.00393

Measured 11d ago against content hash 537a1ab0789e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 11d 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 · 430 lines

How it starts

The opening of the file, as written. The whole thing — 430 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 Cypherneo4j-cypher-skill
  • Driver version upgradesneo4j-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+].


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.


Driver Lifecycle

Create one Driver per application. Thread-safe, expensive to create. Never create per-request.

from neo4j import GraphDatabase

URI  = "neo4j+s://xxx.databases.neo4j.io"   # Aura
AUTH = ("neo4j", "password")

# Context manager — preferred for scripts
with GraphDatabase.driver(URI, auth=AUTH) as driver:
    driver.verify_connectivity()
    # ... work ...

# Long-lived singleton (service / web app)
driver = GraphDatabase.driver(URI, auth=AUTH)
driver.verify_connectivity()
# on shutdown:
driver.close()

Read the full file on GitHub · 430 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. 11d 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 (109 stars, last pushed 3d ago), licensed MIT. It adds 186 tokens to every session and 3,933 once invoked, about $0.0009 per session on Opus 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.

Related

Other skills, from other repositories

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use…

agent-skills-hub/agent-skills-hub · 73 tokens

astropy

Comprehensive Python library for astronomy and astrophysics. This skill should be used when working with astronomical data including celestial coordinates, physical units, FITS files, cosmological calculations, time systems, tables, world coordinate systems (WCS), and astronomical data analysis. Use when tasks involve…

agent-skills-hub/agent-skills-hub · 84 tokens

dask

Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed…

agent-skills-hub/agent-skills-hub · 69 tokens

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

agent-skills-hub/agent-skills-hub · 63 tokens

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use…

agent-skills-hub/agent-skills-hub · 76 tokens

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for…

agent-skills-hub/agent-skills-hub · 67 tokens