8 releases
Uses new Rust 2024
| 0.0.8 | Jan 13, 2026 |
|---|---|
| 0.0.7 | Jan 12, 2026 |
#685 in Encoding
1MB
5.5K
SLoC
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.
Features
- Regulatory Compliance — Built-in validation for FDA, PMDA, and NMPA submission requirements
- Read & Write — Full support for SAS Transport v5 format
- Auto File Splitting — Automatically splits files exceeding agency size limits (5 GB)
- Framework Agnostic — Works with any in-memory data representation
- Safe by Design — Zero unsafe code, no C dependencies
Regulatory Agency Support
| 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.
Installation
[dependencies]
xportrs = "0.0.8"
Quick Example
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.
Documentation
- API Reference — Full API documentation
- Examples — Code examples for reading, writing, and validation
- CONTRIBUTING — Contribution guidelines
Safety & Quality
| Aspect | Status |
|---|---|
| Unsafe Code | #![forbid(unsafe_code)] |
| External C Dependencies | None |
| Minimum Rust Version | 1.92 |
Related Projects
- xportr — R package that inspired this crate
- Trial Submission Studio — Desktop application using xportrs
License
MIT License — see LICENSE for details.
Dependencies
~3–20MB
~211K SLoC