Skip to main content

A CLI tool for running SQL files against DuckDB and exploring data interactively

Project description

BioDuck

A CLI tool for running SQL files against DuckDB and exploring data interactively.

Installation

pip install .

This will install the BioDuck CLI tool along with all included SQL files and resources.

Usage

Create a SQL File

bioduck create my_query

This creates a file ./sql/my_query.sql that you can edit with your SQL query.

Run a SQL File

bioduck run ./sql/my_query.sql

You can specify a database file:

bioduck run ./sql/my_query.sql --db my_database.duckdb

Save results to a CSV file:

bioduck run ./sql/my_query.sql --output results.csv

Launch the DuckDB UI

Run the DuckDB UI after initializing with SQL files:

bioduck ui

By default, it will run all SQL files in the ./sql directory in alphabetical order, then launch the DuckDB UI.

You can specify a different SQL directory:

bioduck ui --sql-dir ./my_queries

And a specific database file:

bioduck ui --db my_database.duckdb

Project Structure

  • Place your SQL files in the ./sql directory
  • SQL files are run in alphabetical order when using the ui command
  • You can use the create command to create new SQL files

NCBI Database

BioDuck includes built-in support for creating and managing NCBI biological data databases.

Creating an NCBI Database

bioduck ncbi

This will:

  1. Create a database at ~/.bioduck/ncbi.db (if it doesn't already exist)
  2. Initialize it with NCBI database schema and loaders for:
    • Taxonomy data
    • GenBank assembly data
    • RefSeq assembly data

The command will automatically:

  1. Download required files from NCBI FTP servers with progress indicators
  2. Extract necessary data from compressed archives
  3. Process and load the data into a DuckDB database
  4. Files are stored in ~/.bioduck/data by default for reuse

Accessing an Existing NCBI Database

If the database already exists, the command will simply report its location:

bioduck ncbi
# Database already exists at /home/user/.bioduck/ncbi.db

Launch UI for an NCBI Database

To open the DuckDB UI with your NCBI database:

bioduck ncbi --launch-ui
# or shorter form:
bioduck ncbi -u

Recreate Database

To force recreation of the database even if it exists:

bioduck ncbi --force

Specify Custom Locations

# Custom database location
bioduck ncbi --db-path /path/to/custom/ncbi.db

# Custom data directory for downloaded files
bioduck ncbi --data-dir /path/to/store/downloaded/data

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

bioduck-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

bioduck-0.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bioduck-0.1.0.tar.gz
Algorithm Hash digest
SHA256 74e95105699f6ecadc87d9b318f68a01edce341082831faa938e4893b7993b4f
MD5 10a144dc9ee35c3e8b1e09c291bae74b
BLAKE2b-256 e68f3664cc035ca437a24bda5cc7802813d12df95b27877a63690a2ea639785b

See more details on using hashes here.

Provenance

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

Publisher: pypi.yml on zachcp/bioduck

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

File details

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

File metadata

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

File hashes

Hashes for bioduck-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e15645316474def0643ba489c9319922a16ad1b840caa841cfa5b6032205a62
MD5 187cc147f9a615ac7f509477dfe22e10
BLAKE2b-256 d9af35cc2c61adbe2e0b66f2868d1b341302d2c5896dd83114fb2861dcaf45dc

See more details on using hashes here.

Provenance

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

Publisher: pypi.yml on zachcp/bioduck

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