Skip to main content

Crate piyoparse

Crate piyoparse 

Source
Expand description

Parser for PiyoLog export text.

piyoparse reads PiyoLog day or month exports into Rust structs. The parser intentionally uses one tolerant path for both iOS and Android export layouts instead of asking callers to classify the platform first.

§Example

use piyoparse::{parse, RecordData};

let export = "\
【ぴよログ】2026/5/10(日)
赤ちゃん (6か月21日)

01:40   ミルク 180ml
08:05   母乳 左7分 / 右7分 (30ml)

母乳合計 左 7分 / 右 7分
ミルク合計 1回 180ml
";

let parsed = parse(export)?;
let day = &parsed.days[0];

assert_eq!(day.records.len(), 2);
assert_eq!(day.summary.formula_total_ml, 180);

match &day.records[0].data {
    RecordData::Formula { amount_ml, .. } => assert_eq!(*amount_ml, Some(180)),
    other => panic!("unexpected record data: {other:?}"),
}

This crate is an unofficial tool and is not affiliated with PiyoLog or its operating company.

Structs§

Day
Parsed data for one exported day.
DaySummary
Per-day summary totals printed by PiyoLog.
ParsedExport
Parsed PiyoLog export.
Record
One timestamped record in a PiyoLog day.

Enums§

BreastMilkOrder
Explicit breastfeeding order.
ParseError
Errors that can occur while reading a PiyoLog export.
RecordData
Parsed data for a PiyoLog record.

Functions§

parse
Parses a PiyoLog export.

Type Aliases§

Result
Result type returned by parser APIs.