Skip to main content

Datagraphs python client

Project description

DataGraphs Python Client

Python client library for DataGraphs.

Installation

uv add pydatagraphs

or

pip install pydatagraphs

Quick starts

from datagraphs import Client

# Connect to a project
client = Client(
    project_name="my-project",
    api_key="your-api-key",
)

# Check the API is reachable
print(client.status())

# Retrieve all entities of a given type
products = client.get("Product")

# Query with filters and pagination
results = client.query(q="Acme", page_size=50)
from datagraphs import Client

# Connect to a project
client = Client(
    project_name="my-project",
    api_key="your-api-key",
    client_id="your-client-id",
    client_secret="your-client-secret"
)

# Read the project schema and dataset configurations
schema = client.get_schema()
datasets = client.get_datasets()

# Update the project schema and dataset configurations
client.apply_schema(schema)
client.apply_datasets(datasets)
import json
from datagraphs import Client, Gateway, Schema, Dataset

# Connect to a project
client = Client(
    project_name="my-project",
    api_key="your-api-key",
    client_id="your-client-id",
    client_secret="your-client-secret"
)
gateway = Gateway(client)

# Load / dump data via the Gateway
gateway.dump_data("./backup")
gateway.load_data(from_dir_path="./backup")

# Load / dump project via the Gateway
schema_output_path = "./schemas/"
datasets_output_path = "./datasets/"
gateway.dump_project(schema_output_path, datasets_output_path)

with open("./schemas/myproject-model-v1.0.json") as f:
    schema_data = json.load(f)
with open("./datasets/myproject-datasets-v1.0.json") as f:
    datasets_data = json.load(f)
schema = Schema.create_from(schema_data)
datasets = [Dataset.create_from(d) for d in datasets_data]
gateway.load_project(schema, datasets)

For full API documentation, please see here

Authentication

For read-only access, an API key is sufficient. For write operations, supply OAuth credentials as well:

client = Client(
    project_name="my-project",
    api_key="your-api-key",
    client_id="your-client-id",
    client_secret="your-client-secret",
)

Key classes

Class Description
Client HTTP client for the DataGraphs REST API
Gateway Higher-level wrapper class for deploying projects and bulk export/load of data
Schema In-memory representation of a project's domain model
Dataset Represents a dataset within a project

Development

Install uv, then:

uv sync                                          # create virtualenv & install deps
uv run pytest tests -v                            # unit tests
uv run pytest tests_integration -v                # integration tests
uv run pytest tests -v --capture=tee-sys          # capturing stdout/stderr
uv run pytest --cov=src --cov-report=html         # coverage report
uvx ruff check .                                  # lint

License

MIT — Copyright (c) 2026 Data Language

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydatagraphs-0.5.4.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydatagraphs-0.5.4-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file pydatagraphs-0.5.4.tar.gz.

File metadata

  • Download URL: pydatagraphs-0.5.4.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydatagraphs-0.5.4.tar.gz
Algorithm Hash digest
SHA256 1baf2c96a21ec2538b284332d98e8b566f47a84da691afb186227b08eb4170d7
MD5 3f0b30f8942ce6dbfc6b2b2be9f2d9f2
BLAKE2b-256 b3e89cc9f9c04da79d0fb2df5f947bcef325f99c6789d783ae7ca8835fe1109f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydatagraphs-0.5.4.tar.gz:

Publisher: release.yml on datalanguage/datagraphs-client-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pydatagraphs-0.5.4-py3-none-any.whl.

File metadata

  • Download URL: pydatagraphs-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydatagraphs-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 29fc1f3d8199c3f1cf7ca41c48368182f1e26be4a18419de2497608bd088c780
MD5 318e6b528cc27fbc4959abc50f150676
BLAKE2b-256 eeee6c9cb16a3f043ec6236b774f05737cf62f9b6d16cd9a289c3d308c2dac4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydatagraphs-0.5.4-py3-none-any.whl:

Publisher: release.yml on datalanguage/datagraphs-client-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page