A pure Rust implementation of the EDF+ (European Data Format Plus) file read/write library, focused on providing a safe and efficient API.
👉 Click to view the complete API documentation and tutorials
The documentation includes:
- 🚀 Quick Start Guide
- 📚 Detailed API Reference
- 💡 Best Practices and Common Pitfalls
- 🧪 Compilable Code Examples
- 🔧 Advanced Usage and Performance Optimization
use edfplus::{EdfReader, EdfWriter, SignalParam};
// Read an EDF+ file
let mut reader = EdfReader::open("data.edf")?;
let samples = reader.read_physical_samples(0, 1000)?;
// Create an EDF+ file
let mut writer = EdfWriter::create("output.edf")?;
writer.add_signal(SignalParam::new_eeg("EEG Fp1", 256))?;
writer.write_samples(&[samples])?;
writer.finalize()?;- For detailed usage of
reader, see EdfReader - For detailed usage of
writer, see EdfWriter - For writing annotations (event markers), see add_annotation
- For common sample writing methods and their limitations, see write_samples
[dependencies]
edfplus = "0.1.0"- ✅ Full EDF+ read/write support
- ✅ Type-safe API design
- ✅ Memory-efficient streaming
- ✅ Rich metadata support
- ✅ Time-accurate annotation system
See the examples/ directory:
# Generate a test file
cargo run --example generate_test_file
# Basic reading example
cargo run --example basic_example
# Best practices for annotations
cargo run --example annotation_best_practices- Annotation Limitations: Descriptions are limited to 40 characters and must be within the data time range. For details, see add_annotation
- Write Limitations: Backtracking to modify already written data is not supported. For details, see write_samples
This project is licensed under BSD-3-Clause.
Issues and pull requests are welcome!
This library is inspired by the original EDFlib C library, but reimplemented with modern Rust best practices.
💡 Tip: This README provides only a quick overview. For the complete usage guide, API documentation, and best practices, please visit the online documentation