pydgraph
Official Dgraph client implementation for Python
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 pydgraphuv
uv add pydgraphpoetry
poetry add pydgraphInstalling 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
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
python-graphql-clientSends GraphQL queries, mutations, and…
permissive · top 15,000 on PyPI
gqlA GraphQL client for Python that executes…
permissive · top 1,000 on PyPI
graphqlclientA lightweight GraphQL client that sends queries…
permissive · top 15,000 on PyPI
graphene-file-uploadAdds file upload support to GraphQL mutations…
permissive · top 15,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
graphql-relayProvides Relay-compliant patterns for…
permissive · top 1,000 on PyPI
graphene-pydanticConverts Pydantic models into GraphQL object…
permissive · top 15,000 on PyPI
django-graphql-jwtAdds JSON Web Token (JWT) authentication to…
permissive · top 15,000 on PyPI
PyGreSQLPyGreSQL is a Python interface to PostgreSQL…
unclear · top 15,000 on PyPI
grpc-requestsA Python client library that uses gRPC…
permissive · top 15,000 on PyPI