Skip to main content

radiens-data-catalog

A Python package for programmatically managing large neural datasets stored on Google Drive. It handles Drive scanning, local cataloging, and selective dataset download. Analysis is done locally — this package is purely about data management.

Documentation: https://neuronexus.github.io/radienspy/radiens-data-catalog/

Overview

Neural data is stored as xdat filesets (NeuroNexus format) on a shared Google Drive. Each dataset consists of 3 files sharing a common base_name:

{base_name}_data.xdat
{base_name}.xdat.json
{base_name}_timestamp.xdat

radiens-data-catalog scans the Drive hierarchy, builds a local catalog indexed by base_name, and lets you query and download datasets selectively. Non-xdat content found alongside recordings — logs directories, PowerPoints, writeups — is also discovered and tracked as Drive items.

Usage

Recordings

from radiens_data_catalog import Catalog, Config

config = Config.from_file("config.json")
catalog = Catalog(config)

# Scan Drive and build the catalog (discovers recordings and Drive items)
result = catalog.scan()      # returns ScanResult with new/existing/removed counts
result = catalog.scan(flat=False)  # recursive traversal instead of flat file scan

# Query recordings using pandas directly
catalog.recordings_df
catalog.list_recordings()                                                                    # everything
catalog.list_recordings(drive_path="2026-02-15_batch/reaching")                             # exact folder
catalog.list_recordings(drive_path="2026-02-15_batch", drive_path_mode="prefix")            # full date subtree
catalog.list_recordings(drive_path="reaching", drive_path_mode="contains")                   # any depth
catalog.list_recordings(base_name="rat01_session3")                                          # exact base_name
catalog.list_recordings(base_name="rat01", base_name_mode="prefix")                           # base_name prefix
catalog.list_recordings(base_name="session3", base_name_mode="contains")                     # base_name substring

# Filters are ANDed together, e.g. all "rat01" recordings under "2026-02-15_batch"
catalog.list_recordings(drive_path="2026-02-15_batch", drive_path_mode="prefix", base_name="rat01", base_name_mode="prefix")

# Look up a recording by base_name (raises AmbiguousRecordingError if not globally
# unique — pass drive_path to disambiguate)
entry = catalog.get_recording("rat01_session3")
entry = catalog.get_recording("rat01_session3", drive_path="2026-02-15_batch/reaching")

# Download a recording (3 xdat files)
catalog.download_recording("2026-02-15_batch/reaching", "rat01_session3")

# Get the local path, downloading automatically if needed
path = catalog.get_recording_path("2026-02-15_batch/reaching", "rat01_session3")

Drive items (non-xdat content)

Non-xdat files and folders (e.g. logs/, PowerPoints, writeups) are automatically cataloged as Drive items during scan().

# Query items using pandas directly
catalog.items_df
catalog.items_df[catalog.items_df["drive_path"].str.startswith("2026-02-15_batch")]
catalog.items_df[catalog.items_df["is_folder"] == True]

# Download an item (drive_path is the slash-joined path to the item's parent folder)
catalog.download_item("2026-02-15_batch/reaching", "logs")

# Get the local path, downloading automatically if needed
path = catalog.get_item_path("2026-02-15_batch/reaching", "logs")

# Render an annotated tree of the full Drive hierarchy
print(catalog.file_tree())

# Print a headline summary report: counts, download progress, date
# range, and Drive/local storage totals
print(catalog.summary())

# verbose=True adds an item-type breakdown, largest entries, itemized
# incomplete recordings, a per-folder breakdown, and a full per-entry listing
print(catalog.summary(verbose=True))

Items land under local_data_dir/{drive_path}/{name}, using the same Drive-mirroring convention as recordings.

Configuration

Create a config.json (outside your repo — do not commit it):

{
    "credentials_path": "/path/to/service_account.json",
    "root_folder_id": "your-drive-folder-id",
    "local_data_dir": "/path/to/local/data"
}

Config.from_file() locates the config file using this resolution order:

  1. Explicit path argument.
  2. RADIENS_DATA_CATALOG_CONFIG environment variable.
  3. .secrets/config.json, then config.json, searched starting in the current working directory and then each parent directory up to the filesystem root (closest directory wins) — the same convention git uses to locate .git, so this works the same whether you run from the repo root or a nested subdirectory (e.g. a notebook in notebooks/).
  4. ~/.config/radiens-data-catalog/config.json.
  5. /etc/radiens-data-catalog/config.json.
# Automatic discovery (env var or well-known paths)
config = Config.from_file()

# Explicit path
config = Config.from_file("/path/to/config.json")

The root_folder_id is the alphanumeric string in the Drive URL when you're inside the root data folder.

Authentication

This package uses a Google service account for shared access among collaborators. To set it up:

  1. Create a project in Google Cloud Console
  2. Enable the Google Drive API
  3. Create a service account and download its JSON credentials file
  4. Give the service account's email address Viewer access to your root Drive data folder: share the folder with it, or, if the folder is in a Shared Drive, add it as a member of that drive. To upload with upload_folder(), the folder must be in a Shared Drive and the service account a Contributor there
  5. Point credentials_path in your config at the downloaded JSON file

Distribute the credentials file to collaborators securely — treat it like a password.

Installation

pip install radiens-data-catalog

or, with uv:

uv add radiens-data-catalog

Requires Python 3.12+ and a Google service account with read access to the root Drive folder (see Authentication above).

Metadata

Release files for radiens-data-catalog 0.2.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 radiens-data-catalog 0.2.1
File Size Uploaded Provenance Actions
radiens_data_catalog-0.2.1.tar.gz 72.3 kB With provenance Details for radiens_data_catalog-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for radiens-data-catalog 0.2.1
File Interpreter ABI Platform Actions
radiens_data_catalog-0.2.1-py3-none-any.whl Python 3 none any Details for radiens_data_catalog-0.2.1-py3-none-any.whl

Total release size: 109.6 kB

Release files / radiens_data_catalog-0.2.1.tar.gz

Download URL radiens_data_catalog-0.2.1.tar.gz
Size 72.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b7e1a2c5dd5676a957dcdf571d926df4909e286a78fb05bf6f0478fb55d58492
BLAKE2b-256 checksum
How to use checksums
4bd6a94d53bf7f716cee0774d31c3db0d8512027e1e5ba7c5ebcb5727e2f696f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Release files / radiens_data_catalog-0.2.1-py3-none-any.whl

Download URL radiens_data_catalog-0.2.1-py3-none-any.whl
Size 37.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2ec75856fcdb643fa2f510d4d15a169fdffee712612eb8873baf74092a3df5a
BLAKE2b-256 checksum
How to use checksums
6e4a7b16ad03835e314b12ff846020e558c9be0aef5270b76e61f6db5f3086f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Security for radiens-data-catalog 0.2.1

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for radiens_data_catalog-0.2.1.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 Nov 20, 2026.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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