sckott / pytaxize

python port of taxize (taxonomy toolbelt) for R
https://sckott.github.io/pytaxize/
MIT License
34 stars 13 forks source link

Added GBIF suggestion wrapper, similar in style to the previously ent… #51

Closed Daniel-Davies closed 4 years ago

Daniel-Davies commented 4 years ago

…ered parse wrapper. Also added corresponding unit tests

Description

This will be my first of (hopefully many) additions to pytaxize. For my initial test commit, I have added a very basic wrapper over the GBIF suggestion API (see https://www.gbif.org/developer/species => /species/suggest), that is similar in style to the already existing "parse.py". I have also added the corresponding unit tests. Code was run through "black", as requested in the contributions guide.

The GBIF wrapper itself takes a partially completed, or malformed name, and outputs an "autocompletion" of up to 20 possible taxa for the input name.

Should this be merged, I will follow up with an addition of GBIF to the docs.

Related Issue

Example

from pytaxize import gbif response = gbif.suggest( name='puma con', as_dataframe=False ) => [{'scientificName':'puma concolor'},{...}]

codecov-commenter commented 4 years ago

Codecov Report

Merging #51 into master will decrease coverage by 0.20%. The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
- Coverage   38.86%   38.66%   -0.21%     
==========================================
  Files          20       22       +2     
  Lines         795      825      +30     
==========================================
+ Hits          309      319      +10     
- Misses        486      506      +20     
Impacted Files Coverage Δ
pytaxize/gbif/suggest.py 28.57% <28.57%> (ø)
pytaxize/gbif/__init__.py 100.00% <100.00%> (ø)
pytaxize/gbif/constants.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 679d61b...31425ec. Read the comment docs.

sckott commented 4 years ago

thanks @Daniel-Davies The PR looks great - and thanks for being detailed and following contributing notes. First take away I think is probably open an issue first to discuss (and then PR) while you get oriented here and I explain things that should be documented (my fault, sorry)

In general I am very keen to get any contributions here as I don't have much time to maintain python packages as they're outside of my main work focus.

However, I think for GBIF data for pytaxize, since pygbif https://github.com/sckott/pygbif is pretty solid now we should import that as needed and not replicate its functionality here.

in the pytaxize gbif module:

The high level view I have of this package:

I realize that I did duplicate effort/code in R taxize where I have gbif code instead of using the R rgbif client, but I want to not do that here when possible.

sckott commented 4 years ago

note: actively working on children and classification classes - so make sure to update your branch before from the main branch as needed