Libraccio Extractor
A Flutter library for extracting book data from libraccio.it product pages.
This library parses the JSON-LD structured data embedded in libraccio.it book pages and provides a convenient Dart API to access book information including title, author, ISBN, description, cover image, price, and availability.
Features
- Extracts book data from libraccio.it product pages
- Parses JSON-LD structured data (schema.org Book/Product)
- Provides Dart models for all book properties
- Includes a widget for displaying book cover images
- Handles network requests and HTML parsing
Installation
Add this to your pubspec.yaml:
dependencies:
libraccio_extractor:
git:
url: https://github.com/yourusername/libraccio_extractor.git
Then run:
flutter pub get
Usage
Import the library:
import 'package:libraccio_extractor/libraccio_extractor.dart';
Extract book data by ISBN (recommended approach):
final book = await LibraccioParser.extractBookDataByIsbn('9788806266738');
if (book != null) {
print('Title: ${book.name}');
print('Author: ${book.author?.name}');
print('ISBN: ${book.isbn}');
print('Price: €${book.offers?.price}');
print('Availability: ${book.offers?.availability}');
}
Alternatively, extract book data from a libraccio.it URL:
final book = await LibraccioParser.extractBookData(
'https://www.libraccio.it/libro/9788806266738/davide-longo/la-donna-della-mansarda.html',
);
Display a book cover image:
BookCoverWidget(
imageUrl: book.image,
width: 120,
height: 160,
)
Parse book data from HTML content directly:
final book = LibraccioParser.parseBookFromHtml(htmlContent);
Data Models
The library provides the following data models:
Book: Main book data including title, author, ISBN, description, etc.Offer: Pricing and availability informationAuthor: Author information
Dependencies
This library depends on:
http: For making network requestshtml: For parsing HTML contentjson_annotation: For JSON serializationcached_network_image: For efficient image loading and caching
Example App
See the example/ directory for a complete Flutter app demonstrating usage.
License
MIT
Libraries
- book
- book_cover_widget
- libraccio_extractor
- A Flutter library for extracting book data from libraccio.it
- libraccio_parser