Crates.io | books_description_parser |
lib.rs | books_description_parser |
version | 0.1.0 |
source | src |
created_at | 2024-11-20 03:05:02.660168 |
updated_at | 2024-11-20 03:05:02.660168 |
description | A Rust-based parser to extract book details from structured markdown-like text and output them in formats like JSON or Rust structs for further processing. |
homepage | |
repository | |
max_upload_size | |
id | 1454279 |
size | 42,936 |
books_description_parser
is a parser designed to extract information from a structured markdown-like catalog of books. The input consists of book descriptions that include details such as book title, authors, genres, publication year, rating, and price.
The parser processes these descriptions and converts them into a structured data format like JSON or Rust structs, which can be used for further analysis, storage, or integration into book-related applications.
The parser reads a markdown-like format with structured information for each book. Each book entry contains the following fields:
The parser leverages the Pest library to handle the input format. The grammar rules defined in grammar.pest
process various fields, including strings, numbers, and lists (e.g., authors and genres), ensuring accurate extraction.
Book 1: "Enemy Of My Enemy"
Authors: [Travis Casey, Melissa Mayberry]
Genres: [Fiction, Thriller, Drama]
Publication Year: 2016
Rating: 9.5
Price: 199.00 UAH
{
"book_title": "Enemy Of My Enemy",
"authors": [
"Travis Casey",
"Melissa Mayberry"
],
"genres": [
"Fiction",
"Thriller",
"Drama"
],
"publication_year": 2016,
"rating": 9.5,
"price": "199.00 UAH"
}