Skip to main content

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.

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.0.4.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

pykew-0.0.4-py2.py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page