skillfed

pymgclient

Memgraph database adapter for Python language

pymgclient v1.6.0 138.6K downloads/30d#11,326 on PyPI51
Permissive license Apache-2.0 Active released

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 pymgclient

uv

uv add pymgclient

poetry

poetry add pymgclient

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: DatabaseTopic :: Database :: Front-EndsTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python Modules

Tags

memgraph python clientgraph database adapterdb-api 2.0 database drivermemgraph query executionpython graph database connector
graph-databasedb-api-2.0c-extension

More Software Development packages