Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target
Cargo.lock*
__pycache__
40 changes: 19 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Edge Python API
API to connect to dRISK Edge.
# Conode Python API
API to connect to Conode.

### Useful Edge Links
Some useful links for new edge users:
### Useful Links
Some useful links for new Conode users:

- Log in to edge: [demo.drisk.ai](https://demo.drisk.ai/)
- Documentation: [demo.drisk.ai/docs](https://demo.drisk.ai/docs/)
- [Log in to Conode](https://app.drisk.ai/)
- [Documentation](https://app.drisk.ai/docs/)



Expand All @@ -16,15 +16,15 @@ pip install drisk_api

## Basic Usage

The API supports the basic building blocs for Create/Read/Update/Delete operations on the graph. For example:
The API supports the basic building blocks for Create/Read/Update/Delete operations on the graph. For example:


```python
from drisk_api import GraphClient

token = "<edge_auth_token>"
token = "<conode_auth_token>"

# create or conntect to a graph
# create or connect to a graph
new_graph = GraphClient.create_graph("a graph", token)
graph = GraphClient("graph_id", token)

Expand All @@ -43,7 +43,7 @@ graph.update_node(node_id, label="new label", size=3)
# add edges in batch
other_id = graph.create_node(label="another node")
with graph.batch():
graph.create_edge(node_id, other, weight=5.)
graph.create_edge(node_id, other_id, weight=5.)

```

Expand All @@ -52,16 +52,16 @@ with graph.batch():
We can use these building blocks to create whatever graphs we are most interested in. Below are some examples:


### Wikepedia Crawler
Copy link
Copy Markdown
Contributor

@LNS98 LNS98 Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proof that this was pre claude & friends .... (thanks btw 😶‍🌫️ )

### Wikipedia Crawler

In this example we will scrape the main url links for a given wikipedia page and create a graph out of it.
In this example we will scrape the main url links for a given wikipedia page and create a graph.


Most of the code will be leveraging the [wikipedia api](https://pypi.org/project/wikipedia/) and is not particularly important.
What is more interesting is how we can use the `api` to convert the corresponding information into a graph to then explore it in edge.
What is more interesting is how we can use the `api` to convert the corresponding information into a graph to then explore it in Conode.


First load the relevant module
First load the relevant modules

```python
import wikipedia
Expand Down Expand Up @@ -125,6 +125,8 @@ def wiki_scraper(
if page_name in visited_pages or current_depth >= max_depth:
return

visited_pages.add(page_name)

links = top_links(page.links, page.content, first_depth_max_links if current_depth == 0 else max_links)

if current_depth == 0:
Expand Down Expand Up @@ -152,20 +154,18 @@ def wiki_scraper(
new_page_node,
link,
string_cache,
visted_pages,
visited_pages,
current_depth=current_depth + 1,
max_links=max_links,
first_depth_max_links=first_depth_max_links,
)

visited_pages.add(page_name)

```

Then we can connect to our graph (or make one):

```python
TOKEN = "<edge_auth_token>"
TOKEN = "<conode_auth_token>"
graph_id = "graph_id"
home_view = "view_id"
g = GraphClient(graph_id, TOKEN)
Expand Down Expand Up @@ -197,10 +197,8 @@ with g.batch():

```

We can then head to edge to interact with the graph:
We can then head to Conode to interact with the graph:

<p align="center">
<img src="https://github.com/driskai/drisk_api/blob/main/docs/images/Napoleon-graph.png" width="80%">
</p>

![](![](![](![]())))
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module-name = "drisk_api"

[project]
name = "drisk_api"
description = "drisk_api - API to connect to dRISK Edge."
description = "drisk_api - API to connect to Conode."
version = "0.0.9"
requires-python = ">=3.8"
classifiers = [
Expand All @@ -20,5 +20,5 @@ dependencies = ["requests"]

[project.urls]
"Homepage" = "https://github.com/driskai/drisk_api/tree/main"
"Edge" = "https://demo.drisk.ai/"
"Edge Docs" = "https://demo.drisk.ai/docs/"
"Conode" = "https://app.drisk.ai/"
"Conode Docs" = "https://app.drisk.ai/docs/"
Loading