Skip to content

Latest commit

 

History

History

Folders and files

README.md

Simple Example Project

Simple project demonstrating the use of pydgraph, the official python client for Dgraph.

Setup

Install uv

This project uses uv for dependency management. Install it with:

macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Using pip:

pip install uv

For more installation options, visit: https://docs.astral.sh/uv/getting-started/installation/

Install Dependencies

uv sync

This will create a virtual environment and install pydgraph and its dependencies.

Running

Start Dgraph

Start by spinning up a Dgraph cluster locally. Run docker compose up. Note that the security flag uses a blanket whitelist. This is for convenience when testing locally. Do not use this in a production environment.

Run the Sample Code

uv run python simple.py

You can explore the source code in the simple.py file. Run docker compose down to tear down the cluster.