Skip to main content

Taxopedia

Build taxonomic trees (cladograms) from Wikipedia-scraped data.

Installation

Use the package manager pip to install taxopedia.

pip install taxopedia

Getting Started

import taxopedia

# create a tree... and get a bag of parsed biota boxes!
tree, bag = taxopedia.search("Bears", comprehensive=True)

# pretty print the tree
print(tree.pretty())

# export multiple formats
tree.to_txt("tree_Ursidae.txt")    # plain-text dendrogram
tree.to_html("page_Ursidae.html")  # diagram with images
tree.to_csv("table_Ursidae.csv")   # filled-out tabular data

Tree Manipulation

# take a clone of a tree (to prevent mutation)
cutting = tree.clone()

# finding a node
bears = cutting.find("Ursidae")

# trim cousins (other children of all parents)
bears.exclude_cousins()

# return to the root (topmost parent)
cutting = bears.root()

# re-root the tree
bears = cutting.from_pov("Ursidae")

Saving and Loading Progress

# save the biota bag (so you don't have to scrape it again!)
taxopedia.dump_bag("bag_Ursidae.json", bag)

# loading the biota bag
bag = taxopedia.load_bag("bag_Ursidae.json")

# how to get a tree from a bag
tree = taxopedia.make_tree(bag)

Example Exports

See docs folder for raw files.

Rendered HTML

Click on the image to see a live preview.

docs/page_Ursidae.png

Tabular Data

Click on this link to view a CSV output.

docs/table_Ursidae.csv

Plain-Text Dendrogram

Kingdom: Animalia
└── Phylum: Chordata
    └── Class: Mammalia
        └── Order: Carnivora
            └── Suborder: Caniformia (Caniforms)
                └── Infraorder: Arctoidea
                    └── Family: Ursidae (Bears)
                        ├── Genus: Ursus
                        │   ├── Species: U. arctos (Brown bear)
                        │   │   ├── Subspecies: U. a. arctos (Eurasian brown bear)
                        │   │   ├── Subspecies: U. a. arctos / pyrenaicus (Cantabrian brown bear)
                        │   │   ├── Subspecies: U. a. beringianus (Kamchatka brown bear)
                        │   │   ├── Subspecies: U. a. collaris (East Siberian brown bear)
                        │   │   ├── Subspecies: U. a. gobiensis
                        │   │   ├── Subspecies: U. a. horriblis (Grizzly bear)
                        │   │   ├── Subspecies: U. a. isabellinus (Himalayan brown bear)
                        │   │   ├── Subspecies: U. a. lasiotus (Ussuri brown bear)
                        │   │   ├── Subspecies: U. a. marsicanus / arctos (Marsican brown bear)
                        │   │   ├── Subspecies: U. a. middendorffi / horribilis (Kodiak bear, Alaska Peninsula brown bear)
                        │   │   ├── Subspecies: U. a. pruinosus
                        │   │   ├── Subspecies: U. a. stikeenensis (Stickeen brown bear)
                        │   │   ├── Subspecies: U. a. syriacus (Syrian brown bear)
                        │   │   ├── Subspecies: U. a. ungavaesis / horribilis (Ungava brown bear)
                        │   │   ├── Subspecies: † U. a. californicus (California grizzly bear)
                        │   │   ├── Subspecies: † U. a. crowtheri (Atlas bear)
                        │   │   ├── Subspecies: † U. a. horriblis (Mexican grizzly bear)
                        │   │   └── Subspecies: † U. a. priscus
                        │   ├── Species: U. americanus (American black bear)
                        │   │   ├── Subspecies: U. a. carlottae (Haida Gwaii black bear)
                        │   │   ├── Subspecies: U. a. cinnamomum (Cinnamon Bear)
                        │   │   ├── Subspecies: U. a. emmonsii (Glacier bear)
                        │   │   ├── Subspecies: U. a. floridanus (Florida black bear)
                        │   │   ├── Subspecies: U. a. hamiltoni (Newfoundland black bear)
                        │   │   ├── Subspecies: U. a. kermodei (Kermode bear)
                        │   │   └── Subspecies: U. a. luteolus (Louisiana black bear)
                        │   ├── Species: U. thibetanus (Asian black bear)
                        │   │   ├── Subspecies: U. t. formosanus (Formosan black bear)
                        │   │   ├── Subspecies: U. t. gedrosianus (Balochistan black bear)
                        │   │   ├── Subspecies: U. t. japonicus (Japanese bear)
                        │   │   ├── Subspecies: U. t. laniger (Himalayan black bear)
                        │   │   └── Subspecies: U. t. ussuricus (Ussuri black bear)
                        │   ├── Species: U. arctos × U. maritimus
                        │   │   └── Subspecies: U. a. sitkensis (ABC Islands bear)
                        │   ├── Species: U. maritimus (Polar bear)
                        │   │   └── Subspecies: † U. m. tyrannus
                        │   ├── Species: U. deningeri
                        │   ├── Species: U. dolinensis
                        │   ├── Species: U. etruscus
                        │   ├── Species: U. ingressus
                        │   ├── Species: U. minimus
                        │   ├── Species: U. rossicus
                        │   └── Species: † U. spelaeus (Cave bear)
                        ├── Genus: † Kretzoiarctos
                        │   └── Species: † K. beatrix
                        ├── Genus: † Zaragocyon
                        │   └── Species: † Z. daamsi (Zaragocyon)
                        ├── Tribe: Ailuropodini
                        │   └── Genus: † Ailurarctos
                        ├── Subfamily: Ailuropodinae
                        │   ├── Genus: Ailuropoda (Panda)
                        │   │   ├── Species: A. melanoleuca (Giant panda)
                        │   │   │   └── Subspecies: A. m. qinlingensis (Qinling panda/Brown panda)
                        │   │   ├── Species: A. baconi
                        │   │   └── Species: A. microta
                        │   ├── Genus: † Miomaci
                        │   └── Tribe: † Indarctini
                        │       └── Genus: † Indarctos
                        ├── Subfamily: Tremarctinae
                        │   ├── Genus: Tremarctos
                        │   │   ├── Species: T. ornatus (Spectacled bear)
                        │   │   └── Species: † T. floridanus
                        │   ├── Genus: Plionarctos
                        │   ├── Genus: † Arctodus (Short-faced bear)
                        │   └── Genus: † Arctotherium
                        ├── Subfamily: † Hemicyoninae
                        │   ├── Genus: † Cephalogale
                        │   ├── Genus: † Dinocyon
                        │   ├── Genus: † Hemicyon
                        │   ├── Genus: † Phoberocyon
                        │   ├── Genus: † Phoberogale
                        │   └── Genus: † Plithocyon
                        ├── Subfamily: Ursinae
                        │   ├── Genus: Melursus
                        │   │   └── Species: M. ursinus (Sloth bear)
                        │   │       └── Subspecies: M. u. inornatus (Sri Lankan sloth bear)
                        │   └── Genus: Helarctos
                        │       └── Species: H. malayanus (Sun bear)
                        ├── Subfamily: † Ursavinae
                        │   └── Tribe: † Ursavini
                        │       └── Genus: † Ursavus
                        └── Subfamily: † Agriotheriinae
                            └── Genus: † Agriotherium

License

MIT

Metadata

Release files for taxopedia 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for taxopedia 1.1.3
File Size Uploaded
taxopedia-1.1.3.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for taxopedia 1.1.3
File Interpreter ABI Platform
taxopedia-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / taxopedia-1.1.3.tar.gz

Download URL taxopedia-1.1.3.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b3adef89d90583b8955ac3e74157a1b9a755e9bfc53c9f297c3d3bf020e8e74c
BLAKE2b-256 checksum
How to use checksums
354cb2e663d4c3e0295a5663f5657a9afc155647be758f11f47917a0a548b528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.8.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.8.5

Release files / taxopedia-1.1.3-py3-none-any.whl

Download URL taxopedia-1.1.3-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e9cb968c6174675703a051556c9efbae026a543d65c301f7b76bc8473c5535a
BLAKE2b-256 checksum
How to use checksums
e1fbe4bce22560b335dbe4cf3788e37c77761c4cea6e36d83d00129eec56afdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.8.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.8.5

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page