File size: 2,009 Bytes
1d8a2f9
7850d17
 
 
1d8a2f9
 
 
 
 
3aad961
 
7850d17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e2cb5b
 
7850d17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e2cb5b
7850d17
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
title: OSI Data Browser
emoji: 🔬
colorFrom: blue
colorTo: green
sdk: docker
pinned: false
---

[![Sync to Hugging Face hub](https://github.com/OpenSyndrome/data-browser/actions/workflows/huggingface.yaml/badge.svg)](https://github.com/OpenSyndrome/data-browser/actions/workflows/huggingface.yaml)

# Open Syndrome Definition - Data Browser

An interactive data browser built with [Marimo](https://marimo.io) that lets you filter epidemiological datasets using [Open Syndrome Definition (OSD)](https://github.com/OpenSyndrome/schema) criteria, powered by the [`opensyndrome`](https://github.com/OpenSyndrome/open-syndrome-python) Python package.

## How it works

1. Load a dataset (CSV) — use the built-in example or upload your own.
2. Map your dataset columns to OSD concepts via an editable YAML form.
3. Select one or more syndromic indicators from the definitions catalogue.
4. The engine compiles each OSD criterion into a [Polars](https://pola.rs) expression and labels matching rows.
5. Explore results through time-series and diagnosis-code charts.

## Quick start

```bash
# Local development
uv sync
uv run marimo run filter_engine.py

# Docker
docker build -t opensyndrome-databrowser .
docker run -p 7860:7860 opensyndrome-databrowser
```

Then open <http://localhost:7860> in your browser.

## Column mapping format

```yaml
profiles:
  - name: my_dataset
    # value_encodings:  # optional — map OSD canonical values to dataset-specific ones
    #   sex:
    #     male: "M"
    #     female: "F"
    columns:
      my_diagnosis_column:
        concept: diagnosis
        dtype: string
      # my_age_column:
      #   concept: demographic_criteria
      #   attribute: age
      #   dtype: integer
```

## Deploy

This app is hosted on [Hugging Face Spaces](https://huggingface.co/spaces) using the Docker SDK.

Push to the Space's `main` branch to trigger a rebuild:

```bash
git remote add space https://huggingface.co/spaces/opensyndrome/osi-data-browser
git push space main
```