pymgclient
Memgraph database adapter for Python language
What it is and what it does
pymgclient wraps the official Memgraph C client library to provide a Python interface compliant with PEP 249's DB-API 2.0 standard. It is implemented as a C extension for CPython and supports Python 3.9 and later. The adapter enables developers to connect to a Memgraph graph database, execute Cypher queries, and retrieve results using familiar database cursor patterns—making it suitable for applications that need to interact with graph data stored in Memgraph.
The package depends on pyopenssl for secure connections, networkx for graph operations, and tzdata for timezone handling. It is actively maintained with recent releases and no known security vulnerabilities. The C extension approach means installation requires compilation on some platforms, though prebuilt wheels are provided for common architectures across multiple Python versions.
Use it for:
- Build Python applications that query and manipulate graph data stored in Memgraph using standard DB-API patterns.
- Integrate Memgraph as a backend for knowledge graphs, recommendation engines, or relationship-heavy data models in Python services.
- Develop ETL pipelines that read from or write to Memgraph using familiar cursor-based transaction semantics.
- Create graph analytics workflows where Python code needs to execute Cypher queries and process node/edge results.
- Prototype or deploy graph-based applications without learning a custom client API, leveraging DB-API 2.0 familiarity.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pymgclient is a Python adapter for Memgraph graph database, implementing the DB-API 2.0 specification to enable query execution and result fetching through a standard cursor interface.
Yes, if you are building a Python application against Memgraph and want a standards-compliant DB-API 2.0 interface. The package is actively maintained, has no known vulnerabilities, and provides prebuilt wheels for common platforms. Install friction is moderate due to C extension compilation, but wheels mitigate this for standard architectures. Suitable for production use with a running Memgraph instance.
Install
pymgclient on PyPI
pip
pip install pymgclientuv
uv add pymgclientpoetry
poetry add pymgclientInstalling pymgclient
Before you install
Medium install friction due to C extension compilation; prebuilt wheels available for Python 3.10, 3.11, 3.12, 3.13 on macOS (arm64), Linux (x86_64, aarch64), and Windows. Maintenance is active with recent releases and no known vulnerabilities.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install pymgclient
import pymgclient
conn = pymgclient.connect(host='127.0.0.1', port=7687)
cursor = conn.cursor()
cursor.execute('CREATE (n:Person {name: "John"}) RETURN n')
row = cursor.fetchone()
conn.commit()
Requires a running Memgraph database instance; C extension requires CPython (not PyPy or other implementations).
Verify before relying
- Performance characteristics and query latency compared to direct client library use
- Thread-safety guarantees and concurrent connection handling behavior
- Support for Memgraph-specific query features beyond standard DB-API 2.0
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 3 — pyopenssl, networkx, tzdata |
| Maintenance | actively maintained — 25 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 138,614/month — #11,326 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymgclient-1.6.0-cp310-cp310-macosx_14_0_arm64.whl; pymgclient-1.6.0-cp310-cp310-macosx_15_0_arm64.whl; pymgclient-1.6.0-cp310-cp310-manylinux_2_34_aarch64.whl; pymgclient-1.6.0-cp310-cp310-manylinux_2_34_x86_64.whl; pymgclient-1.6.0-cp310-cp310-win_amd64.whl; pymgclient-1.6.0-cp311-cp311-macosx_14_0_arm64.whl; pymgclient-1.6.0-cp311-cp311-macosx_15_0_arm64.whl; pymgclient-1.6.0-cp311-cp311-manylinux_2_34_aarch64.whl; pymgclient-1.6.0-cp311-cp311-manylinux_2_34_x86_64.whl; pymgclient-1.6.0-cp311-cp311-win_amd64.whl; pymgclient-1.6.0-cp312-cp312-macosx_14_0_arm64.whl; pymgclient-1.6.0-cp312-cp312-macosx_15_0_arm64.whl; pymgclient-1.6.0-cp312-cp312-manylinux_2_34_aarch64.whl; pymgclient-1.6.0-cp312-cp312-manylinux_2_34_x86_64.whl; pymgclient-1.6.0-cp312-cp312-win_amd64.whl; pymgclient-1.6.0-cp313-cp313-macosx_14_0_arm64.whl; pymgclient-1.6.0-cp313-cp313-macosx_15_0_arm64.whl; pymgclient-1.6.0-cp313-cp313-manylinux_2_34_aarch64.whl; pymgclient-1.6.0-cp313-cp313-manylinux_2_34_x86_64.whl; pymgclient-1.6.0-cp313-cp313-win_amd64.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
pymssqlpymssql provides a Python DB-API interface to…
copyleft · top 1,000 on PyPI
PyMySQLPyMySQL is a pure-Python MySQL and MariaDB…
permissive · top 1,000 on PyPI
ydb-dbapiA Python DBAPI driver for YDB that provides…
unclear · top 5,000 on PyPI
psycopg2PostgreSQL database adapter for Python that…
copyleft · top 1,000 on PyPI
psycopg2-binarypsycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
pg8000pg8000 is a pure-Python PostgreSQL driver that…
permissive · top 1,000 on PyPI
neo4jOfficial Python driver for connecting to and…
permissive · top 5,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
neo4j-driverPython driver for connecting to and querying…
permissive · top 15,000 on PyPI
pydynamodbPyDynamoDB is a DB API 2.0 client for Amazon…
permissive · top 15,000 on PyPI