Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* [gget cbio](en/cbio.md)
* [gget cellxgene](en/cellxgene.md)
* [gget cosmic](en/cosmic.md)
* [gget dataverse](en/dataverse.md)
* [gget diamond](en/diamond.md)
* [gget elm](en/elm.md)
* [gget enrichr](en/enrichr.md)
Expand Down Expand Up @@ -57,6 +58,7 @@
* [gget cbio](es/cbio.md)
* [gget cellxgene](es/cellxgene.md)
* [gget cosmic](es/cosmic.md)
* [gget dataverse](es/dataverse.md)
* [gget diamond](es/diamond.md)
* [gget elm](es/elm.md)
* [gget enrichr](es/enrichr.md)
Expand Down
116 changes: 116 additions & 0 deletions docs/src/en/dataverse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
> Python arguments are equivalent to long-option arguments (`--arg`), unless otherwise specified. Flags are True/False arguments in Python. The manual for any gget tool can be called from the command-line using the `-h` `--help` flag.
# gget dataverse 🗄️
Download datasets from [Dataverse](https://dataverse.harvard.edu/) repositories using dataset IDs.
Return format: Files downloaded to specified directory.

**Positional argument**
`table`
File containing the dataset IDs to download (CSV/TSV format). The file must contain the following columns:
- `id`: The unique identifier for the datafile in Dataverse
- `name`: The dataset name for the single file
- `type`: The file type (e.g., csv, tsv, pkl, tab)

**Optional arguments**
`-o` `--out`
Path to the directory where the datasets will be saved. Default: current working directory.

`-c` `--checksum`
Verify MD5 checksums of downloaded files against remote checksums. This ensures file integrity by comparing the local file's checksum with the checksum stored in Dataverse. Note: This requires additional API calls and may slow down the process.

**Flags**
`-q` `--quiet`
Command-line only. Prevents progress information from being displayed.
Python: Use `verbose=False` to prevent progress information from being displayed.

Python-only flags:
`verify_checksum`
Verify MD5 checksums of downloaded files against remote checksums. Default: False.


### Examples

**Download datasets from a CSV file**

```bash
gget dataverse datasets.csv
```

```python
import gget
gget.dataverse("datasets.csv")
```

Where `datasets.csv` contains:
```
id,name,type
6180617,protein_network_nodes,tab
6180618,protein_interactions,csv
```

→ Downloads the specified datafiles from Dataverse to the current directory.

<br/><br/>

**Download datasets to a specific directory**

```bash
gget dataverse datasets.tsv -o /path/to/download/directory
```

```python
import gget
gget.dataverse("datasets.tsv", path="/path/to/download/directory")
```

&rarr; Downloads the specified datafiles from Dataverse to the specified directory.

<br/><br/>

**Download datasets using a DataFrame (Python only)**

```python
import gget
import pandas as pd

# Create DataFrame with dataset information
df = pd.DataFrame({
'id': ['6180617', '6180618'],
'name': ['protein_nodes', 'protein_edges'],
'type': ['tab', 'csv']
})

gget.dataverse(df, path="./data")
```

&rarr; Downloads the specified datafiles from Dataverse using a pandas DataFrame.

<br/><br/>

**Download datasets with checksum verification**

```bash
gget dataverse datasets.csv --checksum
```

```python
import gget
gget.dataverse("datasets.csv", verify_checksum=True)
```

&rarr; Downloads the specified datafiles and verifies their MD5 checksums against the remote checksums stored in Dataverse to ensure file integrity.

<br/><br/>

### Notes

- Files are downloaded with progress bars showing download status
- If a file already exists locally, the download is skipped
- The module validates that the input table contains the required columns (`id`, `name`, `type`)
- Supports both CSV (comma-separated) and TSV (tab-separated) input files
- Error handling provides clear messages for common issues like missing files or invalid formats
- **Checksum verification**: When enabled, files are verified against their remote MD5 checksums stored in Dataverse. This feature:
- Ensures downloaded files are complete and uncorrupted
- Works for both newly downloaded files and existing local files
- Requires additional API calls to retrieve metadata
- Shows verification results in the log output
- Currently supports MD5 checksums only
116 changes: 116 additions & 0 deletions docs/src/es/dataverse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
> Los argumentos de Python son equivalentes a argumentos de opción larga (`--arg`), a menos que se especifique lo contrario. Las banderas son argumentos True/False en Python. El manual para cualquier herramienta gget se puede llamar desde la línea de comandos usando la bandera `-h` `--help`.
# gget dataverse 🗄️
Descargar conjuntos de datos de repositorios [Dataverse](https://dataverse.harvard.edu/) usando IDs de conjuntos de datos.
Formato de devolución: Archivos descargados al directorio especificado.

**Argumento posicional**
`table`
Archivo que contiene los IDs de los conjuntos de datos para descargar (formato CSV/TSV). El archivo debe contener las siguientes columnas:
- `id`: El identificador único para el archivo de datos en Dataverse
- `name`: El nombre del conjunto de datos para el archivo único
- `type`: El tipo de archivo (p. ej., csv, tsv, pkl, tab)

**Argumentos opcionales**
`-o` `--out`
Ruta al directorio donde se guardarán los conjuntos de datos. Por defecto: directorio de trabajo actual.

`-c` `--checksum`
Verificar sumas de verificación MD5 de archivos descargados contra las sumas de verificación remotas. Esto garantiza la integridad del archivo comparando la suma de verificación del archivo local con la suma de verificación almacenada en Dataverse. Nota: Esto requiere llamadas adicionales a la API y puede ralentizar el proceso.

**Banderas**
`-q` `--quiet`
Solo línea de comandos. Evita que se muestre información de progreso.
Python: Use `verbose=False` para evitar que se muestre información de progreso.

Banderas solo para Python:
`verify_checksum`
Verificar sumas de verificación MD5 de archivos descargados contra las sumas de verificación remotas. Por defecto: False.


### Ejemplos

**Descargar conjuntos de datos desde un archivo CSV**

```bash
gget dataverse datasets.csv
```

```python
import gget
gget.dataverse("datasets.csv")
```

Donde `datasets.csv` contiene:
```
id,name,type
6180617,protein_network_nodes,tab
6180618,protein_interactions,csv
```

&rarr; Descarga los archivos de datos especificados desde Dataverse al directorio actual.

<br/><br/>

**Descargar conjuntos de datos a un directorio específico**

```bash
gget dataverse datasets.tsv -o /ruta/al/directorio/descarga
```

```python
import gget
gget.dataverse("datasets.tsv", path="/ruta/al/directorio/descarga")
```

&rarr; Descarga los archivos de datos especificados desde Dataverse al directorio especificado.

<br/><br/>

**Descargar conjuntos de datos usando un DataFrame (solo Python)**

```python
import gget
import pandas as pd

# Crear DataFrame con información del conjunto de datos
df = pd.DataFrame({
'id': ['6180617', '6180618'],
'name': ['protein_nodes', 'protein_edges'],
'type': ['tab', 'csv']
})

gget.dataverse(df, path="./data")
```

&rarr; Descarga los archivos de datos especificados desde Dataverse usando un DataFrame de pandas.

<br/><br/>

**Descargar conjuntos de datos con verificación de suma de verificación**

```bash
gget dataverse datasets.csv --checksum
```

```python
import gget
gget.dataverse("datasets.csv", verify_checksum=True)
```

&rarr; Descarga los archivos de datos especificados y verifica sus sumas de verificación MD5 contra las sumas de verificación remotas almacenadas en Dataverse para garantizar la integridad del archivo.

<br/><br/>

### Notas

- Los archivos se descargan con barras de progreso que muestran el estado de descarga
- Si un archivo ya existe localmente, la descarga se omite
- El módulo valida que la tabla de entrada contenga las columnas requeridas (`id`, `name`, `type`)
- Soporta archivos de entrada tanto CSV (separado por comas) como TSV (separado por tabulaciones)
- El manejo de errores proporciona mensajes claros para problemas comunes como archivos faltantes o formatos inválidos
- **Verificación de suma de verificación**: Cuando está habilitada, los archivos se verifican contra sus sumas de verificación MD5 remotas almacenadas en Dataverse. Esta característica:
- Garantiza que los archivos descargados están completos y no corruptos
- Funciona tanto para archivos recién descargados como para archivos locales existentes
- Requiere llamadas adicionales a la API para recuperar metadatos
- Muestra resultados de verificación en la salida del registro
- Actualmente soporta solo sumas de verificación MD5
Loading
Loading