py-brain-sdk
py-brain-sdk is a Python library that simplifies interaction with the Brain Image Library (BIL), a national public resource for neuroscience research. BIL provides access to petabyte-scale brain microscopy datasets, including whole and partial brain images, neuron morphologies, connectivity data, and spatial transcriptomics. This SDK enables researchers, data scientists, and developers to programmatically query, download, and analyze BIL datasets, leveraging its APIs and integrated analysis ecosystem.
With py-brain-sdk, you can
- Search and retrieve brain imaging datasets and metadata.
- Query datasets by ID, directory path, contributor affiliation, or free-text search.
- Look up DOI metadata and citation counts from DataCite, OpenCitations, Crossref, and Semantic Scholar.
- Browse BIL collections and enumerate their constituent datasets.
- Download specific image files or subsets of large datasets.
Installation
pip install brainimagelibrary
Quick Start
Retrieve dataset metadata
from brainimagelibrary import retrieve, query
# By BIL dataset ID
metadata = retrieve.by_id(bildid="act-bag")
# By directory path
metadata = retrieve.by_directory(directory="/bil/data/2019/02/13/H19.28.012.MITU.01.05")
# Full-text search
results = query.by_text("mouse cortex")
# By contributor affiliation
results = retrieve.by_affiliation("Carnegie Mellon University")
List all dataset IDs
import brainimagelibrary as bil
bildids = bil.get_all_bildids()
print(f"Total datasets: {len(bildids)}")
DOI and citation lookup (datecite)
from brainimagelibrary import datecite
# Check if a dataset has a registered DOI
datecite.dataset.exists(bildid="act-bag")
# Get DataCite metadata
metadata = datecite.dataset.get(bildid="act-bag")
# Get citation counts from DataCite, OpenCitations, Crossref, and Semantic Scholar
citations = datecite.dataset.get_number_of_citations(bildid="act-bag")
# {‘datacite’: 2, ‘opencitations’: 1, ‘crossref’: 0, ‘semanticscholar’: 3}
# Get full citation records from all sources
records = datecite.dataset.get_citations(bildid="act-bag")
Collection operations
from brainimagelibrary import datecite
# List all datasets in a collection
datasets = datecite.collection.get_datasets(bildid="g.19")
for entry in datasets:
print(entry["bildid"], entry["url"])
Copyright © 2020-2026 Pittsburgh Supercomputing Center. All Rights Reserved.
The Biomedical Applications Group at the Pittsburgh Supercomputing Center in the Mellon College of Science at Carnegie Mellon University.
Metadata
Release files for brainimagelibrary 0.0.23
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| brainimagelibrary-0.0.23.tar.gz | 35.1 kB | Without provenance | Details for brainimagelibrary-0.0.23.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| brainimagelibrary-0.0.23-py3-none-any.whl | Python 3 | none | any | Details for brainimagelibrary-0.0.23-py3-none-any.whl |
Total release size: 78.3 kB
Release files / brainimagelibrary-0.0.23.tar.gz
| Download URL | brainimagelibrary-0.0.23.tar.gz |
|---|---|
| Size | 35.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8a43168cbc86216ae3d277ff862e0e0e27912278f49cccd356f3a168b859b18
|
|
BLAKE2b-256 checksum How to use checksums |
bd8db2546b5bab2c583027b84cc510a3f9320a717ccecb80f681887a121ace9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / brainimagelibrary-0.0.23-py3-none-any.whl
| Download URL | brainimagelibrary-0.0.23-py3-none-any.whl |
|---|---|
| Size | 43.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d92439f78a85f2d1a55d2ce796da7db3625681bbd94dbd5156527cefefe7803
|
|
BLAKE2b-256 checksum How to use checksums |
d455774d82cdd7b87c2e0c906fff06f1add3aca60a5470ac3dd38b9b59c0f8a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for brainimagelibrary 0.0.23
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.