Expand description
§chatpack
Compress chat exports from Telegram, WhatsApp, and Instagram into token-efficient formats for LLMs.
§Quick Start
use chatpack::prelude::*;
// Parse a Telegram export
let parser = create_parser(Source::Telegram);
let messages = parser.parse("chat.json").unwrap();
// Merge consecutive messages from same sender
let merged = merge_consecutive(messages);
// Filter by date or sender
let config = FilterConfig::new()
.after_date("2024-01-01").unwrap()
.with_user("Alice".to_string());
let filtered = apply_filters(merged, &config);§Using Individual Parsers
use chatpack::parsers::{TelegramParser, WhatsAppParser, InstagramParser, ChatParser};
let telegram = TelegramParser::new();
let messages = telegram.parse("result.json").unwrap();
let whatsapp = WhatsAppParser::new();
let messages = whatsapp.parse("chat.txt").unwrap();§Output Formats
use chatpack::prelude::*;
let messages = vec![InternalMessage::new("Alice", "Hello!")];
let config = OutputConfig::new().with_timestamps();
// Write to different formats
write_csv(&messages, "output.csv", &config).unwrap();
write_json(&messages, "output.json", &config).unwrap();
write_jsonl(&messages, "output.jsonl", &config).unwrap();Re-exports§
pub use core::filter::FilterConfig;pub use core::filter::FilterError;pub use core::models::InternalMessage;pub use core::models::OutputConfig;pub use core::processor::ProcessingStats;pub use parsers::ChatParser;pub use parsers::create_parser;pub use cli::OutputFormat;pub use cli::Source;