fathomnet / fathomnet-py

FathomNet Python client
https://fathomnet-py.readthedocs.io
MIT License
28 stars 3 forks source link

'worms.get_info' does not return AphiaID #25

Closed khiyer closed 8 months ago

khiyer commented 8 months ago

The 'worms' package does not return 'AphiaID'. Here's an example:

from fathomnet.api import worms
print(worms.get_info( 'Caballeraxine chainanica'))

This returns

WormsNode(name='Caballeraxine chainanica', rank='Species', apiaId=None, alternateNames=[], children=None)

Note that the returned tuple name for AphiaID seems to be misspelled as apiaId

hohonuuli commented 8 months ago

Sanity check: https://fathomnet.org/worms/taxa/info/Caballeraxine%20chainanica

@kevinsbarnard Aș @khiyer noted, there's a typo in WormsNode:610.

-    apiaId: Optional[int] = None
+    aphiaId: Optional[int] = None
kevinsbarnard commented 8 months ago

Thanks for catching and reporting this, @khiyer! I'll push out a fix today.

kevinsbarnard commented 8 months ago

Fixed in v1.2.2. WormsNode.aphiaId is now populated:

>>> from fathomnet.api import worms
>>> print(worms.get_info('Caballeraxine chainanica'))
WormsNode(name='Caballeraxine chainanica', rank='Species', aphiaId=519223, alternateNames=[], children=None)