skillfed

pydgraph

Official Dgraph client implementation for Python

pydgraph v25.2.0 112.7K downloads/30d#12,361 on PyPI289
Permissive license Apache-2.0 Active released

What it is and what it does

pydgraph is the official Python client library for Dgraph, a distributed graph database. It uses gRPC to communicate with Dgraph servers and provides a high-level API for querying, mutating, and managing graph data. The client handles transactions, authentication (including ACL and namespace support), and connection management, with support for both synchronous and asynchronous operations.

The library is designed for developers building applications that need to store and query graph-structured data. It abstracts away gRPC protocol details and provides Pythonic interfaces for common operations like running queries, executing mutations, performing upserts, and managing transactions with automatic retry logic for conflict resolution. The client supports multiple Dgraph server connections for load distribution and offers flexible connection configuration through connection strings or explicit stub initialization.

Use it for:

  • Build applications that query and mutate graph-structured data in a Dgraph cluster
  • Implement transaction-based workflows with automatic conflict retry and rollback handling
  • Connect to ACL-enabled Dgraph clusters with namespace isolation and token-based authentication
  • Manage schema definitions and database alterations programmatically
  • Distribute workload across multiple Dgraph servers in a cluster

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Official Python client for Dgraph, a distributed graph database, providing gRPC-based access to query, mutate, and manage graph data with transaction support.

Yes, if you are building an application that uses Dgraph as its database backend. The package is actively maintained, has low install friction, carries a permissive license, and provides comprehensive client functionality. Install only if you have a Dgraph cluster available and your use case aligns with graph database patterns; it is not useful as a standalone library.

Install

pydgraph on PyPI

pip

pip install pydgraph

uv

uv add pydgraph

poetry

poetry add pydgraph

Installing pydgraph

Before you install

Low install friction with only two runtime dependencies (grpcio and protobuf). Actively maintained with a recent release; supports Python 3.9 through 3.14. Protobuf version flexibility (4.23.0 through 6.x) accommodates both modern and legacy environments.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install pydgraph

import pydgraph

client_stub = pydgraph.DgraphClientStub('localhost:9080')
client = pydgraph.DgraphClient(client_stub)
# Execute queries, mutations, and transactions via client methods

Requires a running Dgraph server instance; Python >= 3.9 required.

Verify before relying

  • Performance characteristics and throughput limits for typical workloads
  • Async/await support maturity and real-world usage patterns
  • Retry and conflict-handling behavior under high contention

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 2 — grpcio, protobuf
Maintenance actively maintained — 170 days since the last release
Last repo commit
First released
Downloads 112,682/month — #12,361 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pydgraph-25.2.0-py3-none-any.whl

Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: DatabaseTopic :: Software Development

Tags

dgraph python clientgraph database pythondgraph grpc clientdistributed graph databasegraph query pythondgraph mutations transactionsgraph data management
graph-databasegrpc-clientdistributed-systems

More Software Development packages