<jupyter_start><jupyter_text>Spigo System Architecture<jupyter_code>import pandas as pd
import graphistry

# To specify Graphistry account & server, use:
# graphistry.register(api=3, username='...', password='...', protocol='https', server='hub.graphistry.com')
# For more options, see https://github.com/graphistry/pygraphistry#configure<jupyter_output><empty_output><jupyter_text>ETL: JSON URL -> Pandas<jupyter_code>import json
import urllib2

data = urllib2.urlopen('https://raw.githubusercontent.com/adrianco/spigo/master/json/cassandra9.json')
data = json.load(data)[u'graph']
nodes = pd.DataFrame([x for x in data if u'node' in x])
edges = pd.DataFrame([x for x in data if u'edge' in x])

data[:3]
nodes[:3]
edges[:3]<jupyter_output><empty_output><jupyter_text>Plot!<jupyter_code># Plot graph using the source/target columns as source/destination of edges
g = graphistry.bind(source='source', destination='target').bind(node='node')
g.nodes(nodes).edges(edges).plot()
hg = graphistry.hypergraph(
    pd.concat([nodes, edges], ignore_index=True),
    ['metadata', 'node', 'package', 'source', 'target'],
    direct=True,
    opts={
      'CATEGORIES': {
          'service': ['node', 'source', 'target']
      }  
    })
hg['graph'].plot()<jupyter_output>('# links', 12627)
('# events', 11893)
('# attrib entities', 740)
{'fraction_non_alphanumeric': 0.17119155354449472, 'fraction_numerical': 0.015082956259426848, 'mean_word_length': 5.702020202020202, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '406681', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 469, 'n_tokens_neox': 453, 'n_words': 96, 'path': 'demos/demos_by_use_case/logs/microservices-spigo/SystemArchitectureSpigo.ipynb', 'repo_name': 'vishalbelsare/pygraphistry', 'size': '1326'}