Mathematical genealogy grapher.
Project description
Geneagrapher
Geneagrapher is a tool for extracting information from the Mathematics Geanealogy Project to form a geneagraphy. The output is a dot file, which can be used by Graphviz to visualize the tree.
Basic Concepts
The input to the Geneagrapher is a set of starting nodes. If you want to build the ancestor graph of C. Felix Klein, then C. Felix Klein is the starting node for that graph. Multiple starting nodes may be provided (to produce the combined ancestor graph for an academic department, for instance).
Each individual stored in the Mathematics Genealogy Project's website has a unique integer as an identifier, and this identifier is what is passed to the Geneagrapher for starting nodes. The identifier is embedded in the URL for records in the Mathematics Genealogy Project website. For example, Carl Gauß is ID 18231 and Leonhard Euler is ID 38586.
Before running the Geneagrapher, go to the Mathematics Genealogy Project and gather the identifiers of the starting nodes for the graph you have in mind.
Installation
Geneagrapher is installed by pip. If your system does not have pip, see the instructions here.
Once pip is available on your system, install Geneagrapher with:
pip install geneagrapher
Usage
After installing the Geneagrapher, running
ggrapher --help
should produce
usage: ggrapher [-h] [--version] [-f FILE] [-a] [-d] [--disable-cache]
[--cache-file FILE] [-v]
ID [ID ...]
Create a Graphviz "dot" file for a mathematics genealogy, where ID is a record
identifier from the Mathematics Genealogy Project. Multiple IDs may be passed.
positional arguments:
ID mathematician record ID
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
-f FILE, --file FILE write output to FILE [default: stdout]
-a, --with-ancestors retrieve ancestors of IDs and include in graph
-d, --with-descendants
retrieve descendants of IDs and include in graph
--disable-cache do not store records in local cache
--cache-file FILE write cache to FILE [default: geneacache]
-v, --verbose list nodes being retrieved
Explanations of some of the options are given below, followed by examples.
-f FILE, --file=FILE
By default, the Geneagrapher writes the data it generates to standard
output. If you want the data written to file, you need to redirect the
output or use the -f
or --file
switch. When one of these switches
is used, the data is saved in the file name provided.
-a, --with-ancestors
When one of these switches is provided to the Geneagrapher, an ancestor graph is generated. An ancestor graph starts with the starting nodes and the works up to their advisors, their advisors' advisors, and so on.
-d, --with-descendants
These switches instruct the Geneagrapher to extract information about the descendants of the starting nodes (i.e., their advisees, their advisees' advisees, and so on).
Processing the Dot File
To process the generated dot file, Graphviz is needed. Graphviz installs several programs for processing dot files. For the Geneagrapher, I use the dot program. Let's look at an example.
If the Geneagrapher has generated a file named "graph.dot", we can do
dot -Tpng graph.dot > graph.png
This command produces a PNG file containing the graph. That's really all there is to it. Almost.
By default, dot
renders an image with 96dpi. This can look a little
blurry at 100% on high-resolution displays. You might want to increase
the resolution. You can do this with the -Gdpi
flag. For instance,
to produce a PNG with 150dpi, you can do
dot -Tpng -Gdpi=150 graph.dot > graph.png
Examples
Note: the Mathematics Genealogy Project has added new data since the examples below were constructed, so if re-run, the results will look different. The commands, however, all remain correct.
Single Node Ancestry: Carl Gauß
To produce the ancestry dot file for Carl Gauß and save it in the file 'gauss.dot', run the command
ggrapher -f gauss.dot -a 18231
Multiple Node Ancestry: Friedrich Bessel and Christian Gerling
To produce the combined ancestry dot file for Friedrich Bessel and Christian Gerling and save it in the file 'bessel_gerling.dot', run the command
ggrapher -f bessel_gerling.dot -a 18603 29642
Single Node Descendant Graph: Haskell Curry
To produce the descendant dot file for Haskell Curry and save it in the file 'curry.dot', run the command
ggrapher -f curry.dot -d 7398
Note that descendant graphs often have a lot of "fan out".
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file geneagrapher-1.0.tar.gz
.
File metadata
- Download URL: geneagrapher-1.0.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bcda3666136fd2810fa23c844a94a3008b745d6b7865544305d74ea58e1a837 |
|
MD5 | 70e5e32a827a6ea237db0493b000b5a0 |
|
BLAKE2b-256 | 7fb51f9162aeae55ec102d84fdb9edce19480954d182560559f410d0f0bedb52 |
File details
Details for the file geneagrapher-1.0-py2-none-any.whl
.
File metadata
- Download URL: geneagrapher-1.0-py2-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d21369442413737fed0238c36a68bc8e1b248822c22a2c81588070d8f7d1374a |
|
MD5 | ffb7e5b6683e566dc4eb100a94a7097e |
|
BLAKE2b-256 | 17480532ca504762615b12fca4b7172c6611186309f8286fa28a47bbb851d069 |