--- id: pydgraph version: "25.2.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # pydgraph — Official Dgraph client implementation for Python License: permissive · Maintenance: active · Downloads: 112.7K/mo ## 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 above — 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 pip install pydgraph uv add pydgraph 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_current - Install friction: low - Maintenance: active - Downloads: 112.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags dgraph python client, graph database python, dgraph grpc client, distributed graph database, graph query python, dgraph mutations transactions, graph data management, graph-database, grpc-client, distributed-systems [View on SkillFed](https://skillfed.io/packages/pydgraph) · [View on PyPI](https://pypi.org/project/pydgraph/)