Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Mozilla Data Collective Python API Library

Python library for interfacing with the Mozilla Data Collective REST API.

Installation

Install the package using pip:

pip install datacollective

Quick Start

  1. Get your API key from the Mozilla Data Collective dashboard

  2. Set up your environment:

If you have cloned the repository, you can run the following command:

# Copy the example environment file
cp .env.example .env

Otherwise, copy and paste the following into a file called .env in your present working directory.

MDC_API_KEY=<MDC_API_KEY> # change to your MDC API Key
MDC_API_URL=https://datacollective.mozillafoundation.org/api # change to MDC API URL endpoint
MDC_DOWNLOAD_PATH=~/.mozdata/datasets # change to where you want to download datasets
  1. Configure your API key by editing .env:

    # Required: Your MDC API key
    MDC_API_KEY=your-api-key-here
    
    # Optional: Download path for datasets (defaults to ~/.mozdata/datasets)
    MDC_DOWNLOAD_PATH=~/.mozdata/datasets
    
  2. Start using the library:

    from datacollective import DataCollective
    
    # Initialize the client
    client = DataCollective()
    
    # Download a dataset
    client.get_dataset('mdc-dataset-id')
    

Configuration

The client loads configuration from environment variables or .env files:

  • MDC_API_KEY - Your Mozilla Data Collective API key (required)
  • MDC_API_URL - API endpoint (defaults to production)
  • MDC_DOWNLOAD_PATH - Where to download datasets (defaults to ~/.mozdata/datasets)

Environment Files

Create a .env file in your project root:

# MDC API Configuration
MDC_API_KEY=your-api-key-here
MDC_API_URL=https://datacollective.mozillafoundation.org/api
MDC_DOWNLOAD_PATH=~/.mozdata/datasets

Note: Never commit .env files to version control as they contain sensitive information.

Basic Usage

from datacollective import DataCollective

# Initialize client (loads from .env automatically)
client = DataCollective()

# Verify your configuration
print(f"API URL: {client.api_url}")
print(f"Download path: {client.download_path}")

# Download a dataset
dataset = client.get_dataset('your-dataset-id')

Load and query datasets

note: today, this feature only works with Mozilla Common Voice datasets

from datacollective import DataCollective

client = DataCollective()

dataset = client.load_dataset("<dataset-id>") # Load dasaset into memory
df = dataset.to_pandas() # Convert to pandas for queryable form
dataset.splits # A list of all splits available in the dataset

Multiple Environments

You can use different environment configurations:

# Production environment (default, uses .env)
client = DataCollective()

# Development environment (uses .env.development)
client = DataCollective(environment='development')

# Staging environment (uses .env.staging)  
client = DataCollective(environment='staging')

License

This project is released under MPL (Mozilla Public License) 2.0.

Metadata

Release files for mdc-dlp 0.0.1a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mdc-dlp 0.0.1a0
File Size Uploaded Provenance
mdc_dlp-0.0.1a0.tar.gz 12.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mdc-dlp 0.0.1a0
File Interpreter ABI Platform
mdc_dlp-0.0.1a0-py3-none-any.whl Python 3 none any Details

Total release size: 26.2 kB

Release files / mdc_dlp-0.0.1a0.tar.gz

Download URL mdc_dlp-0.0.1a0.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8a6caa7d035613f3bc5bdb45a034e549b1778aa457b32be6f93f63739e52505c
BLAKE2b-256 checksum
How to use checksums
dd2988e384f028983e47d64b60c4160baee3eaf470b657423d844c2ad78b0da5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2025.

Transparency log

Release files / mdc_dlp-0.0.1a0-py3-none-any.whl

Download URL mdc_dlp-0.0.1a0-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
378b6ece3e1d3438882e0f87e473af54267d4215cc7eabcc92c0fd8e01027a7a
BLAKE2b-256 checksum
How to use checksums
901c8d6b1176bf35dd275da9dd4d6d8dfa3926f78197f8d2d062fd85676d3693
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2025.

Transparency log

Security for mdc-dlp 0.0.1a0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mdc_dlp-0.0.1a0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page