logo Netzschleuder network catalog, repository, and centrifuge

History of cpan

The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.

[entries] Remove superfluous details of the upstream distribution from the descriptions by Tiago de Paula Peixoto dc07aa0
The descriptions mentioned incidental details of how the upstream data
are made available: the file formats (CSV, JSON, XML, GEXF, SBML, HIF,
Pajek, UCINET, ...), file names, where the files were published or
obtained from (Zenodo, figshare, Kaggle, the Pajek datasets page, the
Internet Archive), and that some networks are only available in the gt
format. These are left out; caveats about the data themselves are kept,
referring to "the data" instead of "the file". The description of
sp_baboons now lists its properties instead of the upstream columns,
and says that events without a recipient are left out.
diff --git a/entries/cpan/__init__.py b/entries/cpan/__init__.py
index f95862e..48ef46e 100644
--- a/entries/cpan/__init__.py
+++ b/entries/cpan/__init__.py
@@ -20,10 +20,10 @@ from .. import *
 import xml.etree.ElementTree as ET
 
 title = "CPAN Perl authors and distributions (2009)"
-description = """Networks of the Comprehensive Perl Archive Network (CPAN), the repository of software packages ("distributions") of the Perl programming language, from the CPAN-Explorer visualization project of RTGI/Linkfluence and the Gephi team. The networks were built from the data of CPANTS (the CPAN Testing Service), and were distributed as Gephi example data sets, as a snapshot from July 2009.
+description = """Networks of the Comprehensive Perl Archive Network (CPAN), the repository of software packages ("distributions") of the Perl programming language, from the CPAN-Explorer visualization project of RTGI/Linkfluence and the Gephi team. The networks were built from the data of CPANTS (the CPAN Testing Service), as a snapshot from July 2009.
 
-- `authors`: nodes are CPAN authors (developers), and a directed edge $i \\to j$ indicates that author $i$ uses a module written by author $j$, with `weight` equal to the number of such uses (the "cardinal" of the edge in the source file). 110 edges are self-loops (authors using their own modules).
-- `distributions`: nodes are CPAN distributions, and a directed edge $i \\to j$ indicates that distribution $i$ depends on distribution $j$. Some dependencies are listed more than once in the source file, and are kept as parallel edges.
+- `authors`: nodes are CPAN authors (developers), and a directed edge $i \\to j$ indicates that author $i$ uses a module written by author $j$, with `weight` equal to the number of such uses (the "cardinal" of the edge in the source data). 110 edges are self-loops (authors using their own modules).
+- `distributions`: nodes are CPAN distributions, and a directed edge $i \\to j$ indicates that distribution $i$ depends on distribution $j$. Some dependencies are listed more than once in the source data, and are kept as parallel edges.
 
 The networks have the following properties:
 
[entries] Add the date when each entry was added, and remove icon_hash by Tiago de Paula Peixoto beff7c9
The dates are those of the commits that first added the entries' files
(2020-08-11 for the entries of the initial commit); renamed entries keep
the date of their first name.

Changed: none
diff --git a/entries/cpan/__init__.py b/entries/cpan/__init__.py
index 61ca3c0..f95862e 100644
--- a/entries/cpan/__init__.py
+++ b/entries/cpan/__init__.py
@@ -37,7 +37,7 @@ tags = ['Technological', 'Software', 'Social', 'Collaboration', 'Weighted', 'Mul
 url = ['https://docs.gephi.org/desktop/User_Manual/Datasets/',
        'https://gephi.wordpress.com/2009/06/25/cpan-explorer-an-interactive-exploration-of-the-perl-ecosystem/']
 citation = [('S. Heymann, "CPAN-Explorer, an interactive exploration of the Perl ecosystem." Gephi blog (2009)', 'https://gephi.wordpress.com/2009/06/25/cpan-explorer-an-interactive-exploration-of-the-perl-ecosystem/')]
-icon_hash = ['588694e2a411221d0e7c6783', '5886959fa411221d0e7c6785']
+date_added = '2026-10-25'
 upstream_license = None
 upstream_prefix = 'https://docs.gephi.org/desktop/assets/files'
 files = [('cpan-authors.gexf-2903c39e102461bedb32e30ce627700b.zip:cpan-authors.gexf', 'authors', None),
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto bc3dbbd
The lists of properties at the end of the descriptions marked edge
properties with "Edge" but left node properties unmarked, or grouped
them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property
was often unclear. Every item now starts with (Node), (Edge) or (Graph),
followed by the property names, a colon and the explanation, one item
per property or group of properties; qualifications (kinds of nodes,
networks) follow the names in parentheses. Properties that were only
named got a short explanation, and a few items that named the wrong
kind of property were corrected.
diff --git a/entries/cpan/__init__.py b/entries/cpan/__init__.py
index a91522a..61ca3c0 100644
--- a/entries/cpan/__init__.py
+++ b/entries/cpan/__init__.py
@@ -27,12 +27,12 @@ description = """Networks of the Comprehensive Perl Archive Network (CPAN), the
 
 The networks have the following properties:
 
-- `name`: the name of the author or distribution.
-- `pauseid` (`authors`): the author's identifier in PAUSE, the Perl authors upload server.
-- `totalmodules` (`authors`): the total number of modules of the author.
-- `avg_kwalitee`, `avg_total_kwalitee` (`authors`): the average "kwalitee" of the author's distributions, the quality score computed by CPANTS from a set of automated checks (the exact definitions of the two variants are not documented in the source).
-- `rank` (`authors`): a rank of the author given in the source data, whose definition is not documented.
-- `weight` (`authors`): the number of uses."""
+- (Node) `name`: the name of the author or distribution.
+- (Node) `pauseid` (`authors`): the author's identifier in PAUSE, the Perl authors upload server.
+- (Node) `totalmodules` (`authors`): the total number of modules of the author.
+- (Node) `avg_kwalitee`, `avg_total_kwalitee` (`authors`): the average "kwalitee" of the author's distributions, the quality score computed by CPANTS from a set of automated checks (the exact definitions of the two variants are not documented in the source).
+- (Node) `rank` (`authors`): a rank of the author given in the source data, whose definition is not documented.
+- (Edge) `weight` (`authors`): the number of uses."""
 tags = ['Technological', 'Software', 'Social', 'Collaboration', 'Weighted', 'Multigraph', 'Metadata']
 url = ['https://docs.gephi.org/desktop/User_Manual/Datasets/',
        'https://gephi.wordpress.com/2009/06/25/cpan-explorer-an-interactive-exploration-of-the-perl-ecosystem/']
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 2c69f19
Unneeded "global files" statements, unused imports and variables,
f-strings without placeholders, duplicate keys in foodweb_little_rock
(keeping the order and the values used), and the second definition of
get_lines() in twitter_higgs. Nothing changes in the networks or
descriptions.

Changed: none
diff --git a/entries/cpan/__init__.py b/entries/cpan/__init__.py
index 6857690..a91522a 100644
--- a/entries/cpan/__init__.py
+++ b/entries/cpan/__init__.py
@@ -51,7 +51,6 @@ def fetch_upstream(force=False):
 @coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     for fname, alt, fmt in files:
         if alts is not None and alt not in alts:
[entries] New entry: cpan by Tiago de Paula Peixoto fab698a
diff --git a/entries/cpan/__init__.py b/entries/cpan/__init__.py
new file mode 100644
index 0000000..6857690
--- /dev/null
+++ b/entries/cpan/__init__.py
@@ -0,0 +1,93 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+import xml.etree.ElementTree as ET
+
+title = "CPAN Perl authors and distributions (2009)"
+description = """Networks of the Comprehensive Perl Archive Network (CPAN), the repository of software packages ("distributions") of the Perl programming language, from the CPAN-Explorer visualization project of RTGI/Linkfluence and the Gephi team. The networks were built from the data of CPANTS (the CPAN Testing Service), and were distributed as Gephi example data sets, as a snapshot from July 2009.
+
+- `authors`: nodes are CPAN authors (developers), and a directed edge $i \\to j$ indicates that author $i$ uses a module written by author $j$, with `weight` equal to the number of such uses (the "cardinal" of the edge in the source file). 110 edges are self-loops (authors using their own modules).
+- `distributions`: nodes are CPAN distributions, and a directed edge $i \\to j$ indicates that distribution $i$ depends on distribution $j$. Some dependencies are listed more than once in the source file, and are kept as parallel edges.
+
+The networks have the following properties:
+
+- `name`: the name of the author or distribution.
+- `pauseid` (`authors`): the author's identifier in PAUSE, the Perl authors upload server.
+- `totalmodules` (`authors`): the total number of modules of the author.
+- `avg_kwalitee`, `avg_total_kwalitee` (`authors`): the average "kwalitee" of the author's distributions, the quality score computed by CPANTS from a set of automated checks (the exact definitions of the two variants are not documented in the source).
+- `rank` (`authors`): a rank of the author given in the source data, whose definition is not documented.
+- `weight` (`authors`): the number of uses."""
+tags = ['Technological', 'Software', 'Social', 'Collaboration', 'Weighted', 'Multigraph', 'Metadata']
+url = ['https://docs.gephi.org/desktop/User_Manual/Datasets/',
+       'https://gephi.wordpress.com/2009/06/25/cpan-explorer-an-interactive-exploration-of-the-perl-ecosystem/']
+citation = [('S. Heymann, "CPAN-Explorer, an interactive exploration of the Perl ecosystem." Gephi blog (2009)', 'https://gephi.wordpress.com/2009/06/25/cpan-explorer-an-interactive-exploration-of-the-perl-ecosystem/')]
+icon_hash = ['588694e2a411221d0e7c6783', '5886959fa411221d0e7c6785']
+upstream_license = None
+upstream_prefix = 'https://docs.gephi.org/desktop/assets/files'
+files = [('cpan-authors.gexf-2903c39e102461bedb32e30ce627700b.zip:cpan-authors.gexf', 'authors', None),
+         ('cpan-distributions.gexf-f57afeb6aaead8a1448af643f0ded605.zip:cpan-distributions.gexf', 'distributions', None)]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    global files
+    name = __name__.split(".")[-1]
+    for fname, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        # The files are in the old GEXF 1.0 format, read here directly.
+        with open_upstream_file(name, fname, "rb") as f:
+            root = ET.parse(f).getroot()
+        attrs = {a.get("id"): a.get("title")
+                 for a in root.iter("attribute") if a.get("title") != "dummy"}
+        nodes = list(root.iter("node"))
+        idx = {n.get("id"): i for i, n in enumerate(nodes)}
+        g = Graph(directed=True)
+        g.add_vertex(len(nodes))
+        g.vp.name = g.new_vp("string", vals=[n.get("label") for n in nodes])
+        int_attrs = {"totalmodules", "rank"}
+        for aid, title in attrs.items():
+            g.vp[title] = g.new_vp("int" if title in int_attrs else
+                                   ("string" if title == "pauseid" else "double"))
+        for i, n in enumerate(nodes):
+            for av in n.iter("attvalue"):
+                title = attrs.get(av.get("id"))
+                if title is None:
+                    continue
+                val = av.get("value")
+                if title == "pauseid":
+                    g.vp[title][i] = val
+                elif title in int_attrs:
+                    g.vp[title][i] = int(val)
+                else:
+                    g.vp[title][i] = float(val)
+        edges = [(idx[e.get("source")], idx[e.get("target")], int(e.get("cardinal")))
+                 for e in root.iter("edge")]
+        E = numpy.array(edges, dtype="int64")
+        if alt == "authors":
+            g.ep.weight = g.new_ep("int")
+            g.add_edge_list(E, eprops=[g.ep.weight])
+        else:
+            g.add_edge_list(E[:, :2])
+        yield alt, g