Package: bananompy
BananompyThis is a Python wrapper on theBionomiaAPI. Code follow the spirit/approach of thepygbifpackage, and indeed much of the wrapping utility is copied 1:1 from that repo, thanks@sckottand othercontributors.InstallationAdd this line to your application's requirements.txt:bananompyAnd then execute:$ pip install -r requirements.txtOr install it yourself as:$ pip install bananompyUsageImport the library:import bananompySuggest Collector NamesGet collector name suggestions with a limit of 5:bananompy.suggest('Smith, Ja',limit=5)#  => MultiJson objectFilter suggestions to only public profilesbananompy.suggest('Smith, Ja',is_public=True)#  => MultiJson objectFilter suggestions to only people that have occurrences associated with them:bananompy.suggest('Smith, Ja',has_occurrences=True)#  => MultiJson objectSearch CollectorsSearch for a collector by name:bananompy.person.search('Mary Agnes Chase')#  => MultiJson objectFilter the people search by taxonomic families_collected or taxonomic families_identified. If strict is set to true, then matches must include the taxonomic families.bananompy.person.search('Mary Agnes Chase',families_collected='Poaceae',strict=True)#  => MultiJson objectbananompy.person.search('Mary Agnes Chase',families_identified='Poaceae',strict=True)#  => MultiJson objectFilter the search by whether the person was living on the specimen collection/identification date. If strict is set to true, it requires that they were alive on the date.bananompy.person.search('Smith',date='1580-01-02',strict=True)#  => MultiJson objectSetting the callback parameter returnsJSON-Pwrapped in the provided callback string.bananompy.person.search('Smith',callback='myFunction')#  => JSON-P objectUse the page parameter for pagination of the search results:bananompy.person.search('Smith',page=2)#  => MultiJson objectSearch OccurrencesSearch for occurrences byGBIFdatasetIDandoccurrenceID:bananompy.occurrence.search('f86a681d-7db8-483b-819a-248def18b70a','7a1daa39-8d7c-d7c4-968f-799d58b3c7b0')#  => MultiJson objectSetting the callback parameter returnsJSON-Pwrapped in the provided callback string.bananompy.occurrence.search('f86a681d-7db8-483b-819a-248def18b70a','7a1daa39-8d7c-d7c4-968f-799d58b3c7b0',callback='myFunction')#  => JSON-P objectCollectorsGet a person's profile by theirORCIDorWikiDataidentifiers:bananompy.person.get('0000-0001-7618-5230')#  => JSON-LD objectSpecimensGet a person's specimens by theirORCIDorWikiDataidentifiers. Use the page parameter for pagination.bananompy.person.get('0000-0001-7618-5230',specimens=True)#  => JSON-LD objectbananompy.person.get('0000-0001-7618-5230',specimens=True,csv=True)#  => comma-separated valuesOccurrencesGet an occurrence with aGBIFoccurrenceID:bananompy.occurrence.get('477976412')#  => JSON-LD objectParsing human namesNote:Bionomiaprovides a RESTful API for the human name parsingdwc_agentgem which uses thenamaegem, and you likely will get better performance using those gems directly if parsing a large number of human names. A similar library in Python to the namae Ruby gem isnameparser.Parse authorships with names separated by;and each authorship set separated by\r\n:bananompy.parse(names='Henry Robert Nicollon des Abbayes; Groom Q\r\nMrs. John Errol Chandos Aberdeen')#  => MultiJson objectAgent StringsAgent strings are people names from occurrence labels that have not been associated with a person's identifier yet.Note:There is no restful API for agent strings, so these methods use beautifulsoup4 and the lxml parser to scrape the values from the Bionomia website.Get a random list of agent strings:bananompy.agent.search()Search for an agent string with the query, q:bananompy.agent.search(q='Mary Agnes')Get an agent string's occurrences by ID (Warning:The agent string identifiers are temporary and change every 2 weeks when new agent strings are imported into Bionomia and the website also goes down with a 503 error during agent string updates.)bananompy.agent.get('4746282')DevelopmentAfter checking out the repo, change into the package directorycd bananompy, runpip install .to install the package, andpip install -r requirements.txtto install the dependencies. Then, runpytestto run the tests. You can also runbin/consolefor an interactive Python prompt that will allow you to experiment with the above example commands.Other Bionomia LibrariesRuby Gem:bananomiaContributingBug reports and pull requests are welcome on GitHub athttps://github.com/SpeciesFileGroup/bananompy. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to thecode of conduct.LicenseThe package is available as open source under the terms of theNCSA/Illinoislicense. You can learn more about the NCSA license onWikipediaand compare it with other open source licenses at theOpen Source Initiative.Code of ConductEveryone interacting in the Bananompy project's codebases, issue trackers, chat rooms and mailing lists is expected to follow thecode of conduct.[Unreleased][0.1.0] - 2023-10-27Initial release