Crates.io | cargo-opql |
lib.rs | cargo-opql |
version | 0.0.3 |
created_at | 2025-08-13 10:21:57.060588+00 |
updated_at | 2025-08-13 10:21:57.060588+00 |
description | A Rust command-line tool for parsing and querying PQL (Process Query Language) files |
homepage | https://github.com/solve-poker/open-pql |
repository | |
max_upload_size | |
id | 1793502 |
size | 31,156 |
⚠️ Work in Progress: This project is currently under active development and is not yet ready for production use.
Command-line interface for Open PQL (Poker Query Language). This binary provides an interactive shell and command-line access to PQL functionality for poker analysis.
The opql
CLI tool allows you to:
# Clone the repository
git clone <repository-url>
cd rs-pql
# Build and install
cargo install --path opql
cargo install cargo-opql
Execute single PQL queries directly:
# Basic equity calculation
opql -c "select equity from hero='AhKh', villain='QQ+', board='Ah9s2c', game='holdem'"
# Average board suit count analysis
opql -c "select avg(boardsuitcount(river)) from hero='As9s', villain='*', board='2s3sJh', game='holdem'"
# Hand type frequency analysis
opql -c "select handtype, count(*) from hero='*', board='AhKs2c', game='holdem' group by handtype"
Launch the interactive shell for exploratory analysis:
opql
In the interactive shell:
opql> select equity from hero='AhKh', villain='QQ', board='', game='holdem';
Hero Equity: 56.77%
opql> select avg(nuts) from hero='*', board='AhKs2c7d', game='holdem';
Average Nuts: 0.0234
opql> help
Available commands:
help - Show this help message
quit - Exit the shell
clear - Clear the screen
opql [OPTIONS]
OPTIONS:
-c, --command <COMMAND> Execute a single PQL command and exit
-f, --file <FILE> Execute commands from file
-v, --verbose Enable verbose output
-h, --help Print help information
-V, --version Print version information
-- Preflop equity
select equity from hero='AhKh', villain='QQ', game='holdem';
-- Postflop equity with specific board
select equity from hero='AhKh', villain='QQ+', board='Ah9s2c', game='holdem';
-- Equity vs range
select equity from hero='AhKh', villain='QQ+,AK', board='', game='holdem';
-- Hand strength distribution
select handtype, count(*) from hero='*', board='AhKs2c' group by handtype;
-- Board texture analysis
select avg(boardsuitcount(flop)), avg(paired(flop)) from board='*';
-- Turn/river analysis
select avg(equity) from hero='AA', villain='*', board='Ah9s2c*', game='holdem';
-- Multi-street analysis
select street, avg(equity) from hero='AhKh', villain='22+', board='Ah9s2c*' group by street;
-- Conditional analysis
select equity from hero='AhKh', villain='*' where inrange(villain, 'QQ+,AK');
The CLI tool supports configuration through:
See the main project documentation for detailed configuration options.
cargo build --package opql
cargo test --package opql
Licensed under the MIT License. See LICENSE for details.