From cf1cafc82c8e6b607788e3b2f06b74e8ff8dbae1 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Fri, 24 May 2024 14:02:41 +0100 Subject: [PATCH] add pooch example --- docs/source/open_science/GIN-repositories.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/source/open_science/GIN-repositories.md b/docs/source/open_science/GIN-repositories.md index 1805779..941854e 100644 --- a/docs/source/open_science/GIN-repositories.md +++ b/docs/source/open_science/GIN-repositories.md @@ -289,6 +289,19 @@ After changing the locking state, remember to record the new state with a `gin c We recommend [pooch](https://www.fatiando.org/pooch/latest/index.html) to programmatically download a dataset from a GIN repository's URL. `pooch` is easy to use and has some nice functionalities like caching the downloaded data, verifying cryptographic hashes or unzipping files upon download. +Here is a simple example of how to download a dataset from a GIN repository using `pooch`: + +```python +import pooch + +filepath = pooch.retrieve( + url="https://gin.g-node.org///src/main/file", + known_hash=None, + path="/home//downloads", # this is where the file will be saved + progressbar=True, +) +``` + ## Some under-the-hood details GIN is a wrapper around [git-annex](https://git-annex.branchable.com/). The high-level idea behind git-annex is: