Skip to content

AnythingGraph/sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnythingGraph SDKs

Official client libraries for AnythingGraph.

This repository (AnythingGraph/sdk) contains Python, Node.js, and Go SDKs. The platform services (data-layer, RDF cache, connector, dashboard) live in the main OSS repo.

HTTP client libraries for the AnythingGraph stack:

Service Default URL SDK module
data-layer-service http://127.0.0.1:8182 data_layer / dataLayer / datalayer
rdf-cache-service http://127.0.0.1:8181 rdf_cache / rdfCache / rdfcache
connector-service http://127.0.0.1:8183 connector
dashboard API http://127.0.0.1:5180 dashboard

Layout

python/          # pip install -e ./python
nodejs/          # npm install ./nodejs
golang/          # go get github.com/anythinggraph/anythinggraph-sdk/anythinggraph

Quick start

Python

cd python && pip install -e .
python examples/supply_chain.py
from anythinggraph import AnythingGraphClient

client = AnythingGraphClient()
print(client.data_layer.health())

Node.js

cd nodejs && npm install
node examples/example.js
node examples/supply-chain.js
import { AnythingGraphClient } from 'anythinggraph-sdk';

const client = new AnythingGraphClient();
const health = await client.dataLayer.health();
const playbooks = await client.dashboard.listPlaybooks();

Go

cd golang && go build ./...
go run ./examples/supply-chain/
import "github.com/anythinggraph/anythinggraph-sdk/anythinggraph"

client := anythinggraph.NewClient(nil)
health, err := client.DataLayer.Health(context.Background())

Environment variables

Variable Used by
DATA_LAYER_URL data-layer client
RDF_CACHE_URL rdf-cache client
CONNECTOR_URL connector client
DASHBOARD_API_URL dashboard client

ReBAC (relationship-based access)

Pass subject_id and playbook_id on data-layer row and relationship list calls when using enforced playbooks (e.g. hr-relationship-access, crm-relationship-access). Headers: X-Ontox-Subject-Id, X-Ontox-Playbook-Id.

Playbook ingest

Use dashboard.playbook_webhook(playbook_id, payload) or build a full connector context and call connector.ingest(context, payload).

About

Python, Golang and NodeJS SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors