Skip to main content

No project description provided

Project description

radiens-drive-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/radiens-drive-catalog/latest/

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-drive-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 datasets — logs directories, PowerPoints, writeups — is also discovered and tracked as assets.

Usage

Datasets

from radiens_drive_catalog import Catalog, Config

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

# Scan Drive and build the catalog (discovers datasets and assets)
catalog.scan()

# Query datasets
catalog.list()                                                          # everything
catalog.list(date_folder="2026-02-15_batch")                            # one date folder
catalog.list(date_folder="2026-02-15_batch", experiment="reaching")     # one experiment

# Access the raw DataFrame
catalog.df

# Check what's available locally
catalog.status()

# Download a dataset
catalog.download("rat01_session3")

# Get the local path, downloading automatically if needed
path = catalog.get_path("rat01_session3")

Assets (non-xdat content)

Non-xdat files and folders (e.g. logs/, PowerPoints, writeups) found inside experiment folders are automatically cataloged as assets during scan().

# Query assets
catalog.assets_df                                                           # all assets
catalog.list_assets(date_folder="2026-02-15_batch")                         # assets in a date folder
catalog.list_assets(experiment="reaching", asset_type="folder")             # folder assets only

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

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

Assets land under local_data_dir/assets/{drive_path}/{asset_name}, separate from the flat xdat dataset files.

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",
    "catalog_path": "/path/to/local/data/catalog.json"
}

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

  1. Explicit path argument.
  2. RADIENS_DRIVE_CATALOG_CONFIG environment variable.
  3. .secrets/config.json in the current working directory.
  4. config.json in the current working directory.
# 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. Share your root Drive data folder with the service account's email address (Viewer access is sufficient)
  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

This project uses uv for dependency management. If you don't have it:

macOS / Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Then install the project:

uv sync

Development

uv run pytest          # run tests
uv run mypy            # type checking
uv run ruff check .    # linting
uv run ruff format .   # formatting

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

radiens_drive_catalog-0.0.7.tar.gz (129.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

radiens_drive_catalog-0.0.7-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file radiens_drive_catalog-0.0.7.tar.gz.

File metadata

  • Download URL: radiens_drive_catalog-0.0.7.tar.gz
  • Upload date:
  • Size: 129.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for radiens_drive_catalog-0.0.7.tar.gz
Algorithm Hash digest
SHA256 289e0a5f90a77cb1026ecded4ae45aa71f5da4a87ddab91b6d9309f175f03204
MD5 0ccf61a54e314a34cd67931c71f1df54
BLAKE2b-256 a537573e9c0940f2ba8c51a8454c0323181099de71d27083373504a7299ee671

See more details on using hashes here.

Provenance

The following attestation bundles were made for radiens_drive_catalog-0.0.7.tar.gz:

Publisher: publish.yml on NeuroNexus/radiens-drive-catalog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file radiens_drive_catalog-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for radiens_drive_catalog-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7e21494314115a84468c899f2e49c95e4edc6a97e09fc8500ae5884eab11e7d5
MD5 d81df6d75f85b0eae8d9f5837a7e6a79
BLAKE2b-256 96a040605eb72c52658924be38a9006274fbb54a0135fc1d86017f8dea82f70e

See more details on using hashes here.

Provenance

The following attestation bundles were made for radiens_drive_catalog-0.0.7-py3-none-any.whl:

Publisher: publish.yml on NeuroNexus/radiens-drive-catalog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page