logo Netzschleuder network catalog, repository, and centrifuge

History of currency_trading

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 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/currency_trading/__init__.py b/entries/currency_trading/__init__.py
index f58041a..8e4c1c2 100644
--- a/entries/currency_trading/__init__.py
+++ b/entries/currency_trading/__init__.py
@@ -43,7 +43,7 @@ tags = ['Economic', 'Unweighted', 'Metadata', 'Temporal']
 url = 'https://eh.net/database/international-currencies-1890-1910/'
 citation = [('M. Flandreau, C. Jobst, "The ties that divide: a network analysis of the international monetary system, 1890-1910." The Journal of Economic History 65(4), 977-1007 (2005)', 'https://doi.org/10.1017/S0022050705000379'),
             ('M. Flandreau, C. Jobst, "The empirics of international currencies: network externalities, history and persistence." The Economic Journal 119(537), 643-664 (2009)', 'https://doi.org/10.1111/j.1468-0297.2009.02219.x')]
-icon_hash = '595b1312549f067e0263b510'
+date_added = '2026-10-25'
 upstream_license = None
 # The data file is no longer served by EH.Net (the database page remains);
 # it is obtained from the Internet Archive.
[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/currency_trading/__init__.py b/entries/currency_trading/__init__.py
index 958d52a..f58041a 100644
--- a/entries/currency_trading/__init__.py
+++ b/entries/currency_trading/__init__.py
@@ -25,8 +25,18 @@ description = """Directed networks of the international circulation of 45 curren
 
 The networks have the following properties:
 
-- Nodes: `name`, the three-letter code of the country (e.g. "GBR", "DEU", "AUH" for Austria-Hungary, "OTT" for the Ottoman Empire); and explanatory variables used by Flandreau and Jobst (2009), which refer to 1900 unless stated otherwise (NaN if missing): `gold`, whether the currency was convertible in gold; `debtburden`, the ratio of government debt over government revenues; `rlong`, the secondary market yield of gold-denominated government debt; `rshort1900` and `rshort1890`, the market rate for three-month lending in 1900 and 1890; `rgdp` and `rgdpcap`, the logarithm of the real GDP and of the real GDP per capita; `poldemo`, Vanhanen's index of democracy; `coverage`, the logarithm of the number of currencies traded in the country.
-- Edges: `colony`, whether country $i$ was a colony of country $j$; `dist`, the logarithm of the distance between the financial centers of the two countries (the shortest one, if there are several); `bitrade`, the total trade between the two countries in 1900, in thousand US dollars (zero if not reported).[^icon]
+- (Node) `name`: the three-letter code of the country (e.g. "GBR", "DEU", "AUH" for Austria-Hungary, "OTT" for the Ottoman Empire).
+- (Node) `gold`, `debtburden`, `rlong`, `rshort1900`, `rshort1890`, `rgdp`, `rgdpcap`, `poldemo`, `coverage`: explanatory variables used by Flandreau and Jobst (2009), which refer to 1900 unless stated otherwise (NaN if missing), as follows.
+- (Node) `gold`: whether the currency was convertible in gold.
+- (Node) `debtburden`: the ratio of government debt over government revenues.
+- (Node) `rlong`: the secondary market yield of gold-denominated government debt.
+- (Node) `rshort1900` and `rshort1890`: the market rate for three-month lending in 1900 and 1890.
+- (Node) `rgdp` and `rgdpcap`: the logarithm of the real GDP and of the real GDP per capita.
+- (Node) `poldemo`: Vanhanen's index of democracy.
+- (Node) `coverage`: the logarithm of the number of currencies traded in the country.
+- (Edge) `colony`: whether country $i$ was a colony of country $j$.
+- (Edge) `dist`: the logarithm of the distance between the financial centers of the two countries (the shortest one, if there are several).
+- (Edge) `bitrade`: the total trade between the two countries in 1900, in thousand US dollars (zero if not reported).[^icon].
 
 [^icon]: Description obtained in part from the [ICON](https://icon.colorado.edu) project."""
 tags = ['Economic', 'Unweighted', 'Metadata', 'Temporal']
[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/currency_trading/__init__.py b/entries/currency_trading/__init__.py
index 613ef4c..958d52a 100644
--- a/entries/currency_trading/__init__.py
+++ b/entries/currency_trading/__init__.py
@@ -54,7 +54,6 @@ def _num(x):
 @coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     vnames = ["gold", "debtburden", "rlong", "rshort1900", "rshort1890",
               "rgdp", "rgdpcap", "poldemo", "coverage"]
[entries] Use American spelling in the descriptions by Tiago de Paula Peixoto 802d564
British spellings in the titles and descriptions of 69 entries (e.g.
labelled, organisation, millimetres, centres, anonymised, neighbours,
analysed, modelled, colour, licence) are replaced by the American ones.
Proper names keep their spelling (Otago Harbour, the Centre for Water
Systems, the Centre jeunesse de Montréal, the Dutch Ministry of Defence),
as do quoted upstream terms, citations, and property names.
diff --git a/entries/currency_trading/__init__.py b/entries/currency_trading/__init__.py
index ae55bb6..613ef4c 100644
--- a/entries/currency_trading/__init__.py
+++ b/entries/currency_trading/__init__.py
@@ -21,12 +21,12 @@ from .. import *
 import io
 
 title = "International currency trading networks (1890-1910)"
-description = """Directed networks of the international circulation of 45 currencies in 1890, 1900 and 1910, compiled by M. Flandreau and C. Jobst. Nodes are countries (each with its own currency), and a directed edge from country $i$ to country $j$ means that the currency of country $j$ was actively traded (i.e., regularly quoted with changing prices, revealing an underlying flow of transactions) in a foreign exchange market of country $i$ in that year. The data were collected from local stock exchange bulletins, newspapers and cambists' handbooks of the main financial centres of each country, and include virtually all currencies of the world at the time; a currency counts as traded in a country if there is evidence of active trading in at least one of its financial centres. There is one network for each year (`1890`, `1900` and `1910`).
+description = """Directed networks of the international circulation of 45 currencies in 1890, 1900 and 1910, compiled by M. Flandreau and C. Jobst. Nodes are countries (each with its own currency), and a directed edge from country $i$ to country $j$ means that the currency of country $j$ was actively traded (i.e., regularly quoted with changing prices, revealing an underlying flow of transactions) in a foreign exchange market of country $i$ in that year. The data were collected from local stock exchange bulletins, newspapers and cambists' handbooks of the main financial centers of each country, and include virtually all currencies of the world at the time; a currency counts as traded in a country if there is evidence of active trading in at least one of its financial centers. There is one network for each year (`1890`, `1900` and `1910`).
 
 The networks have the following properties:
 
 - Nodes: `name`, the three-letter code of the country (e.g. "GBR", "DEU", "AUH" for Austria-Hungary, "OTT" for the Ottoman Empire); and explanatory variables used by Flandreau and Jobst (2009), which refer to 1900 unless stated otherwise (NaN if missing): `gold`, whether the currency was convertible in gold; `debtburden`, the ratio of government debt over government revenues; `rlong`, the secondary market yield of gold-denominated government debt; `rshort1900` and `rshort1890`, the market rate for three-month lending in 1900 and 1890; `rgdp` and `rgdpcap`, the logarithm of the real GDP and of the real GDP per capita; `poldemo`, Vanhanen's index of democracy; `coverage`, the logarithm of the number of currencies traded in the country.
-- Edges: `colony`, whether country $i$ was a colony of country $j$; `dist`, the logarithm of the distance between the financial centres of the two countries (the shortest one, if there are several); `bitrade`, the total trade between the two countries in 1900, in thousand US dollars (zero if not reported).[^icon]
+- Edges: `colony`, whether country $i$ was a colony of country $j$; `dist`, the logarithm of the distance between the financial centers of the two countries (the shortest one, if there are several); `bitrade`, the total trade between the two countries in 1900, in thousand US dollars (zero if not reported).[^icon]
 
 [^icon]: Description obtained in part from the [ICON](https://icon.colorado.edu) project."""
 tags = ['Economic', 'Unweighted', 'Metadata', 'Temporal']
[entries] New entry: currency_trading by Tiago de Paula Peixoto af996e0
diff --git a/entries/currency_trading/__init__.py b/entries/currency_trading/__init__.py
new file mode 100644
index 0000000..ae55bb6
--- /dev/null
+++ b/entries/currency_trading/__init__.py
@@ -0,0 +1,90 @@
+#! /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 io
+
+title = "International currency trading networks (1890-1910)"
+description = """Directed networks of the international circulation of 45 currencies in 1890, 1900 and 1910, compiled by M. Flandreau and C. Jobst. Nodes are countries (each with its own currency), and a directed edge from country $i$ to country $j$ means that the currency of country $j$ was actively traded (i.e., regularly quoted with changing prices, revealing an underlying flow of transactions) in a foreign exchange market of country $i$ in that year. The data were collected from local stock exchange bulletins, newspapers and cambists' handbooks of the main financial centres of each country, and include virtually all currencies of the world at the time; a currency counts as traded in a country if there is evidence of active trading in at least one of its financial centres. There is one network for each year (`1890`, `1900` and `1910`).
+
+The networks have the following properties:
+
+- Nodes: `name`, the three-letter code of the country (e.g. "GBR", "DEU", "AUH" for Austria-Hungary, "OTT" for the Ottoman Empire); and explanatory variables used by Flandreau and Jobst (2009), which refer to 1900 unless stated otherwise (NaN if missing): `gold`, whether the currency was convertible in gold; `debtburden`, the ratio of government debt over government revenues; `rlong`, the secondary market yield of gold-denominated government debt; `rshort1900` and `rshort1890`, the market rate for three-month lending in 1900 and 1890; `rgdp` and `rgdpcap`, the logarithm of the real GDP and of the real GDP per capita; `poldemo`, Vanhanen's index of democracy; `coverage`, the logarithm of the number of currencies traded in the country.
+- Edges: `colony`, whether country $i$ was a colony of country $j$; `dist`, the logarithm of the distance between the financial centres of the two countries (the shortest one, if there are several); `bitrade`, the total trade between the two countries in 1900, in thousand US dollars (zero if not reported).[^icon]
+
+[^icon]: Description obtained in part from the [ICON](https://icon.colorado.edu) project."""
+tags = ['Economic', 'Unweighted', 'Metadata', 'Temporal']
+url = 'https://eh.net/database/international-currencies-1890-1910/'
+citation = [('M. Flandreau, C. Jobst, "The ties that divide: a network analysis of the international monetary system, 1890-1910." The Journal of Economic History 65(4), 977-1007 (2005)', 'https://doi.org/10.1017/S0022050705000379'),
+            ('M. Flandreau, C. Jobst, "The empirics of international currencies: network externalities, history and persistence." The Economic Journal 119(537), 643-664 (2009)', 'https://doi.org/10.1111/j.1468-0297.2009.02219.x')]
+icon_hash = '595b1312549f067e0263b510'
+upstream_license = None
+# The data file is no longer served by EH.Net (the database page remains);
+# it is obtained from the Internet Archive.
+upstream_prefix = 'https://web.archive.org/web/20230929100008id_/https://eh.net/wp-content/uploads/2014/08'
+files = [('flandreau_jobst_internationalcurrencies_data.txt', '1890', 'quote1890'),
+         ('flandreau_jobst_internationalcurrencies_data.txt', '1900', 'quote1900'),
+         ('flandreau_jobst_internationalcurrencies_data.txt', '1910', 'quote1910')]
+
+def fetch_upstream(force=False):
+    return retry_download(fetch_upstream_files, __name__.split(".")[-1],
+                          upstream_prefix, files, force)
+
+def _num(x):
+    x = x.strip()
+    return float(x) if x else numpy.nan
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    global files
+    name = __name__.split(".")[-1]
+    vnames = ["gold", "debtburden", "rlong", "rshort1900", "rshort1890",
+              "rgdp", "rgdpcap", "poldemo", "coverage"]
+    for fname, alt, col in files:
+        if alts is not None and alt not in alts:
+            continue
+        with open_upstream_file(name, fname, "rb") as bf:
+            lines = io.TextIOWrapper(bf, encoding="latin-1").read().splitlines()
+        start = [k for k, l in enumerate(lines) if l.startswith("country_A")][0]
+        header = lines[start].split("\t")
+        rows = [dict(zip(header, l.split("\t"))) for l in lines[start + 1:]
+                if l.strip()]
+        countries = sorted(set(r["country_A"].strip('"') for r in rows))
+        idx = {c: i for i, c in enumerate(countries)}
+        g = Graph(directed=True)
+        g.add_vertex(len(countries))
+        g.vp.name = g.new_vp("string", vals=countries)
+        for k in vnames:
+            g.vp[k] = g.new_vp("double", val=numpy.nan)
+        g.ep.colony = g.new_ep("bool")
+        g.ep.dist = g.new_ep("double")
+        g.ep.bitrade = g.new_ep("double")
+        edges = []
+        for r in rows:
+            i = idx[r["country_A"].strip('"')]
+            j = idx[r["country_B"].strip('"')]
+            for k in vnames:
+                g.vp[k][i] = _num(r[k])
+            if int(r[col]) == 1:
+                edges.append((i, j, int(r["colony"]), _num(r["dist"]),
+                              _num(r["bitrade"])))
+        g.add_edge_list(edges, eprops=[g.ep.colony, g.ep.dist, g.ep.bitrade])
+        yield alt, g