Skip to main content

nemar-py

Python + CLI client for downloading public NEMAR datasets (BIDS / EEG / MEG / iEEG) from data.nemar.org.

Install

pip install nemar-py            # S3 + HTTPS backends
pip install nemar-py[datalad]   # + the optional DataLad layer

The default install uses the direct-S3 and HTTPS backends. The optional [datalad] extra adds the DataLad layer; it bundles the git-annex binary via the psychoinformatics-de PyPI wheel (Linux, macOS, Windows), so no system package step is needed. Without the extra, --downloader datalad and the auto chain's DataLad layer fall through to S3 / HTTPS automatically.

Quick start

nemar-py download nm000132 -o data/nm000132
import nemar
nemar.download(dataset="nm000132", target_dir="data/nm000132")

CLI

Command Purpose
nemar-py download <DATASET> Download a dataset
nemar-py versions <DATASET> List versions advertised by NEMAR

Common flags

Flag Effect
-o, --output DIR Target directory (default ./<DATASET>)
-j, --jobs N Parallel downloads (default 16)
--tag TAG Pin a version; default latest
--downloader BACKEND auto (default) | s3 | python | datalad
--no-data Sidecars only — skip annexed binaries
--stimuli Add stimuli/ scope
--derivatives Add derivatives/ scope
--sourcedata Add sourcedata/ scope — the original pre-BIDS distribution
--metadata-timeout S Override 30 s metadata timeout
--verbose Echo resolved parameters before transfer

BIDS filters (repeatable)

Flag Accepts
--subject, --session, --task, --run, --acq 001 or sub-001
--datatype, --suffix, --extension eeg, T1w, .set, …
--scope raw, derivatives, stimuli, …
--pipeline Subfolder under derivatives/
--entity key=value Generic BIDS entity
--include PATTERN, --exclude PATTERN Path globs

Labels accept either bare (001) or BIDS-prefixed (sub-001) form.

Examples

# One subject, one task, EEG .set + sidecars
nemar-py download nm000132 \
  --subject 001 --task MMN --datatype eeg --suffix eeg --extension .set

# Derivatives from one pipeline
nemar-py download nm000132 --derivatives --pipeline eeglab --subject 001

# Metadata sweep — sidecars only, no big binaries
nemar-py download nm000132 --no-data -o nm000132-metadata

# The original pre-BIDS distribution, exactly as the authors published it
nemar-py download nm000341 --scope sourcedata -o nm000341-original

sourcedata/ — the original upstream distribution

Many NEMAR deposits carry a sourcedata/ tree holding the original, pre-BIDS files as distributed by the dataset authors, alongside a sourcedata_provenance.json recording each file's upstream name, size and SHA-256. That makes NEMAR usable as a mirror of the original source when the upstream host is slow, gated, or gone.

sourcedata is not fetched by default — --scope sourcedata gets only that tree, while --sourcedata adds it alongside the default raw scope.

import nemar
nemar.download(
    dataset="nm000132",
    subject=["001", "002"],
    task="MMN", datatype="eeg", suffix="eeg", extension=".set",
)

Behaviour

  • Catalog (index, version, manifest) is fetched from https://data.nemar.org/{dataset}/. No auth.
  • File bytes use a layered chain: S3 → (DataLad) → HTTPS.
    • S3 is tried first — anonymous public-read against nemar.s3.us-east-2.amazonaws.com, content-addressed at <dataset>/objects/<git-annex-key> (eegdash-style direct fetch).
    • DataLad is an optional middle layer, active only when the [datalad] extra is installed and the dataset index advertises a datalad_url. Absent the extra, this layer is skipped (a missing import is caught and falls through).
    • HTTPS through data.nemar.org is the always-available fallback, with Range/206 resume.
  • BIDS root files (dataset_description.json, participants.tsv/json, README*, CHANGES, LICENSE) are always kept — even with --include / --exclude.

Metadata

Release files for nemar-py 0.3.1

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

Source distribution (sdist)

Source distribution for nemar-py 0.3.1
File Size Uploaded
nemar_py-0.3.1.tar.gz 65.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nemar-py 0.3.1
File Interpreter ABI Platform
nemar_py-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 137.9 kB

Release files / nemar_py-0.3.1.tar.gz

Download URL nemar_py-0.3.1.tar.gz
Size 65.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3beed63cb84bb09441c1b3186805b2b083215867c212d948bf36975c00c07610
BLAKE2b-256 checksum
How to use checksums
0fec15da1ec52ed9ec1792b4cbcef91e8da99ff8cdc3e676b1102e3629b947aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 23, 2026.

Transparency log

Release files / nemar_py-0.3.1-py3-none-any.whl

Download URL nemar_py-0.3.1-py3-none-any.whl
Size 72.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f064b36b0f0a49eedd8bb7a79738f94eda046adcdfe492943d9d5ff81caa394b
BLAKE2b-256 checksum
How to use checksums
453c1dc16d2d3a10dbb96700c2d98eecfd4e2ca917c22a68018fdd8ddc951621
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.3

2 release files

0.3.2

2 release files

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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