crispy_xmltv/lib.rs
1//! Streaming XMLTV/EPG parser and writer.
2//!
3//! Faithfully translates the `@iptv/xmltv` TypeScript library into Rust,
4//! using `quick_xml` event-based parsing for efficient handling of 100 MB+
5//! EPG files without buffering the entire DOM.
6//!
7//! # Usage
8//!
9//! ```rust
10//! use crispy_xmltv::{parse, write};
11//!
12//! let xml = r#"<?xml version="1.0" encoding="UTF-8"?>
13//! <tv>
14//! <channel id="ch1">
15//! <display-name>Channel One</display-name>
16//! </channel>
17//! <programme start="20250115120000 +0000" stop="20250115130000 +0000" channel="ch1">
18//! <title>Test Show</title>
19//! </programme>
20//! </tv>"#;
21//!
22//! let doc = parse(xml).unwrap();
23//! assert_eq!(doc.channels.len(), 1);
24//! assert_eq!(doc.programmes.len(), 1);
25//!
26//! let output = write(&doc);
27//! assert!(output.contains("<channel id=\"ch1\">"));
28//! ```
29
30pub mod compression;
31pub mod episode;
32pub mod error;
33pub mod parser;
34pub mod timestamp;
35pub mod types;
36pub mod writer;
37
38pub use compression::decompress_auto;
39pub use episode::{EpisodeInfo, parse_episode_number};
40pub use error::XmltvError;
41pub use parser::{parse, parse_compressed, parse_reader};
42pub use types::XmltvDocument;
43pub use writer::write;