Skip to content

Commit 0fbd035

Browse files
committed
Added count script
1 parent e47d8af commit 0fbd035

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

GEXF-export.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import matplotlib.pyplot as plt
55

66
# --- CONFIG ---
7-
url = url = "https://raw.githubusercontent.com/SingularityNET-Archive/SingularityNET-Archive/refs/heads/main/Data/Snet-Ambassador-Program/Meeting-Summaries/2025/meeting-summaries-array.json" # Replace with your URL
7+
url = "https://raw.githubusercontent.com/SingularityNET-Archive/SingularityNET-Archive/refs/heads/main/Data/Snet-Ambassador-Program/Meeting-Summaries/2025/meeting-summaries-array.json" # Replace with your URL
88
output_gexf = "all_workgroups_graph_sanitized.gexf"
99

1010
# --- 1. Fetch remote JSON safely ---
@@ -22,6 +22,10 @@
2222
else:
2323
raise Exception("Unexpected JSON structure; expected dict or list")
2424

25+
# --- NEW: Count top-level values ---
26+
top_level_count = len(workgroups)
27+
print(f"🔹 Number of top-level workgroup entries: {top_level_count}")
28+
2529
# --- 2. Helper functions ---
2630
def safe_get(d, keys, default=None):
2731
"""Safely walk nested dict keys."""

count.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import requests
2+
import json
3+
4+
url = "https://raw.githubusercontent.com/SingularityNET-Archive/SingularityNET-Archive/refs/heads/main/Data/Snet-Ambassador-Program/Meeting-Summaries/2025/meeting-summaries-array.json"
5+
6+
# Fetch the JSON from the URL
7+
response = requests.get(url)
8+
data = response.json()
9+
10+
# Ensure we’re always working with a list at the top level
11+
if isinstance(data, list):
12+
top_level_items = data
13+
else:
14+
top_level_items = [data]
15+
16+
# Print only the workgroup value for each top-level item
17+
for index, item in enumerate(top_level_items, start=1):
18+
if isinstance(item, dict):
19+
workgroup = item.get("workgroup", "Unknown Workgroup")
20+
print(f"Item {index} workgroup: {workgroup}")
21+
else:
22+
print(f"Item {index} is not a dictionary (type: {type(item).__name__})")
23+

0 commit comments

Comments
 (0)