Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

GBIF Python client

License

NotificationsYou must be signed in to change notification settings

gbif/pygbif

Repository files navigation

pygbif

pypidocsghactionscoverageblack

Python client for theGBIF API

Source on GitHub at gbif/pygbif

Other GBIF clients:

Contributing:CONTRIBUTING.md

Installation

Stable from pypi

pip install pygbif

Development version

[sudo] pip install git+git://github.com/gbif/pygbif.git#egg=pygbif

pygbif is split up into modules for each of the major groups of API methods.

  • Registry - Datasets, Nodes, Installations, Networks, Organizations
  • Species - Taxonomic names
  • Occurrences - Occurrence data, including the download API
  • Maps - Maps, get raster maps from GBIF as png or mvt

You can import the entire library, or each module individually as needed.

In addition there is a utils module, currently with one method: wkt_rewind, anda caching method to manage whether HTTP requests are cached or not. See ?pygbif.caching.

Registry module

registry module API:

  • organizations
  • nodes
  • networks
  • installations
  • datasets
  • dataset_metrics
  • dataset_suggest
  • dataset_search

Example usage:

frompygbifimportregistryregistry.dataset_metrics(uuid='3f8a1297-3259-4700-91fc-acc4170b27ce')

Species module

species module API:

  • name_backbone
  • name_suggest
  • name_usage
  • name_lookup
  • name_parser

Example usage:

frompygbifimportspeciesspecies.name_suggest(q='Puma concolor')

Occurrences module

occurrences module API:

  • search
  • get
  • get_verbatim
  • get_fragment
  • count
  • count_basisofrecord
  • count_year
  • count_datasets
  • count_countries
  • count_schema
  • count_publishingcountries
  • download
  • download_meta
  • download_list
  • download_get
  • download_citation
  • download_describe
  • download_sql

Example 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")occ.download_citation("0002526-241107131044228")occ.download_describe("simpleCsv")occ.download_sql("SELECT gbifid,countryCode FROM occurrence WHERE genusKey = 2435098")

Maps module

maps module API:

  • map

Example usage:

frompygbifimportmapsout=maps.map(taxonKey=212,year=1998,bin="hex",hexPerTile=30,style="classic-noborder.poly")out.responseout.pathout.imgout.plot()

https://github.com/gbif/pygbif/raw/master/gbif_map.png

utils module

utils module API:

  • wkt_rewind

Example 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)

Contributors

Meta


[8]ページ先頭

©2009-2025 Movatter.jp