Installation#

bfabricPy consists of two main packages:

  • bfabric - The core Python library for programmatic access to the bfabric system

  • bfabric-scripts - Optional command-line tools, primarily the useful bfabric-cli utility

Choose your installation method based on how you plan to use bfabricPy.


Installing the Core Library (bfabric)#

Use this if you want to write Python scripts or integrate bfabric functionality into your applications.

Installing from Git#

For development versions or specific commits:

[project]
dependencies = [
    "bfabric @ git+https://github.com/fgcz/bfabricPy.git@main&subdirectory=bfabric#egg=bfabric",
]

With pip#

pip install bfabric

With uv#

uv pip install bfabric

Installing Command-Line Tools (bfabric-scripts)#

The bfabric-scripts package provides the bfabric-cli command-line tool, which is useful for:

  • Quick one-off queries and operations

  • Batch processing in shell scripts

  • Interactive data exploration

  • Testing API calls without writing Python code

Note: bfabric-scripts also contains legacy scripts that are maintained for compatibility but are not actively developed. The modern and recommended tool is bfabric-cli.


Which Should You Install?#

bfabricPy provides two components that are installed separately:

Component

Type

Install Method

Best For

bfabric

Python package

pip install bfabric or uv pip install bfabric

Python projects, scripts, applications

bfabric-scripts

CLI tool

uv tool install bfabric-scripts

Command-line usage, quick tasks, shell scripts

Install both if: You plan to use both Python programming and command-line tools.

Note: bfabric is a Python package dependency. bfabric-scripts is a CLI tool installed separately using uv tool.


Development Installation#

For contributing to bfabricPy, see the Contributing Guide.


Verifying Installation#

Check the Core Library#

python -c "import bfabric; print(bfabric.__version__)"

Check Command-Line Tools#

If you installed bfabric-scripts:

bfabric-cli --version
bfabric-cli --help

This should display the CLI version and available commands.


About bfabric-cli#

bfabric-cli is the modern command-line interface provided by bfabric-scripts. It offers:

  • Entity queries - Find and display datasets, samples, workunits, etc.

  • Data retrieval - Download files and metadata

  • Bulk operations - Process multiple entities efficiently

  • Convenient output formats - JSON, tables, CSV

  • Shell-friendly - Easy to use in scripts and pipelines

Example bfabric-cli Usage#

# Find recent datasets
bfabric-cli entity list --type dataset --limit 10

# Get detailed information about a specific entity
bfabric-cli entity show --id 12345

# Search for samples by name
bfabric-cli entity search --type sample --query "my_sample"

For comprehensive bfabric-cli documentation, see the bfabric-cli User Guide.


System Requirements#

  • Python: 3.11 or higher

  • Dependencies: Installed automatically via pip/uv

The bfabric package and bfabric-scripts share the same Python version requirements.


Next Steps#

After installing the packages:

  1. Configure your credentials: Configuration Guide

  2. Try it out: