| Crates.io | xportrs |
| lib.rs | xportrs |
| version | 0.0.8 |
| created_at | 2026-01-08 17:11:09.039468+00 |
| updated_at | 2026-01-13 21:22:17.661798+00 |
| description | CDISC-compliant XPT file generation and parsing library for Rust |
| homepage | |
| repository | https://github.com/rubentalstra/xportrs |
| max_upload_size | |
| id | 2030709 |
| size | 5,545,452 |
A safe, DataFrame-agnostic implementation of SAS Transport v5 (XPT) file I/O with built-in regulatory compliance validation for FDA, PMDA, and NMPA submissions.
| Agency | Region | Character Encoding | Max File Size |
|---|---|---|---|
| FDA | United States | ASCII | 5 GB |
| PMDA | Japan | UTF-8 (Japanese) | 5 GB |
| NMPA | China | UTF-8 (Chinese) | 5 GB |
All agencies enforce: 8-byte variable names, 40-byte labels, 200-byte character values.
[dependencies]
xportrs = "0.0.8"
use xportrs::{Xpt, Agency};
fn main() -> Result<(), xportrs::Error> {
// Read an XPT file
let dataset = Xpt::read("dm.xpt")?;
// Write with FDA compliance validation
Xpt::writer(dataset)
.agency(Agency::FDA)
.finalize()?
.write_path("dm.xpt")?;
Ok(())
}
For comprehensive examples and API documentation, see docs.rs/xportrs.
| Aspect | Status |
|---|---|
| Unsafe Code | #![forbid(unsafe_code)] |
| External C Dependencies | None |
| Minimum Rust Version | 1.92 |
MIT License — see LICENSE for details.