> ## Content Index
> Fetch the complete content index at: https://community.mozilladatacollective.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Using the MDC Python SDK Library to Download Datasets
- URL: https://community.mozilladatacollective.com/using-the-mdc-python-sdk-library-to-download-datasets/
- Published: 2026-02-27T18:59:14.000Z
- Updated: 2026-03-12T15:26:59.000Z
- Description: In this guide, you will learn how to use the MDC Python SDK Library to download datasets from the Mozilla Data Collective website.
- Author: Mozilla Data Collective
- Tags: Guide, Guides, data consumers, data

*Recorded by* [*Kostis Saitas - Zarkias*](https://community.mozilladatacollective.com/author/kostis/)*, AI & Data Engineer at Mozilla Data Collective*

0:00 

/5:05 

1× 

### **Prerequisites**

1. Create an account on Mozilla Data Collective and verify your email address

Join Mozilla Data Collective → 

### **Project Setup**

1. In your profile, create an API credential in [/profile/credentials](https://datacollective.mozillafoundation.org/profile/credentials?ref=community.mozilladatacollective.com). Ensure that you copy the secret key, as you will not be able to view it again once you close the credential creation window.
2. Save your API key in your project .`env` file as an environment variable
3. Install the latest version of the Mozilla Data Collective Python SDK Library - we recommend using a virtual environment

```python
uv venv .myenv
source .myenv/bin/activate
uv pip install datacollective
```

### Using the package in your project

In this example, we prepare a dataset for fine-tuning a speech to text model by downloading, extracting, and bringing a Common Voice dataset into a `pandas` data frame using the following code:

```python
from datacollective import load_dataset
dataframe = load_dataset("<YOUR_DATASET_ID_HERE>", download_directory="data")
```

You will need replace `<YOUR_DATASET_ID_HERE>` with the dataset ID or slug for the dataset you want to download. To do this, you will need to agree to the terms and conditions for the dataset on the Mozilla Data Collective website.

💡

The interface for agreeing to dataset terms and conditions ensures that each downloader can carefully review the terms for each dataset, as set by the dataset provider, to ensure their use case aligns with the intended use of the data.

You can verify that the dataset has been downloaded correctly by printing out the first few elements of the dataframe.

```python
print(dataframe.head(5))
```

### Downloading datasets to your machine

If you want to download a dataset and store it on your local machine, without using it in a specific project, you can do so with `download_dataset("<YOUR_DATASET_ID_HERE">`.

💡

Downloads are automatically resumable, which can be helpful when downloading large datasets

### Getting Dataset Details

You can get the metadata associated with a given dataset using `get_dataset_details("<YOUR_DATASET_ID_HERE">`, which can show important details about a dataset before downloading.

### **Additional Links**

- [MDC API Documentation](https://datacollective.mozillafoundation.org/api-reference/docs?ref=community.mozilladatacollective.com)
- [Mozilla Data Collective Python API Library on PyPi](https://pypi.org/project/datacollective/?ref=community.mozilladatacollective.com)
- [Mozilla-Data-Collective/datacollective-python on GitHub](https://github.com/Mozilla-Data-Collective/datacollective-python?ref=community.mozilladatacollective.com)