This release is a pre-release and may not be stable for production use.
raxtik-etl ⚡
High-performance canonical pharmacovigilance (PV) data engine and packaging toolkit powered by DuckDB and Polars.
raxtik-etl provides the canonical schema definitions, deduplication algorithms, case resolution logic, and self-describing dataset packaging for safety surveillance datasets. It is completely decoupled from source-specific ingestion logic via an extensible Source Adapter Protocol.
🏗️ Architecture
SOURCE CONNECTORS (Plugins)
│
┌───────────────┼───────────────┐
▼ ▼ ▼
raxtik-source-faers future-source future-source
(FDA AERS/FAERS) (EudraVigilance) (VigiBase)
│
│ implements SourceAdapter
▼
┌────────────────────────────────────────────────────────┐
│ raxtik-etl │
│ 1. Canonical Schemas (demo, drug, reac, outc, etc.) │
│ 2. Deterministic Case Resolution & Deduplication │
│ 3. Standardized Transformations & Unit Normalization │
│ 4. Quality Control & Quality Summary Reporting │
│ 5. Self-describing Packaging (DuckDB & Parquet) │
└───────────────────────────┬────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ Packaged Artifacts │
│ - data/packages/faers_{release}.duckdb (Indexed SQL) │
│ - data/packages/faers_{release}.parquet/ (ZSTD Shards)│
└───────────────────────────┬────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ Downstream Ecosystem │
│ - raxtik-parser (Synthetic narratives, clinical ML) │
│ - raxtik-api (Case search, signal detection) │
│ - raxtik-studio (Interactive safety workbench) │
└────────────────────────────────────────────────────────┘
Decoupled Source Plugins
raxtik-etl contains zero source-specific proprietary parsing, column aliases, or archive file logic. Connectors such as raxtik-source-faers implement the SourceAdapter protocol and register via Python entry points (raxtik_etl.sources).
🏛️ Canonical Data Model
Every source connector projects raw records into 7 canonical fact tables:
| Table | Description | Primary / Entity Keys | Key Standardized Columns |
|---|---|---|---|
demo |
Case submissions & demographics | primary_id, case_id |
standard_age_years, standard_sex_label, event_date, reporter_occupation_label |
drug |
Reported drug exposures & regimens | primary_id, drug_seq |
drug_name, standard_role_label (PS/SS/C/I), route, dose_amt, dose_unit |
reac |
Adverse events / reaction terms | primary_id, pt |
pt (MedDRA Preferred Term) |
outc |
Seriousness outcome criteria | primary_id, outc_code |
outc_code, standard_outc_label (DE, HO, LT, DS, CA, RI, OT) |
indi |
Clinical indications for therapy | primary_id, indi_pt |
indi_drug_seq, indi_pt |
ther |
Therapy timelines & durations | primary_id, dsg_drug_seq |
start_date, end_date, duration_days |
rpsr |
Adverse event report sources | primary_id, rpsr_code |
rpsr_code, standard_rpsr_label |
Authoritative Case View (cases)
In addition to raw submissions, raxtik-etl compiles a deduplicated, authoritative view:
cases: EvaluatesCASE/CASEIDacross multiple submission updates (ISR/PRIMARYID), selecting the latest authoritative report version (FDA_DT,CASEVERSION) and flagging expedited 15-day cases and serious adverse outcomes (has_serious_outcome,is_death).
🚀 Quickstart
1. Installation
Requires Python >= 3.11 (Python 3.13 recommended) and uv.
# Set local Python version
pyenv local 3.13.5
# Create virtual environment and install raxtik-etl
uv venv --python 3.13.5 .venv
source .venv/bin/activate
uv pip install -e ".[dev]"
# Install the FDA FAERS source connector plugin
uv pip install -e ../raxtik-source-faers
2. Build a Quarterly Package via CLI
Generate a standalone DuckDB database and ZSTD-compressed Parquet directory from a raw quarterly extract:
raxtik-etl build-package \
--source faers \
--release 2004Q1 \
--zip-path data/raw/archives_cache/2004q1_ascii.zip \
--output-dir data/packages
Output:
data/packages/faers_2004Q1.duckdb(Indexed analytical database)data/packages/faers_2004Q1.parquet/(ZSTD-compressed columnar tables)
3. Inspect Package Metadata & Quality Metrics
raxtik-etl inspect-package --release 2004Q1 --package-dir data/packages
Displays package version, signature ID, fact record counts, and canonical data quality indicators.
💻 Python SDK Usage
Downstream applications can query packages using the high-performance FAERS client with zero-copy Polars DataFrames:
from raxtik_etl import FAERS
# Connect to the 2004Q1 compiled package
with FAERS(release="2004Q1", package_dir="data/packages") as faers:
# 1. Print self-describing metadata & data quality report
faers.print_summary()
# 2. Retrieve authoritative resolved cases
cases_df = faers.cases(limit=1000)
print(
cases_df.select(
[
"case_id",
"primary_id",
"canonical_case_version",
"standard_age_years",
"standard_sex_label",
"has_serious_outcome",
]
)
)
# 3. Query primary suspect drugs and reactions
drugs_df = faers.drugs(primary_suspect_only=True)
reactions_df = faers.reactions()
🔌 Implementing a Custom Source Adapter
Adding a new pharmacovigilance source (e.g., EudraVigilance, PMDA, or clinical trial safety feeds) requires zero changes to raxtik-etl:
- Implement
raxtik_etl.sources.protocol.SourceAdapter:
from raxtik_etl.sources.protocol import SourceAdapter, SourceArtifact, SourceLoadResult
import duckdb
class MyCustomSourceAdapter:
source_name: str = "my_pv_source"
def extract_and_load(
self, con: duckdb.DuckDBPyConnection, artifact: SourceArtifact
) -> SourceLoadResult:
# 1. Extract raw files from artifact.path
# 2. Project raw records into canonical staging tables:
# demo, drug, reac, outc, indi, ther, rpsr
# 3. Return SourceLoadResult with row counts and provenance metadata
...
- Register the entry point in your package's
pyproject.toml:
[project.entry-points."raxtik_etl.sources"]
my_pv_source = "my_package.adapter:MyCustomSourceAdapter"
raxtik-etlwill automatically discover and load the adapter:
raxtik-etl build-package --source my_pv_source --release 2024Q1 --zip-path /path/to/archive.zip
🧪 Testing & Code Quality
Run tests across the canonical engine:
# Run pytest test suite (25 unit and audit tests)
pytest tests/ -v
# Run linting and formatting
ruff check .
ruff format .
📚 Documentation & Guides
- 2004Q1 Dataset Integration & Usage Guide: Downstream synthetic generation recipes and data consumption.
- FDA FAERS Official Data Dictionary: Field references across S1, S2, and S3 eras.
- Historical Schema Evolution Audit: Longitudinal schema analysis from 2004Q1 to 2026Q2.
📄 License
Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
Metadata
Release files for raxtik-etl 0.1.0.dev0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| raxtik_etl-0.1.0.dev0.tar.gz | 206.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| raxtik_etl-0.1.0.dev0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 271.4 kB
Release files / raxtik_etl-0.1.0.dev0.tar.gz
| Download URL | raxtik_etl-0.1.0.dev0.tar.gz |
|---|---|
| Size | 206.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f7d91575461eaec415a071be500d7bde42374d71ba42dda95b9c26dd44f1cf5a
|
|
BLAKE2b-256 checksum How to use checksums |
33b59f394425a2fe80b230b9bb7f271ef744143434be92c3296cab3685bedd37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / raxtik_etl-0.1.0.dev0-py3-none-any.whl
| Download URL | raxtik_etl-0.1.0.dev0-py3-none-any.whl |
|---|---|
| Size | 64.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3516647598abb8d83d2768fddba6895e9d387a3ecedbbcdf793a0b05a4417e2
|
|
BLAKE2b-256 checksum How to use checksums |
7a3940dd50c878ea2ec359adc0aa1f02665e9a5c333d29bb0d3491e216c49275
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logSecurity for raxtik-etl 0.1.0.dev0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for raxtik_etl-0.1.0.dev0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.