Skip to main content

Automatic parsing of subjects' tabular data and imaging metadata into Neurobagel graph-compatible JSONLD files.

Project description

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

Setting up code formatting and linting (recommended)

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.

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

bagel-0.11.5.tar.gz (134.4 kB view details)

Uploaded Source

Built Distribution

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

bagel-0.11.5-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

Details for the file bagel-0.11.5.tar.gz.

File metadata

  • Download URL: bagel-0.11.5.tar.gz
  • Upload date:
  • Size: 134.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for bagel-0.11.5.tar.gz
Algorithm Hash digest
SHA256 18a5f0d2048bf9e2adbfa94ffde4605ef6bf00472e00cebeead3db978aade3c8
MD5 d5f5c1f79e698f1ac340cc1334e2cb5c
BLAKE2b-256 cf2bf93a9804fd5c1a8320fa46f52a01de4f0e367fc61503520b1c66ef0b485a

See more details on using hashes here.

File details

Details for the file bagel-0.11.5-py3-none-any.whl.

File metadata

  • Download URL: bagel-0.11.5-py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for bagel-0.11.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4dae8bbd6647a6759a8285087b544adaffd8a9afa5a753c2e401768033d2a042
MD5 4484c6826e28fb73a3a2751715a6cfa9
BLAKE2b-256 82fe137739de396a7117922815f4bd12c4e3bb768c44ab548272993f7a5ee42b

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