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
./sqldirectory - SQL files are run in alphabetical order when using the
uicommand - You can use the
createcommand 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:
- Create a database at
~/.bioduck/ncbi.db(if it doesn't already exist) - Initialize it with NCBI database schema and loaders for:
- Taxonomy data
- GenBank assembly data
- RefSeq assembly data
The command will automatically:
- Download required files from NCBI FTP servers with progress indicators
- Extract necessary data from compressed archives
- Process and load the data into a DuckDB database
- Files are stored in
~/.bioduck/databy 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74e95105699f6ecadc87d9b318f68a01edce341082831faa938e4893b7993b4f
|
|
| MD5 |
10a144dc9ee35c3e8b1e09c291bae74b
|
|
| BLAKE2b-256 |
e68f3664cc035ca437a24bda5cc7802813d12df95b27877a63690a2ea639785b
|
Provenance
The following attestation bundles were made for bioduck-0.1.0.tar.gz:
Publisher:
pypi.yml on zachcp/bioduck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bioduck-0.1.0.tar.gz -
Subject digest:
74e95105699f6ecadc87d9b318f68a01edce341082831faa938e4893b7993b4f - Sigstore transparency entry: 182868580
- Sigstore integration time:
-
Permalink:
zachcp/bioduck@78e44d4337f2cb230249b6fa605d83c7bb60760d -
Branch / Tag:
refs/tags/v.0.1.0 - Owner: https://github.com/zachcp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@78e44d4337f2cb230249b6fa605d83c7bb60760d -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e15645316474def0643ba489c9319922a16ad1b840caa841cfa5b6032205a62
|
|
| MD5 |
187cc147f9a615ac7f509477dfe22e10
|
|
| BLAKE2b-256 |
d9af35cc2c61adbe2e0b66f2868d1b341302d2c5896dd83114fb2861dcaf45dc
|
Provenance
The following attestation bundles were made for bioduck-0.1.0-py3-none-any.whl:
Publisher:
pypi.yml on zachcp/bioduck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bioduck-0.1.0-py3-none-any.whl -
Subject digest:
0e15645316474def0643ba489c9319922a16ad1b840caa841cfa5b6032205a62 - Sigstore transparency entry: 182868581
- Sigstore integration time:
-
Permalink:
zachcp/bioduck@78e44d4337f2cb230249b6fa605d83c7bb60760d -
Branch / Tag:
refs/tags/v.0.1.0 - Owner: https://github.com/zachcp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@78e44d4337f2cb230249b6fa605d83c7bb60760d -
Trigger Event:
push
-
Statement type: