Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name server list contains incorrect encodings #125

Open
peterdesmet opened this issue Sep 23, 2016 · 0 comments
Open

Name server list contains incorrect encodings #125

peterdesmet opened this issue Sep 23, 2016 · 0 comments
Assignees

Comments

@peterdesmet
Copy link
Member

In the interim and processed data of the name server species, some names are written with incorrect encoding characters, such as Agaricus xantholepis F.H. Møller, 1952 instead of Agaricus xantholepis F.H. Møller, 1952 (e.g. in this file).

The problem is related to the way the GBIF API is requested. With the requests library (used in e.g. the gbif_name_matching utility), there are no issues:

import requests
results = requests.get('http://api.gbif.org/v1/species/match?verbose=False&strict=true&name=Agaricus+xantholepis')
results.json()

Returns:

{'canonicalName': 'Agaricus xantholepis',
 'class': 'Agaricomycetes',
 'classKey': 186,
 'confidence': 99,
 'family': 'Agaricaceae',
 'familyKey': 4170,
 'genus': 'Agaricus',
 'genusKey': 7893259,
 'kingdom': 'Fungi',
 'kingdomKey': 5,
 'matchType': 'EXACT',
 'order': 'Agaricales',
 'orderKey': 1499,
 'phylum': 'Basidiomycota',
 'phylumKey': 34,
 'rank': 'SPECIES',
 'scientificName': 'Agaricus xantholepis F.H. Møller, 1952',
 'species': 'Agaricus xantholepis',
 'speciesKey': 5243402,
 'status': 'ACCEPTED',
 'synonym': False,
 'usageKey': 5243402}

But the name server list is so big, that an asynchronous request is necessary. This is implemented in this notebook. Apparently the asyncio or other library that is used to request GBIF does not handle the result as UTF8?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants