Skip to main content

Neurobagel CLI

Main branch checks status Tests status Codecov Python versions static License PyPI - Version PyPI - Downloads Docker Image Version (tag) Docker Pulls

The Neurobagel CLI is a Python command-line tool to automatically parse and describe subject phenotypic and imaging attributes in an annotated dataset for integration into the Neurobagel graph.

For information on how to use the CLI, please refer to the official Neurobagel documentation.

Installation

The Neurobagel CLI is available as a Python package that can be installed from PyPI using:

pip install bagel

(If you prefer to run the CLI using Docker or Singularity containers instead, please refer to the Neurobagel documentation.)

Development environment

Setting up a local development environment

To work on the CLI, we suggest that you create a development environment that is as close as possible to the environment we run in production. We use uv to set up local development environments.

  1. Clone the repository

    git clone https://github.com/neurobagel/bagel-cli.git
    cd bagel-cli
    
  2. Install the CLI and all development dependencies in editable mode with uv:

    uv sync --group dev
    
  3. Install the bids-examples and neurobagel_examples submodules needed to run the test suite:

    git submodule init
    git submodule update
    

Confirm that everything works well by running the tests: uv run pytest .

To run the CLI during local development, use:

uv run bagel

pre-commit is configured in the development environment for this repository, and can be set up to automatically run a number of code linters and formatters on any commit you make according to the consistent code style set for this project.

Run the following from the repository root to install the configured pre-commit "hooks" for your local clone of the repo:

uv run pre-commit install

pre-commit will now run automatically whenever you run git commit.

Updating dependencies

If new runtime or development dependencies are needed, add them with uv add. To change the version constraints of existing dependencies, edit pyproject.toml and then update the lockfile using uv lock.

Regenerating the Neurobagel vocabulary file

Terms in the Neurobagel namespace (nb prefix) and their class relationships are serialized to a file called nb_vocab.ttl, which is automatically uploaded to new Neurobagel graph deployments. This vocabulary is used by Neurobagel APIs to fetch available attributes and attribute instances from a graph store.

When the Neurobagel graph data model is updated (e.g., if new classes or subclasses are created), this file should be regenerated by running:

uv run python helper_scripts/generate_nb_vocab_file.py

This will create a file called nb_vocab.ttl in the current working directory.

Release files for bagel 0.11.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bagel 0.11.6
File Size Uploaded
bagel-0.11.6.tar.gz 139.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bagel 0.11.6
File Interpreter ABI Platform
bagel-0.11.6-py3-none-any.whl Python 3 none any Details

Total release size: 179.8 kB

Release files / bagel-0.11.6.tar.gz

Download URL bagel-0.11.6.tar.gz
Size 139.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cbd844b0b1ac5e7e36dd40074cb1e255e5dcbd92067f9383d25a1fcb827a684a
BLAKE2b-256 checksum
How to use checksums
f81bbd694801f845fcf87eaccb33977240cc9a44e6773f3fb303f707c1d6bb6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / bagel-0.11.6-py3-none-any.whl

Download URL bagel-0.11.6-py3-none-any.whl
Size 39.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98cc36c979424083df37bcf19f0730e0d479a41110e1b0e85a24296f0f0db36b
BLAKE2b-256 checksum
How to use checksums
a12a07844225c0412131fb1a1fd84132b538f510be7c55fa87b25b3dbfe1d713
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

This release

0.11.6 This release

2 release files

0.11.4

2 release files

0.11.3

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

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