Python interface to Kew data
Project description
Library for easy access to Kew’s nomenclatural and taxonomic services. Hides the intracacies of usign the HTTP API.
IPNI
Module for searching IPNI data and looking up individual records.
Simple search
import pykew.ipni as ipni
result = ipni.search('Poa annua')
Advanced search
import pykew.ipni as ipni
from pykew.ipni_terms import Name
query = { Name.genus: 'Poa', Name.species: 'annua' }
res = ipni.search(query)
Using results
import pykew.ipni as ipni
from pykew.ipni_terms import Name
query = { Name.genus: 'Poa', Name.species: 'annua' }
res = ipni.search(query)
res.size()
[r['name'] for r in res if 'name' in r]
POWO
Module for searching POWO data and looking up individual records. Taxonomic data is returned by default, but other associated such as distributions and descriptive text can also be retreived.
Simple search
import pykew.powo as powo
result = powo.search('Poa annua')
Advanced search
import pykew.powo as powo
from pykew.powo_terms import Name
query = { Name.genus: 'Poa', Name.species: 'annua' }
res = powo.search(query)
Individual record
import pykew.powo as powo
res = powo.lookup('urn:lsid:ipni.org:names:320035-2', include=['distribution'])
native_to = [d['name'] for d in res['distribution']['natives']]
Using results
import pykew.powo as powo
from pykew.powo_terms import Name, Geography
query = { Name.genus: 'Poa', Geography.distribution: 'Africa' }
res = powo.search(query)
res.size()
[r['name'] for r in res if 'name' in r]
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
pykew-0.1.1.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for pykew-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 023d7a599d3977602349073f440516def883d3cf57b678594738a62b641c3c55 |
|
MD5 | 59c7d8e62f9b166aea53521d99433f6d |
|
BLAKE2b-256 | 7f8cbd90f76c4e5ec68ea9ee2d2bcfd2056005f00c3f25dda2cb8843d0460a7c |