Build cladograms from Wikipedia-scraped data.
Project description
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")
# pretty print the tree
print(tree.pretty())
# export multiple formats
tree.to_txt("Ursidae.txt") # plain-text dendrogram
tree.to_html("Ursidae.html") # diagram with images
tree.to_csv("Ursidae.csv") # filled-out tabular data
Saving and Loading Progress
# save the biota bag (so you don't have to scrape it again!)
taxopedia.dump_bag("bag.json", bag)
# loading the biota bag
bag = taxopedia.load_bag("bag.json")
# how to get a tree from a bag
tree = taxopedia.make_tree(bag)
Example Output
The plain-text dedrogram is as follows. See docs
folder for an example CSV
and HTML file as well.
Kingdom: Animalia
└── Phylum: Chordata
└── Class: Mammalia
└── Order: Carnivora
└── Suborder: Caniformia (Caniforms)
└── Infraorder: Arctoidea
└── Family: Ursidae (Bears)
├── Subfamily: Ailuropodinae
│ ├── Genus: Ailuropoda (Panda)
│ │ ├── Species: A. melanoleuca (Giant panda)
│ │ │ └── Subspecies: A. m. qinlingensis (Qinling panda/Brown panda)
│ │ ├── Species: A. baconi
│ │ └── Species: A. microta
│ ├── Tribe: †Indarctini
│ │ └── Genus: †Indarctos
│ └── Genus: †Miomaci
├── 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
├── Genus: Ursus
│ ├── Species: U. arctos (Brown bear)
│ │ ├── Subspecies: U. a. arctos (Eurasian brown bear)
│ │ └── Subspecies: U. a. middendorffi / horribilis (Kodiak bear)
│ ├── Species: U. americanus (American black bear)
│ ├── Species: U. maritimus (Polar bear)
│ └── Species: U. thibetanus (Asian black bear)
├── Subfamily: Ursinae
│ ├── Genus: Helarctos
│ │ └── Species: H. malayanus (Sun bear)
│ └── Genus: Melursus
│ └── Species: M. ursinus (Sloth bear)
├── Subfamily: †Ursavinae
│ └── Tribe: †Ursavini
│ └── Genus: †Ursavus
├── Subfamily: †Agriotheriinae
│ └── Genus: †Agriotherium
├── Tribe: Ailuropodini
│ └── Genus: †Ailurarctos
├── Genus: †Kretzoiarctos
│ └── Species: †K. beatrix
└── Genus: †Zaragocyon
└── Species: †Z. daamsi (Zaragocyon)
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
taxopedia-1.1.0.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for taxopedia-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae550549450471b893b6ff3410f07cfbc8ce9974e4a8037e597e69c60becdc97 |
|
MD5 | bd8e90aad91009396d9bad341fda24df |
|
BLAKE2b-256 | 0bd6143954c413149e8437aa15024f67f60fe747592f2ba00fe0646027eecf78 |