pbix

Crates.iopbix
lib.rspbix
version0.1.0
sourcesrc
created_at2023-04-11 14:30:38.76336
updated_at2023-04-11 14:30:38.76336
descriptionParsing library for Power BI report files (.pbix)
homepagehttps://github.com/powerlint/pbix/
repositoryhttps://github.com/powerlint/pbix/
max_upload_size
id836073
size10,451
Luke Carr (lukecarr)

documentation

https://github.com/powerlint/pbix/

README

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).

Parsing files

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}"),
};

Features

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.

Commit count: 8

cargo fmt