Skip to main content

PitOpt

CI License: AGPL-3.0 Python 3.10+ Live demo

PitOpt is open-source software for open-pit mine planning. It reads a block model (CSV) and a topography surface (DXF or CSV XYZ), then computes nested revenue-factor shells, a discounted pit-by-pit analysis, the final pit chosen on NPV, pushbacks, a period-by-period production schedule, and a benched pit design with ramps. Results export as Excel and PDF reports, DXF surfaces, and an interactive 3D viewer that works offline. It runs on your own computer; your data stays on it.

PitOpt results summary for the synthetic porphyry example

Open the live workspace → (synthetic case study, read-only, no sign-up)  ·  Demo vs Local matrix →  ·  MineLib real-data tutorial →  ·  Install it locally →

Features

  • Exact ultimate-pit optimisation. Every shell is a maximum closure solved with SciPy Dinic max-flow (scipy_dinic) and cross-checked against NetworkX preflow-push and brute force.
  • Strategic workflow. Nested RF shells, best- and worst-case NPV, final pit selection, pushbacks, a capacity-constrained schedule, and price sensitivity.
  • Detailed design. Benches, berms and ramps per geotechnical sector, checked against inter-ramp and overall slope limits and reconciled to the optimised shell.
  • Your data, as delivered. Map CSV column names from common exports (Surpac, Datamine, Vulcan, GEMS, Leapfrog); multi-product and by-product economics; pitopt reblock regularises sub-celled models.
  • Desktop app, AI chat, CLI, and MCP. Native desktop installers (macOS .dmg and Windows Setup.exe, no Python required), a local browser app in English or Indonesian with optional AI Chat (1-click OpenRouter Free, BYOK, or local Ollama/LM Studio), a pitopt CLI, and an optional local MCP server.
More screenshots

3D view with topography, pit shell and pushbacks

Install

Download the latest standalone build from GitHub Releases:

  • macOS (Apple Silicon / Intel): open PitOpt-macos-*.dmg, drag PitOpt to Applications, then right-click -> Open on first launch.
  • Windows (x64): run PitOpt-Setup-windows-x64.exe (installs per-user without Admin privileges; click More info -> Run anyway if SmartScreen prompts).

The desktop app opens in a native window (pywebview), bundles verified sample datasets (openpit_gold Au-Ag and openpit_nickel Ni-Co from orebit-datasets), and stores your own projects in ~/PitOpt/projects/.

From Source (Python 3.10+ & Git)

Check with python3 --version (on Windows, py -3 --version). Full steps for each platform are in docs/INSTALLATION.md.

Windows (in PowerShell or Command Prompt, from the folder where you want PitOpt):

git clone https://github.com/ghoziankarami/pitopt.git && cd pitopt && PitOpt.bat

macOS (in Terminal):

git clone https://github.com/ghoziankarami/pitopt.git && cd pitopt && bash PitOpt.command

Linux (in a terminal):

git clone https://github.com/ghoziankarami/pitopt.git && cd pitopt && bash scripts/start_ui.sh

The first launch creates a local .venv, installs PitOpt, runs the bundled synthetic examples, and opens http://127.0.0.1:8765. The first start takes a few minutes; later starts take seconds. Keep the launcher window open while you work and press Ctrl+C to stop. Without Git, download the ZIP archive, extract it, and start the launcher for your platform.

Use it

With your own data: in the app, open Manage → New project, then upload a block model (CSV) and, optionally, a topography (DXF or CSV XYZ). The wizard detects coordinate columns and block size, asks for prices, costs, recoveries and slopes, and marks every value you did not enter as an assumption.

From the command line (after installation, in the pitopt folder):

source .venv/bin/activate        # Windows: .venv\Scripts\activate
pitopt validate --config projects/example_tin/project.yaml   # checks inputs, prints the cutoff grade
pitopt run      --config projects/example_tin/project.yaml   # writes reports to outputs/example_tin/
pitopt ui                                                    # starts the web app

Copy projects/example_tin/ to start your own project; its project.yaml is the fully commented template.

Documentation

Document Contents
INSTALLATION.md Install steps per platform, troubleshooting, optional extras
FEATURE-MATRIX.md Web demo vs local install matrix across all 23 views & demo warning guide (ID / EN)
TUTORIAL.md Step-by-step walkthrough on real public MineLib marvin Cu-Au data (ID / EN)
TECHNICAL.md Outputs, configuration, block valuation, workflow, design, verification, CLI and MCP reference
METODOLOGI.md Calculation rules end to end with a worked example (Indonesian)
RELEASE_AUDIT.md Release audit and known numerical limitations
PRD.md Product requirements for the app

Scope and limitations

The closure solve is exact. Everything around it is approximate: the slope template, flat costs, a single process destination, a schedule that follows a specified sequence rather than optimising every block, and in-memory graphs that limit models to the low hundreds of thousands of blocks. An optimum of the discrete block graph is not a mineral resource or reserve estimate, a geotechnically approved pit, or an optimal production schedule. Design outputs must be reviewed by a Competent Person under the applicable industry standard before use. Read What this is not before taking a number into a study.

Contributing

Bug reports, ideas and pull requests are welcome. See CONTRIBUTING.md and the Code of Conduct. Report security issues privately as described in SECURITY.md. If PitOpt is useful to you, a ⭐ on GitHub helps others find it.

License and citation

PitOpt is released under the GNU Affero General Public License v3.0 (AGPL-3.0-only): you may use, study, change and share it, and if you distribute a modified version or run one as a network service, you must offer its complete source under the same licence. Keep the copyright notice and NOTICE in every copy. Releases up to v0.4.0 were published under the MIT License and remain available under it. The names "PitOpt" and "Orebit" and the logo are not licensed for forks or competing products; see TRADEMARKS.md. Bundled fonts (OFL-1.1) and MineLib benchmark files (CC BY-SA 3.0) keep their own licenses; see THIRD_PARTY_NOTICES.md. If you use PitOpt in research, please cite it using CITATION.cff (GitHub's "Cite this repository" button).

Metadata

Release files for pitopt 1.1.0

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

Source distribution (sdist)

Source distribution for pitopt 1.1.0
File Size Uploaded Provenance Actions
pitopt-1.1.0.tar.gz 1.3 MB Without provenance Details for pitopt-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pitopt 1.1.0
File Interpreter ABI Platform Actions
pitopt-1.1.0-py3-none-any.whl Python 3 none any Details for pitopt-1.1.0-py3-none-any.whl

Total release size: 2.4 MB

Release files / pitopt-1.1.0.tar.gz

Download URL pitopt-1.1.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
12041b92a66cce97d4d5ac615c02c69c83b3293b9f0f37ba366a6b3b4e4ecc63
BLAKE2b-256 checksum
How to use checksums
0fe59829afe2ae1e1deae0d5b85d15c63c203526359d97a1743210d1538206fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pitopt-1.1.0-py3-none-any.whl

Download URL pitopt-1.1.0-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3be5ee233c3505cb0a84d3f38c5700f1eda5171d3f9bc71fa93befb15eee256c
BLAKE2b-256 checksum
How to use checksums
79161da77c732ecb1a2294a18a6a1fde5a849d29bd6cb1a5d64dac53b98b489f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pitopt 1.1.0

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

1.1.0 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