A python client for the Global Biological Information Facility (GBIF) API
Project description
library_of_life
library_of_life
is a Python package that provides a client interface for interacting with the Global Biodiversity Information Facility (GBIF) API. The library is organized into submodules representing different APIs within the GBIF service, making it easy to access various resources related to biodiversity data.
Table of Contents
- Installation
- Quick Start
- Modules
- Caching
- Authentication
- Contributing
- Donating$$$
- License
- Documentation
Installation
You can install library_of_life
via pip:
pip install library_of_life
Quick Start
Here's a quick example to get you started with library_of_life
:
from library_of_life.registry.datasets import Datasets
from library_of_life.species.name_usage import NameUsage
# Initialize the Datasets and NameUsage classes
dataset_client = Datasets()
name_usage_client = NameUsage()
# List current datasets matching specified parameters
dataset = dataset_client.list_datasets(dataset_type="SAMPLING_EVENT", limit=10)
print(dataset)
# Return all vernacular species names by a specific usage key
vernacular_names= name_usage_client.get_usage_vernacular_names_by_usage_key(5231190)
print(vernacular_names)
Modules
Each module is composed of separate submodules reflecting the divisions in the GBIF APIs. Within each of these submodules is a class and appropriate methods for accessing the data and resources available for the respective endpoints.
Registry
For now the registry module only contains the principal methods, but it will be updated in the future to include all of the methods.
Submodules
datasets
publishing_orgs
participant_nodes
networks
tech_installations
collections
institutions
institutions_and_collections
derived_datasets
Species
Submodules
name_usage
name_search
name_parser
Occurrence
Submodules
single_occurrence
search
downloads
download_format
download_stats
metrics
inventories
gadm_regions
country_usages
organization_usages
Maps
Submodules
maps
Literature
Submodules
literature
Vocabulary
Submodules
vocabularies
concepts
tags
languages
Caching
Each class contains an optional caching feature using requests_cache. Simply set use_caching to True when initializing the respective class.
Authentication
As some features of the GBIF API require authentication (POST, PUT, DETETE methods), this package handles both basic authentication (username and password) and OAuth2 authentication. This is dealt with at the class level. The default is for basic authentication, but if OAuth is desired, simply pass auth_type="OAuth" when initializing the class, as wellas the necessary credentials. Future versions may handle this with a config file.
Contributing
Contributions are welcome! If you would like to contribute to the development of library_of_life
, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/your-feature
). - Create a new Pull Request.
Donating$$$
If you find this project helpful and would like to support its development, consider making a donation.
License
This project is licensed under the MIT License. See the LCENSE file for more details.
Documentation
For more information, read the docs
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file library_of_life-0.4.2.tar.gz
.
File metadata
- Download URL: library_of_life-0.4.2.tar.gz
- Upload date:
- Size: 49.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 466691b8087ec7f886ee939d5d56d9396c5c99aaeac624ed8340f2fa5c581a01 |
|
MD5 | 699f8a260a3d59f442fada991cfe64ae |
|
BLAKE2b-256 | 4bbc87aa22ac80122e1d145c6eb4dce42d2d7d8d0248f7ad2d46fe86053406b7 |
File details
Details for the file library_of_life-0.4.2-py3-none-any.whl
.
File metadata
- Download URL: library_of_life-0.4.2-py3-none-any.whl
- Upload date:
- Size: 80.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21cbe809d9307e4f9324a6224f12c79307ae30f98e5dbce7f46a2ca3facd627c |
|
MD5 | db439fb4a1e780e1e259d3073deff698 |
|
BLAKE2b-256 | 79fd0499cdc10edb28e2d84fccebb1144b6ee089d8ad6bacc9c1fa111b2b8940 |