Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.95 KB

File metadata and controls

50 lines (35 loc) · 1.95 KB

SNOMED-CT DuckDB Loader

This script imports SNOMED-CT RF2 files from an Edition package into DuckDB. It has been tested with the SNOMED-CT May 2025 International Edition release.

The script also launches a DuckDB UI for interactive queries. Query results can be converted to a Numpy array or Pandas DataFrame, and exported to various formats, including CSV, Parquet, Arrow, and Excel (with additional extensions enabled).

Screenshot of DuckDB UI

Requirements

Installation

  • Clone the repository:
    $ git clone https://github.com/IHTSDO/snomed-database-loader.git
    $ cd snomed-database-loader/python-duckdb
  • Install dependencies:
    $ pip install -r requirements.txt

Usage

  1. Download SNOMED-CT

    • Obtain an Edition package of SNOMED-CT (see https://www.snomed.org/get-snomed)
    • If you have an Extension package, please make sure to convert it into an Edition package before proceeding
  2. Place the zip file in the releases directory

  3. Run the script

    • Execute the script with the path to your Edition package as an argument:
      $ python snomed-duckdb.py --package ./releases/SnomedCT_InternationalRF2_PRODUCTION_20250501T120000Z.zip
  4. Interact with the DuckDB UI

Notes

Database Persistence

By default, the database runs in in-memory mode. To persist the database to a file, specify it with the --db parameter

$ python snomed-duckdb.py --package .... --db ./snomed_data.duckdb