| Crates.io | habit_tracker_parser |
| lib.rs | habit_tracker_parser |
| version | 0.1.3 |
| created_at | 2024-11-12 21:08:42.58512+00 |
| updated_at | 2024-11-18 15:39:20.958882+00 |
| description | A parser for habit tracking records |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1445551 |
| size | 22,078 |
The Habit Tracker Parser is a Rust-based application designed to parse and analyze data from the habit-tracking tool, Habito, which is widely used on Linux. This parser’s purpose is to convert raw habit-tracking records into a structured format, ready for further analysis or export. It simplifies the extraction of key metrics about habit performance, making it easy to observe patterns, visualize progress, and identify areas for improvement over time.
Key Features:
The parser will interpret each row of the raw Habito records using custom grammar rules that capture the following components:
9: write 15 pages or 10: workout15.0 for "write 15 pages" or 1.0 for "workout."□ □ ■ □ □ □ □ □ □ indicates the habit was completed only once.The parser will recognize each part of the record based on positional patterns and character types:
: as an identifier and then capture the text until the metric.□ and filled ■ checkboxes, counted for calculating success rates.Given an example record:
│ 9: write 15 pages │ 15.0 │ 1 days │ □ □ ■ □ □ □ □ □ □ │
│ 10: workout │ 1.0 │ 2 days │ ■ ■ □ □ □ □ □ □ □ │
The parser converts this into:
HabitRecord {
id: 9,
description: "write 15 pages",
goal_metric: 15.0,
time_period: "1 day",
completion_status: vec![false, false, true, false, false, false, false, false, false],
}
HabitRecord {
id: 10,
description: "workout",
goal_metric: 1.0,
time_period: "2 days",
completion_status: vec![true, true, false, false, false, false, false, false, false],
}