{"id":19891759,"url":"https://github.com/inbo/etnservice","last_synced_at":"2025-05-02T18:31:24.990Z","repository":{"id":64670033,"uuid":"576335998","full_name":"inbo/etnservice","owner":"inbo","description":"R package to serve data from the European Tracking Network over a restful api","archived":false,"fork":false,"pushed_at":"2025-04-23T14:46:05.000Z","size":363,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-23T15:46:14.390Z","etag":null,"topics":["animal-movement","animal-tracking","api","biologging","data-access","fish","lifewatch","opencpu","oscibio","r","r-package","rstats"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inbo.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-09T15:32:47.000Z","updated_at":"2025-04-23T08:12:56.000Z","dependencies_parsed_at":"2024-09-13T23:47:59.704Z","dependency_job_id":"fea391a0-6228-40cd-b801-7efe7ff32e0e","html_url":"https://github.com/inbo/etnservice","commit_stats":{"total_commits":432,"total_committers":6,"mean_commits":72.0,"dds":"0.35416666666666663","last_synced_commit":"d924f1f6cc9113269f51500d3f62bfbdfdfa9f26"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inbo%2Fetnservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inbo%2Fetnservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inbo%2Fetnservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inbo%2Fetnservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inbo","download_url":"https://codeload.github.com/inbo/etnservice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252088432,"owners_count":21692794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animal-movement","animal-tracking","api","biologging","data-access","fish","lifewatch","opencpu","oscibio","r","r-package","rstats"],"created_at":"2024-11-12T18:19:30.250Z","updated_at":"2025-05-02T18:31:24.985Z","avatar_url":"https://github.com/inbo.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# etnservice\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)\n[![R-CMD-check](https://github.com/inbo/etnservice/actions/workflows/R-CMD-check-lite.yaml/badge.svg)](https://github.com/inbo/etnservice/actions/workflows/R-CMD-check-lite.yaml)\n\u003c!-- badges: end --\u003e\n\nThe goal of etnservice is to to serve data from the European Tracking Network as a restful API.\n\n## About/Data Policy\n\nEtn provides functionality to access data from the [European Tracking\nNetwork (ETN)](http://www.lifewatch.be/etn/) database hosted by the\nFlanders Marine Institute (VLIZ) as part of the Flemish contribution to\nLifeWatch. ETN data is subject to the [ETN data\npolicy](http://www.lifewatch.be/etn/assets/docs/ETN-DataPolicy.pdf) and\ncan be:\n\n  - restricted: under moratorium and only accessible to logged-in data\n    owners/collaborators\n  - unrestricted: publicly accessible without login and routinely\n    published to international biodiversity facilities\n\nThe ETN infrastructure currently requires the package to be run within\nthe [LifeWatch.be RStudio server](http://rstudio.lifewatch.be/), which\nis password protected. A login can be requested at\n\u003chttp://www.lifewatch.be/etn/contact\u003e.\n\n## Installation\n\netnservice needs direct access to the [ETN](https://lifewatch.be/etn/) database, thus a local install will not function without a copy of this database.\n\nYou can install the development version of etnservice from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"inbo/etnservice\")\n```\n\n## How to use the API\n\nThis is a basic example which shows you how adress the API directly:\n\n```{r example, eval = FALSE}\nlibrary(httr2) # to talk to the internet\nlibrary(magrittr) # to use pipes\nlibrary(askpass) # to safly enter a password in R\n\n# To access the ETN database, we need a login (username + password). We'll ask\n# for the password dynamically because that's safer than storing it as an object\nusername \u003c- \"\u003cyour-username-here\u003e\"\n# All functions can be adressed directly in the URL\nendpoint \u003c- \"https://opencpu.lifewatch.be/library/etnservice/R/list_scientific_names\"\n# Request the result of the function to be a json, and put in a request\nresponse \u003c-\n    httr2::request(endpoint) %\u003e% \n    ## In this case we'll request the data in JSON format and parse it\n    httr2::req_url_path_append(\"json\") %\u003e%\n    httr2::req_body_json(\n      list(credentials = list(username = username,\n                              password = askpass::askpass()))\n    ) %\u003e% \n    httr2::req_perform()\n# Take the response of the server, and convert it into an R object we can use\nresponse %\u003e%\n    httr2::resp_body_json(simplifyVector = TRUE)\n\n```\n\nHowever, a fork of the [etn package](https://github.com/inbo/etn) is currently in development that will allow you to do this using built in functions. \n\nAnother example of the same request as above, but now using [curl](https://curl.se/):\n```{bash,eval = FALSE}\n#! /bin/bash\ncurl --location 'https://opencpu.lifewatch.be/library/etnservice/R/list_scientific_names/json' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"credentials\": {\n        \"username\": \"\u003cyour-username-here\u003e\",\n        \"password\": \"\u003cyour-password-here\u003e\"\n    }\n}'\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finbo%2Fetnservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finbo%2Fetnservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finbo%2Fetnservice/lists"}