Package: pygbif
pygbifPython client for theGBIF APISource on GitHub at gbif/pygbifOther GBIF clients:R:rgbif,ropensci/rgbifRuby:gbifrb,sckott/gbifrbPHP:php-gbif,restelae/php-gbifContributing:CONTRIBUTING.mdInstallationStable from pypipip install pygbifDevelopment version[sudo] pip install git+git://github.com/gbif/pygbif.git#egg=pygbifpygbifis split up into modules for each of the major groups of API methods.Registry - Datasets, Nodes, Installations, Networks, OrganizationsSpecies - Taxonomic namesOccurrences - Occurrence data, including the download APIMaps - Maps, get raster maps from GBIF as png or mvtYou can import the entire library, or each module individually as needed.In addition there is a utils module, currently with one method:wkt_rewind, and
acachingmethod to manage whether HTTP requests are cached or not. See?pygbif.caching.Registry moduleregistry module API:organizationsnodesnetworksinstallationsdatasetsdataset_metricsdataset_suggestdataset_searchExample usage:frompygbifimportregistryregistry.dataset_metrics(uuid='3f8a1297-3259-4700-91fc-acc4170b27ce')Species modulespecies module API:name_backbonename_suggestname_usagename_lookupname_parserExample usage:frompygbifimportspeciesspecies.name_suggest(q='Puma concolor')Occurrences moduleregistry module API:searchgetget_verbatimget_fragmentcountcount_basisofrecordcount_yearcount_datasetscount_countriescount_schemacount_publishingcountriesdownloaddownload_metadownload_listdownload_getExample usage:frompygbifimportoccurrencesasoccocc.search(taxonKey=3329049)occ.get(key=252408386)occ.count(isGeoreferenced=True)occ.download('basisOfRecord = PRESERVED_SPECIMEN')occ.download('taxonKey = 3119195')occ.download('decimalLatitude > 50')occ.download_list(user="sckott",limit=5)occ.download_meta(key="0000099-140929101555934")occ.download_get("0000066-140928181241064")Maps modulemaps module API:mapExample usage:frompygbifimportmapsout=maps.map(taxonKey=212,year=1998,bin="hex",hexPerTile=30,style="classic-noborder.poly")out.responseout.pathout.imgout.plot()utils moduleutils module API:wkt_rewindExample usage:frompygbifimportutilsx='POLYGON((144.6 13.2, 144.6 13.6, 144.9 13.6, 144.9 13.2, 144.6 13.2))'utils.wkt_rewind(x)ContributorsScott ChamberlainRobert ForkelJan LegindStijn Van HoeyPeter DesmetNicolas NoéMetaLicense: MIT, seeLICENSE filePlease note that this project is released with aContributor Code of Conduct. By participating in this project you agree to abide by its terms.Changelog0.6.3 (2023-05-25)added support for predicates:isNull,isNotNull,inandnot92,102and103added support for nested queries/dictionaries104deprecated theadd_predicatefunction and addedadd_pred_dictto accomodate for newly supported predicates to ensure that the arguments that are sent are added in the payload function108added support for multiple download formats105updated operators and look-up tables107included documentation on newly supported predicates and dictionaries1060.6.2 (2023-01-24)update to fix requesting GBIF downloadsminor documentation updates95and990.6.1 (2022-06-23)update to fix broken dependencies93minor documentation updates0.6.0 (2021-07-08)Fix foroccurrences.downloadwhen givinggeometryas a string rather than usingadd_geometry; predicates were being split on whitespace, which doesn’t work for WKT8184Moved to using theloggingmodule instead ofprint()for giving information on occurrence download methods78Clarify thatoccurrences.countfor length 1 inputs only; seeoccurrences.searchfor > 1 value7577Improved documentation forspecies.name_usagemethod, mostly for thelanguageparameter68Gains download methoddownload_cancelfor cancelling/deleting a download request590.5.0 (2020-09-29)occurrences.searchnow supportsrecordedByIDandidentifiedByIDsearch parameters62clean up the Contributing file, thanks @niconoe64clean up internal imports in the library, thanks @niconoe65fix usage ofisand==, was using them inappropriately sometimes (viahttps://realpython.com/python-is-identity-vs-equality/),69remove redundant parameter in a doc string, thanks @faroit71make a test for internal fxngbif_GET_writemore general to avoid errors if GBIF changes content type response header slightly720.4.0 (2019-11-20)changed base url to https for all requests; was already https for maps and downloads in previous versionsoccurrences, species, and registry modules gain docstrings with brief summary of each methodpygbif gains ability to cache http requests. caching is off by default. See?pygbif.cachingfor all the details5256via @nleguillarmemade note in docs that if you are trying to get the same behavior as the GBIF website for name searching,species.name_backboneis likely what you want55thanks @qgroomfor parameters that expect abool, convert them to lowercase strings internally before doing HTTP requests0.3.0 (2019-01-25)pygbif is Python 3 only now19Gains maps module with maps.map method for working with the GBIF maps API4149Gains new module utils with one methodwkt_rewind46thanks @aubreymoore for the inspirationFixed bug in registry.installations: typo in one of the parametersidentifierTypinstead ofidentifierType48thanks @data-biodiversity-aqLink to GitHub issues from Changelog 🎉Fix a occurrence download test47Much more thorough docs250.2.0 (2016-10-18)Download methods much improved1627thanks @jlegind @stijnvanhoey @peterdesmet !MULTIPOLYGON now supported ingeometryparameter35Fixed docs foroccurrences.get, andoccurrences.get_verbatim,occurrences.get_fragmentand demo that used occurrence keys that no longer exist in GBIF39Addedorganizationsmethod toregistrymodule12Added remainder of datasets methods:registry.dataset_search(including faceting support37) andregistry.dataset_suggest, for the/dataset/searchand/dataset/suggestroutes, respectively40Added remainder of species methods:species.name_lookup(including faceting support38) andspecies.name_usage, for the/species/searchand/speciesroutes, respectively18Added more tests to cover new methodsChangedspecies.name_suggestto give back data stucture as received from GBIF. We used to parse out the classification data, but for simplicity and speed, that is left up to the user now.startparameter inspecies.name_suggest,occurrences.download_list,registry.organizations,registry.nodes,registry.networks, andregistry.installations, changed tooffsetto match GBIF API and match usage throughout remainder ofpygbif0.1.5.4 (2016-10-01)Added many newoccurrence.searchparameters, includingrepatriated,kingdomKey,phylumKey,classKey,orderKey,familyKey,genusKey,subgenusKey,establishmentMeans,facet,facetMincount,facetMultiselect, and support for facet paging via**kwargs3034Fixes to**kwargsinoccurrence.searchso that facet parameters can be parsed correctly andrequestsGET        request options are collected correctly36AddedspellCheckparameter tooccurrence.searchthat goes along with theqparameter to optionally spell check full text searches310.1.4 (2016-06-04)Added variable types throughout docsChanged defaultlimitvalue to 300 foroccurrences.searchmethodtoxnow included, via @xrotwang20Added more registry methods11Started occurrence download methods16Added more names methods18All requests now send user-agent headers withrequestsandpygbifversions13Bug fix foroccurrences.download_get23Fixed bad example foroccurrences.get22Fixed wheel to be universal for 2 and 310Improved documentation a lot, autodoc methods now0.1.1 (2015-11-03)Fixed distribution for pypi0.1.0 (2015-11-02)First release