Skip to main content

parq-blockmodel logo parq-blockmodel

Run Tests PyPI Coverage Python Versions License Publish Docs Open Issues Open PRs

Overview

A Python package for efficient storage, manipulation, and analysis of mining block models using Parquet files. parq-blockmodel provides tools for reading, writing, indexing, and transforming large-scale block model datasets, leveraging the performance of Apache Arrow and Parquet for scalable geoscience data workflows.

Typical 3-step workflow

parq-blockmodel is designed around a practical 3-step process:

  1. Validate block model attributes against a Pandera schema.
  2. Review (profile) data quality and distributions with an HTML profile report.
  3. View the model interactively with local PyVista plotting or the Trame server viewer.

Installation

Install the base package from PyPI:

pip install parq-blockmodel

Full 3-Step Workflow

For the complete experience (validate, profile, local visualization, and GIS/server options), install with all workflow extras:

pip install "parq-blockmodel[all]"

Installation by Workflow Step

Step 1: Validate — Pandera schema support for data validation:

pip install "parq-blockmodel[schema]"

Step 2: Review — HTML profiling reports for data quality inspection:

pip install "parq-blockmodel[profiling]"

Step 3: View — Local plotting with PyVista and Plotly:

pip install "parq-blockmodel[viz]"

**Optional: Spatial / GIS** — GeoDataFrame, GeoParquet, and polygon workflows:

```bash
pip install "parq-blockmodel[spatial]"

Optional: Server viewer — Trame web app support:

pip install "parq-blockmodel[server-viz]"

See the [Quick Start Guide](https://parq-blockmodel.readthedocs.io/en/stable/usage/quickstart.html) for a walkthrough of the 3-step workflow.

## Schema validation

`ParquetBlockModel` accepts an optional `schema=` argument on its main
constructors. You can pass either a Pandera `DataFrameSchema` object or a path
to a YAML schema file, then validate the resulting model in chunks:

```python
from pathlib import Path

from parq_blockmodel import ParquetBlockModel

pbm = ParquetBlockModel.from_parquet(
    Path("path/to/blockmodel.parquet"),
    schema=Path("schemas/blockmodel.schema.yaml"),
)

pbm.validate()
pbm.validate(sample_chunks=1)  # quick spot-check for large models

See the User Guide for detailed documentation on calculated attributes, including custom lookups and functions.

Profiling report review

Install profiling support and create an HTML profile report:

pip install "parq-blockmodel[profiling]"
report = pbm.create_report(columns_per_batch=None)
print(report.output_path)

When a schema includes column title / description, those values are included in report variable descriptions. See the Profiling Reports guide and the examples gallery for a full walkthrough.

Visualization

The block-model plotting path now delegates through parq_blockmodel.visualization, which keeps the rendering logic isolated from ParquetBlockModel itself.

Install parq-blockmodel[viz] for local PyVista/Plotly plotting, and add parq-blockmodel[server-viz] for Trame examples.

from parq_blockmodel import ParquetBlockModel
from parq_blockmodel.visualization import BlockModelTrameApp, TrameBlockModelPlotEngine

pbm = ParquetBlockModel.from_parquet("orebody.parquet")
plotter = pbm.plot(scalar="grade", z_up_lock=True, z_up_hotkey="z")

# Optional terrain context for the PyVista engine:
# - elevation_raster adds a DEM surface
# - imagery_raster textures the DEM when both rasters align
plotter = pbm.plot(
    scalar="grade",
    elevation_raster="dem.tif",
    imagery_raster="imagery.tif",
)

trame_app_from_plot = pbm.plot(
    scalar="grade",
    engine=TrameBlockModelPlotEngine(),
    z_up_lock=True,
    z_up_hotkey="z",
)

app = BlockModelTrameApp(pbm, scalar="grade", z_up_lock=True, z_up_hotkey="z")

With z_up_lock=True, hold z for turntable-style orbit (yaw/pitch, no roll) with camera up aligned to +Z.

Geometry operations

parq-blockmodel supports three geometry flagging workflows:

Metadata

Release files for parq-blockmodel 0.16.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parq-blockmodel 0.16.2
File Size Uploaded Provenance Actions
parq_blockmodel-0.16.2.tar.gz 415.0 kB Without provenance Details for parq_blockmodel-0.16.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for parq-blockmodel 0.16.2
File Interpreter ABI Platform Actions
parq_blockmodel-0.16.2-py3-none-any.whl Python 3 none any Details for parq_blockmodel-0.16.2-py3-none-any.whl

Total release size: 571.2 kB

Release files / parq_blockmodel-0.16.2.tar.gz

Download URL parq_blockmodel-0.16.2.tar.gz
Size 415.0 kB
Tags Source
SHA-256 checksum
How to use checksums
807a56a2a285fb24b8afd17450cb0cb3a0fcb015920f3a780a7230e1952216d1
BLAKE2b-256 checksum
How to use checksums
22fa7ade387d44cf904ab506b1439549fa29e91242c8cf5c870181b97118729f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / parq_blockmodel-0.16.2-py3-none-any.whl

Download URL parq_blockmodel-0.16.2-py3-none-any.whl
Size 156.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42615b393fc5a460a2f3ed73658cc13a629d322548fb7b837da1436ca7fda568
BLAKE2b-256 checksum
How to use checksums
26363274e5e94352b9b87dfd3e686531f00dd790c4db78426f5c011deb76d670
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for parq-blockmodel 0.16.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.16.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page