History of congress_bills
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] Add the date when each entry was added, and remove icon_hash 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/congress_bills/__init__.py b/entries/congress_bills/__init__.py
index 0cd75d3..069df38 100644
--- a/entries/congress_bills/__init__.py
+++ b/entries/congress_bills/__init__.py
@@ -42,7 +42,7 @@ citation = [('J. H. Fowler, "Connecting the Congress: A Study of Cosponsorship N
('J. H. Fowler, "Legislative cosponsorship networks in the US House and Senate." Social Networks 28(4), 454-465 (2006)', 'https://doi.org/10.1016/j.socnet.2005.11.003'),
('A. R. Benson, R. Abebe, M. T. Schaub, A. Jadbabaie, J. Kleinberg, "Simplicial closure and higher-order link prediction." Proceedings of the National Academy of Sciences 115(48), E11221-E11230 (2018)', 'https://doi.org/10.1073/pnas.1800683115'),
('P. S. Chodrow, N. Veldt, A. R. Benson, "Generative hypergraph clustering: From blockmodels to modularity." Science Advances 7(28), eabh1303 (2021)', 'https://doi.org/10.1126/sciadv.abh1303')]
-icon_hash = '56a85c8e26855e083a2f78d7'
+date_added = '2026-10-25'
upstream_license = None
upstream_prefix = 'gdrive://'
_cb = '1FYu5367ijQLDjyGigbf709YpbjocYxif:tar.gz:congress-bills-full/congress-bills-full'
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) 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/congress_bills/__init__.py b/entries/congress_bills/__init__.py
index 94263b4..0cd75d3 100644
--- a/entries/congress_bills/__init__.py
+++ b/entries/congress_bills/__init__.py
@@ -30,10 +30,10 @@ The `house` and `senate` networks are subsets of the same data, prepared separat
The networks have the following properties:
-- `is_bill`: whether the node is a piece of legislation, otherwise a legislator.
-- Legislator nodes: `name`, the name of the legislator, as it appears in the source: either a surname only (mostly for older records), or "Last, First [State-District]" (state only for senators).
-- `congress`: `time` (legislation only), the date when the legislation was introduced, in days since 1970-01-01.
-- `house` and `senate`: `party` (legislators only), the political party of the legislator, "Democrat" or "Republican" (the source data only distinguish these two parties)."""
+- (Node) `is_bill`: whether the node is a piece of legislation, otherwise a legislator.
+- (Node) `name` (legislators): the name of the legislator, as it appears in the source: either a surname only (mostly for older records), or "Last, First [State-District]" (state only for senators).
+- (Node) `time` (`congress`, legislation only): the date when the legislation was introduced, in days since 1970-01-01.
+- (Node) `party` (`house` and `senate`, legislators only): the political party of the legislator, "Democrat" or "Republican" (the source data only distinguish these two parties)."""
tags = ['Political', 'Social', 'Governance', 'Unweighted', 'Timestamps', 'Metadata']
url = ['https://www.cs.cornell.edu/~arb/data/congress-bills/',
'https://www.cs.cornell.edu/~arb/data/house-bills/',
[entries] Remove unneeded code from the entries 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/congress_bills/__init__.py b/entries/congress_bills/__init__.py
index 7126f39..94263b4 100644
--- a/entries/congress_bills/__init__.py
+++ b/entries/congress_bills/__init__.py
@@ -64,7 +64,6 @@ def fetch_upstream(force=False):
@coerce_props()
@annotate()
def parse(alts=None):
- global files
name = __name__.split(".")[-1]
for fnames, alt, fmt in files:
if alts is not None and alt not in alts:
[entries] New entry: congress_bills b0911d8
diff --git a/entries/congress_bills/__init__.py b/entries/congress_bills/__init__.py
new file mode 100644
index 0000000..7126f39
--- /dev/null
+++ b/entries/congress_bills/__init__.py
@@ -0,0 +1,102 @@
+#! /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 *
+from datetime import date
+
+title = "US Congress legislation cosponsorship (1973-2004)"
+description = """Bipartite networks of members of the US Congress and the legislation they sponsored or cosponsored, from the 93rd to the 108th Congress (1973-2004). The data were compiled by James Fowler (with later contributions by Andrew Scott Waugh and Yunkyu Sohn) by retrieving the records of legislation (bills, resolutions and amendments) from the Library of Congress THOMAS legislative database, and matching its sponsor and cosponsors to legislators. Each piece of legislation is connected to its sponsor and all of its cosponsors. The data are known to contain some errors from the original database and from the matching procedure.
+
+- `congress`: legislation from both chambers, with the date when it was introduced. A few dates fall before 1973 (from 1971-04-29), likely errors in the source data. Legislators are identified by name only, and older members appear by surname only.
+- `house`: legislation from the House of Representatives, with the party of each legislator.
+- `senate`: legislation from the Senate, with the party of each legislator.
+
+The `house` and `senate` networks are subsets of the same data, prepared separately from the `congress` network (so their legislator nodes do not correspond one-to-one to those of `congress`, and they carry no dates). All legislation in them has at least one cosponsor; the selection criteria are otherwise not documented in the source. Different pieces of legislation can have exactly the same sponsor and cosponsors; they are kept as separate nodes.
+
+The networks have the following properties:
+
+- `is_bill`: whether the node is a piece of legislation, otherwise a legislator.
+- Legislator nodes: `name`, the name of the legislator, as it appears in the source: either a surname only (mostly for older records), or "Last, First [State-District]" (state only for senators).
+- `congress`: `time` (legislation only), the date when the legislation was introduced, in days since 1970-01-01.
+- `house` and `senate`: `party` (legislators only), the political party of the legislator, "Democrat" or "Republican" (the source data only distinguish these two parties)."""
+tags = ['Political', 'Social', 'Governance', 'Unweighted', 'Timestamps', 'Metadata']
+url = ['https://www.cs.cornell.edu/~arb/data/congress-bills/',
+ 'https://www.cs.cornell.edu/~arb/data/house-bills/',
+ 'https://www.cs.cornell.edu/~arb/data/senate-bills/']
+citation = [('J. H. Fowler, "Connecting the Congress: A Study of Cosponsorship Networks." Political Analysis 14(4), 456-487 (2006)', 'https://doi.org/10.1093/pan/mpl002'),
+ ('J. H. Fowler, "Legislative cosponsorship networks in the US House and Senate." Social Networks 28(4), 454-465 (2006)', 'https://doi.org/10.1016/j.socnet.2005.11.003'),
+ ('A. R. Benson, R. Abebe, M. T. Schaub, A. Jadbabaie, J. Kleinberg, "Simplicial closure and higher-order link prediction." Proceedings of the National Academy of Sciences 115(48), E11221-E11230 (2018)', 'https://doi.org/10.1073/pnas.1800683115'),
+ ('P. S. Chodrow, N. Veldt, A. R. Benson, "Generative hypergraph clustering: From blockmodels to modularity." Science Advances 7(28), eabh1303 (2021)', 'https://doi.org/10.1126/sciadv.abh1303')]
+icon_hash = '56a85c8e26855e083a2f78d7'
+upstream_license = None
+upstream_prefix = 'gdrive://'
+_cb = '1FYu5367ijQLDjyGigbf709YpbjocYxif:tar.gz:congress-bills-full/congress-bills-full'
+files = [(tuple(f"{_cb}-{x}.txt" for x in ["nverts", "simplices", "times",
+ "node-labels"]),
+ 'congress', None)]
+for _alt, _id in [("house", '1-qiSw7YPfiTzJlA73MEH6jlxibHwlhFr'),
+ ("senate", '1DDrJO5fwDGuvMfnnGvrV_m6fA_YHojKF')]:
+ files.append((tuple(f"{_id}:zip:{_alt}-bills/{x}-{_alt}-bills.txt"
+ for x in ["hyperedges", "node-names", "node-labels",
+ "label-names"]),
+ _alt, 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 fnames, alt, fmt in files:
+ if alts is not None and alt not in alts:
+ continue
+ with ExitStack() as stack:
+ fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+ if alt == "congress":
+ groups, members = read_simplices(fs[0], fs[1])
+ # Rata Die day numbers (0001-01-01 is day 1)
+ times = read_ints(fs[2]) - date(1970, 1, 1).toordinal()
+ # "<id>\t<name>", not sorted by id
+ labels = {}
+ for line in fs[3]:
+ vid, lname = line.rstrip("\n").split("\t", 1)
+ labels[int(vid) - 1] = lname
+ N = max(max(labels) + 1, members.max() + 1)
+ g = bipartite_graph(groups, members, len(times), N, "is_bill")
+ g.vp.name = g.new_vp("string")
+ for v, lname in labels.items():
+ g.vp.name[v] = lname
+ g.vp.time = g.new_vp("int")
+ g.vp.time.a[N:] = times
+ else:
+ groups, members, n = read_hyperedges(fs[0], sep=",")
+ names = [l.rstrip("\n") for l in fs[1]]
+ party = read_ints(fs[2])
+ pnames = [l.strip() for l in fs[3] if l.strip() != ""]
+ N = max(len(names), members.max() + 1)
+ g = bipartite_graph(groups, members, n, N, "is_bill")
+ g.vp.name = g.new_vp("string")
+ g.vp.party = g.new_vp("string")
+ for v, (lname, p) in enumerate(zip(names, party)):
+ g.vp.name[v] = lname
+ g.vp.party[v] = pnames[p - 1]
+ yield alt, g