Skip to main content

BIDS Query Language - A powerful SQL-like query language for BIDS neuroimaging datasets

Project description

BIQL - BIDS Query Language

A powerful query language for Brain Imaging Data Structure (BIDS) datasets that allows you to search, filter, and extract information using SQL-like syntax.

Features

  • Entity-based queries: Search by BIDS entities (subject, session, task, run, etc.)
  • Logical operators: AND, OR, NOT with proper bracketing support
  • Advanced filtering: Wildcards, regular expressions, range queries
  • Metadata queries: Access JSON sidecar metadata with dot notation
  • Multiple output formats: JSON, table, CSV, file paths
  • SQL-like syntax: SELECT, WHERE, GROUP BY, ORDER BY clauses

Installation

pip install biql

Quick Start

# Find all T1w anatomical files
biql "suffix=T1w"

# Find functional files for specific subjects
biql "subject IN ['01', '02'] AND datatype=func"

# Complex query with metadata filtering
biql "task=rest AND metadata.RepetitionTime<3.0"

# Select specific fields and format as table
biql "SELECT subject, session, filepath WHERE datatype=anat FORMAT table"

Query Language Syntax

Basic Entity Queries

subject=01
task=rest
datatype=func
run=[1:5]

Logical Operations

subject=01 AND task=rest
(subject=01 OR subject=02) AND datatype=func
NOT task=localizer

Wildcards and Patterns

subject=control*
task=*memory*
suffix~=/T[12]w/

Metadata Queries

metadata.RepetitionTime<3.0
metadata.EchoTime=[0.01:0.05]
participants.age>18

SELECT Clauses

SELECT subject, session, filepath WHERE task=rest
SELECT COUNT(*) GROUP BY subject
SELECT DISTINCT datatype

Documentation

For complete documentation, examples, and API reference, visit: https://biql.readthedocs.io

License

MIT License - see LICENSE file for details.

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

biql-0.1.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

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

biql-0.1.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: biql-0.1.0.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for biql-0.1.0.tar.gz
Algorithm Hash digest
SHA256 155ec677293f6b75a655d7a705296406e241e0b556446332ef03f2eaae6968c4
MD5 9ebd3184d6e357aaad4ac465f6135c42
BLAKE2b-256 e305f6749591c1ee28f95b7261ea7131cc087d8afbc335f40d33b932b3273046

See more details on using hashes here.

Provenance

The following attestation bundles were made for biql-0.1.0.tar.gz:

Publisher: publish.yaml on astewartau/biql

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

File details

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

File metadata

  • Download URL: biql-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for biql-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8544943e21b45c5e0bb56597b22a3ecebe458b883f92bee72811033781b004ab
MD5 269f710a76cacdf613810ffc31824378
BLAKE2b-256 1596cfa843fbc525b665ee8b2ea2fc665ac33c7f37feef444e5dc6f728901560

See more details on using hashes here.

Provenance

The following attestation bundles were made for biql-0.1.0-py3-none-any.whl:

Publisher: publish.yaml on astewartau/biql

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