Crates.io | pbix |
lib.rs | pbix |
version | 0.1.0 |
source | src |
created_at | 2023-04-11 14:30:38.76336 |
updated_at | 2023-04-11 14:30:38.76336 |
description | Parsing library for Power BI report files (.pbix) |
homepage | https://github.com/powerlint/pbix/ |
repository | https://github.com/powerlint/pbix/ |
max_upload_size | |
id | 836073 |
size | 10,451 |
Power BI report file (.pbix) parser implemented in Rust. Extract report settings, page structure, and visuals.
pbix is a crate that lets you parse and extract metadata from Power BI report files (.pbix
).
You can use pbix::parse_file(path: AsRef<Path>)
to parse a Power BI report file for a given path:
match pbix::parse_file("Example.pbix") {
Ok(report) => println!("Parsed {} pages from the report file!", report.pages.len()),
Err(e) => eprintln!("Failed to parse report: {e}"),
};
from_bytes
Alternatively, you can use pbix::from_bytes(bytes: &[u8])
to parse a report file if you would like to work with bytes (instead of filenames).
let bytes = ...;
match pbix::from_bytes(&bytes) {
Ok(report) => println!("Parsed {} pages from the report file!", report.pages.len()),
Err(e) => eprintln!("Failed to parse report: {e}"),
};
Below you can find documentation on the different feature flags that this crate exposes.
rayon
This feature uses the rayon crate to introduce parallelism in report data parsing and transforming.
You can enable this feature by including it in your Cargo.toml
: no extra configuration or code is required!
[dependencies]
pbix = { version = ..., features = ["rayon"] }
Basic testing on a Power BI report sourced from Microsoft's examples indicated a ~15% improvement in parsing time when using this feature.