Skip to main content

A package to translate ecological names in any format- from taxnomic rank (such as genus or family), or common English name (e.g. "blackbird") to specific, scientific species names.

Project description

The Ecological Name Translator

What is it?

A lightweight python package for translating ecological names in any format [e.g. at the species level (e.g. "Panthera tigris"), higher levels of taxonomy (such as genus, or family), or common name ("Tiger")] to the standardised species name equivalent.

Input & Output

A list of names describing species is accepted as input. This undergoes a data-cleaning procedure, after which, the following actions are taken:

  • Names that are already in a standard species format (that is, genus + species extension), have any spelling errors corrected

  • Names at higher levels of taxonomy (currently family, sub-family and genus are supported) again have any spelling mistakes corrected, and are then mapped to a list of specific species belonging to that taxonomic rank

  • Common names (currently, English only) are mapped to their scientific name (or all scientific names that could be described by the common English name)

The output is a python dictionary which maps each item in the input list to the equivalent standard scientific name(s).

Examples

Already a scientific name at the species level

If correct, the name will be returned as is, and if there are any spelling mistakes, they will be corrected.

from EcoNameTranslator import EcoNameTranslator
unstandardised_names = ['Panhera tigris'] #Should be "Panthera tigris"       
translator = EcoNameTranslator()   
index = translator.translate(unstandardised_names)
print(index)
# {'Panera tigris':['panthera tigris']}    
Higher levels of taxonomy

If an entry in your list is at a higher taxonomic rank, all species under that rank will be returned

from EcoNameTranslator import EcoNameTranslator
unstandardised_names = ['Panthera'] # A genus of various big cats       
translator = EcoNameTranslator()   
index = translator.translate(unstandardised_names)
print(index)
# {'Panthera': ['panthera leo', 'panthera uncia', 'panthera tigris', 'panthera onca', 'panthera pardus','panthera spec']}    
Common names

A common name can also be provided, in which case all possible scientific names described by the common name are returned. Be careful; quite generic common names, e.g. "monkey", can return hundreds of species!

from EcoNameTranslator import EcoNameTranslator
unstandardised_names = ['Bengal Tiger']
translator = EcoNameTranslator()   
index = translator.translate(unstandardised_names)
print(index)
# {'Bengal Tiger': ['panthera tigris']}    

Note: this feature should be used with caution, as partial matching is included- that is, a list item of just "Tiger" would also bring unwanted results of things like a Tiger Beetle.

Saving

Two convenience functions are provided to save the returned python data structure to file. Simple call one of:

from EcoNameTranslator import EcoNameTranslator
items = [...]
index = translator.translate(items)
translator.toPickleFile('C:/Users/...','filename') # Python serialization
translator.toCSV('C:/Users/...','filename') # CSV 

Why did we build it?

This package was refactored as part of a larger species interaction networks project. Our project required large datasets of standardised, scientific species names; and while there is plenty of species data, the existing datasets are often incredibly messy and constructed ad-hoc- meaning assembling a standard collection of species is difficult. To help, we made this package that takes in ecological names in any format, and makes a best-effort attempt to translate the input to a standardised set of scientific names.

Detailed Docs + Contributing

See the Github page for both, here

Credit

The package uses various APIs for conversions of names. These are:

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

EcoNameTranslator-0.6.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

EcoNameTranslator-0.6-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file EcoNameTranslator-0.6.tar.gz.

File metadata

  • Download URL: EcoNameTranslator-0.6.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

File hashes

Hashes for EcoNameTranslator-0.6.tar.gz
Algorithm Hash digest
SHA256 16a75acaf0e4760cc781f04a3176b1097b0b5b44ae1b023b7d8c0a19fc52755f
MD5 2c1c08648607df1db8b97148b4374373
BLAKE2b-256 d07a246c8a15388487ef40a4a0de04ac1282a036b992126558bc1ed92f011b2e

See more details on using hashes here.

File details

Details for the file EcoNameTranslator-0.6-py3-none-any.whl.

File metadata

  • Download URL: EcoNameTranslator-0.6-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

File hashes

Hashes for EcoNameTranslator-0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2be5f89f435b140594010f712ede57f2b6a4895d5227d56e5fe35e3fd42c7338
MD5 6dc3a72c3a3ffb5fd58ee1df7ae47bf0
BLAKE2b-256 9b007bd1470b6b3f28eb39496f3690b43a89e1ac562b46528a647c2840f3c7ad

See more details on using hashes here.

Supported by

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