Python's defaults don't match SAS. pyclin's do.
Teams moving to Python stall on small numeric differences, and every company rebuilds the same global macros privately. pyclin matches SAS by default and documents and tests every intentional difference.
| Calculation | Python default | SAS / CDISC convention | pyclin |
|---|---|---|---|
| Rounding 2.5 to an integer | 2round() rounds half to even | 3ROUND, half away from zero | 3 |
| Standard deviation of 1, 2, 3, 4 | 1.118numpy uses population SD | 1.291n − 1 divisor | 1.291 |
| First quartile of 1, 2, 3, 4 | 1.75pandas linear interpolation | 1.5PCTLDEF=5 | 1.5 |
| Study day, one day before the reference date | 0date − reference + 1 | −1no day 0 | −1 |
The goal: double-programmed outputs agree to the last decimal, on 100% of reference cells.
One run, from collected data to Module 5
Existing public pilots start from pre-built SDTM. pyclin covers the full chain in a single language, and the build fails on any unexplained conformance finding.
Configure
A study file names the inputs, specs and outputs.
SDTM
Raw data mapped and conformed to the SDTM spec.
ADaM
Derived from SDTM and conformed to the ADaM spec.
TLFs
RTF outputs with plain-text twins for QC.
Package
XPT, define.xml, programs and checksums in m5.
Check
Conformance via CDISC CORE before release.
Four layers, one specification
Every layer reads the same metadata specification, so datasets, define.xml and documentation can't drift apart.
Interfacehow you run it
- pyclin build CLI
- Python API
- study config YAML
Submissionwhat you send
- pyclin.xpt XPT v5, IBM float, 5 GB split
- pyclin.define Define-XML 2.1
- pyclin.package eCTD m5, SHA-256
- pyclin.checks CORE
Analysiswhat you derive
- pyclin.sdtm
- pyclin.adam
- pyclin.tlf RTF + text
- pyclin.compare like PROC COMPARE
Foundationwhat everything trusts
- pyclin.spec
- pyclin.dates ISO 8601, study day
- pyclin.stats SAS parity
- pyclin.fmt precision, n (%)
In
Raw or CDASH data, metadata specs in CSV or Excel, controlled terminology, and a study config.
Out
SDTM and ADaM .xpt files, define.xml with an HTML preview, RTF TLFs, programs as .txt, and QC and conformance reports.
Roadmap
Each phase ships before the next begins. The flagship goal is the first public, Python-built test submission reviewed through an FDA pilot channel.
- Q1 2027
- Core pipelineSDTM, ADaM, four TLFs, define.xml and XPT on a synthetic study.
- Q2 2027
- CDISCPILOT01 parityReproduce the R Consortium Pilot 3 ADaM datasets and TLF results with zero numeric differences.
- Q3 2027
- Validation packageReviewer's guides, container image, and a public dry run by independent industry reviewers.
- Q4 2027
- Pilot submissionThrough a PHUSE or R Consortium partnership.
Design principles
The spec is the contract
Code never hard-codes labels, lengths or order.
SAS parity by default
Every intentional difference is documented and tested.
Deterministic output
Identical inputs produce byte-identical files.
Small, composable functions
Building blocks instead of monolithic study programs.
Reuse open tools
CORE, rtflite and pkglite rather than rebuilding them.
Validation in every release
Changelog, test report and a requirements-to-tests traceability matrix.
Part of an open toolkit
clinfolio ↗
Storage and large-scale processing. pyclin reads and writes clinfolio datasets.
Synthebo
Synthetic studies with known truth for end-to-end tests.
rwd2sdtm
Uses pyclin for XPT and define.xml output of real-world data.
DeltaBench ↗
Scores AI-generated specs and programs against pyclin reference outputs.
Help build it
pyclin is an independent project, built on personal time with public or synthetic data only. It's looking for its first collaborators before v1.0.
Out of scope by design: replacing CDISC CORE, bundling licensed dictionaries such as MedDRA or WHODrug, and EDC or trial management.
- Co-maintainersPython developers comfortable with pandas and packaging.
- Biostatistics reviewerTo review ANCOVA, time-to-event and exact CI methods.
- SAS parity testerTo produce reference outputs and confirm cell-level matches.