Skip to main content

A data API for the Brain Interfacing Laboratory

Project description

BIL Data Python API

This repository contains the public-facing Python API for accessing and analyzing neural data from the Brain Interfacing Laboratory. THe public deposition is at the Stanford Digital Repository (SDR).

Installation

pip install bilab

Data Availability

The bil package is an API for interacting with publically deposited data. In that directory, each recording session has its own identifier under the data directory. For instance, "U201130_01" is the first session by subject U on 2020-11-30.

Not all data types are available for all sessions.

Public datasets are deposited incrementally. The API contains methods for signals that will raise a FileNotFoundError if those signals have not been published.

Quickstart

See demo/md/quickstart.md.

from bil.api import get

# Initialize a study using a session ID
# Data will be fetched over HTTPS from the Stanford Digital Repository
study = get("U201130_01", download_dir="my_data")

# Access trial metadata
print(f"Number of trials: {len(study)}")
df = study.df

# Get a span of data for the first trial
# This is an accessor for a continuous segment of time
span = study.spans[0]

# Retrieve LFP data from that period of time from the Utah array in motor cortex
# This well get deposited in my_data/U201130_01
lfp = span.lfp(region="m1")  # (96, T) ndarray

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

bilab-0.1.0.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

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

bilab-0.1.0-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file bilab-0.1.0.tar.gz.

File metadata

  • Download URL: bilab-0.1.0.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bilab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 19d17dabdd8881ccfad8ff8b991d4b359ea37904516eddf2255ee95dd2abe6a3
MD5 1581c5d1d84e9661509d3e28cc159f12
BLAKE2b-256 47b29aa7469eba0b344b82a28ddd6ff4836e364026ac2817beee489ae7f606a9

See more details on using hashes here.

File details

Details for the file bilab-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bilab-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bilab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a476a5d2d2ad34ea3a08d0cfa0606267998595ce166ffe5f7a1743b841086c14
MD5 aaa2fdbc3e317caa4cef26d3035b9e39
BLAKE2b-256 54d9d2330af8f2806912b5e5d3a024b54b4e5a1b550e41c78ea715c4b7e72672

See more details on using hashes here.

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