major-requirement-parser
MQL 0.2
Package 0.3.0 compiles MQL 0.2 programs (RFC 0002) into the versioned, solver-independent semantic IR (RFC 0001):
program ee_electives {
catalog 2026-2027
institution "https://yale.example/mql/institution" @ "2026-2027"
credit_scale 2
}
requirement electives "Four electives, three advanced" [elective] {
courses exactly 4 where course.subject = "ECE" and course.format != "research";
constraint three_advanced "At least three at level 4000":
at least 3 attempts where course.level >= 4000;
}
mql --compile ee.mql --institution examples/yale-institution.json -o ee.json
Field types come from the institution schema, which is required when a program uses predicates (where …) or group fields. Programs that only use course lists compile without one. Errors are reported as file:line:column: CODE: message. The fixture sources show every construct.
The compiled IR has schema_version 0.2.0. That version is independent of the package version.
Rust:
let institution = libmql::institution::Institution::from_json(&institution_json)?;
let program = libmql::compiler::compile(&source, "ee.mql", Some(&institution))?;
Python:
ir = pylibmql.compile_program(source, "ee.mql", institution_json)
ir.json_pretty()
Existing IR documents are validated and canonicalized with mql --validate-ir program.json or pylibmql.validate_semantic_ir(json). This package does not perform degree audits or multi-term planning.
The legacy 0.1 language is still the default for mql FILE and pylibmql.parse(...). Its output reports language version 0.1.12.
Components
- Command Line Interface
- Rust Library
- Python Library (FFI bindings)
Command Line Usage
Usage: mql [OPTIONS] [INPUT]
Arguments:
[INPUT]
Path to the input file
Options:
-o, --output <OUTPUT>
Path to the output file [Default: output to `stdout`]
--compile
Compile an MQL 0.2 source file to validated semantic IR JSON
--institution <FILE>
Institution schema JSON that types predicate fields and checks facts
--validate-ir
Validate and canonicalize an MQL 0.2 semantic IR JSON document
-D, --var <NAME=EXPR>
Inject a legacy (0.1) parser external value
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Python Installation
# minimum version 3.8
pip install pylibmql
Ready to use right away.
import pylibmql
pylibmql.parse(...) retains the legacy 0.1 language. New programs should be written in MQL 0.2 and compiled with pylibmql.compile_program(...).
Legacy MQL 0.1 Syntax
The MQL 0.2 grammar is specified in RFC 0002. The 0.1 grammar below is retained for mql FILE and pylibmql.parse.
File ::= SpecialStatement ";" { SpecialStatement ";" } ;
SpecialStatement ::= Statement ":" String [ ":" QuantitySingle ] ;
Statement ::= "SELECT" Quantity "FROM" Selector ;
Selector ::= SelectorList | SelectorSingle ;
SelectorList ::= "[" SelectorSingle { "," SelectorSingle } "]" ;
SelectorSingle ::= Statement | XYZ ;
XYZ ::= QueryName "(" QueryArgument { "," QueryArgument } ")" ;
QueryName ::= "CLASS" | "class" | "PLACEMENT" | "placement"
| "TAG" | "tag" | "RANGE" | "range" ;
QueryArgument ::= String | ClassArgument ;
ClassArgument ::= DepartmentId ClassId ;
DepartmentId ::= UppercaseLetter UppercaseLetter UppercaseLetter UppercaseLetter ;
ClassId ::= Digit Digit Digit Digit ;
Quantity ::= QuantityMany | QuantitySingle ;
QuantityMany ::= QuantitySingle "-" QuantitySingle ;
QuantitySingle ::= Digit { Digit } ; (* one or more digits; non-empty *)
String ::= "\"" { "\"\"" | (AnyCharExcept["\"", "\r", "\n"]) } "\"" ;
(* Lexical *)
UppercaseLetter ::= "A" | ... | "Z" ;
Digit ::= "0" | ... | "9" ;
Metadata
Release files for pylibmql 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pylibmql-0.3.0.tar.gz | 88.1 kB | Without provenance | Details for pylibmql-0.3.0.tar.gz |
Built distributions (wheels)
Total release size: 13.3 MB
Release files / pylibmql-0.3.0.tar.gz
| Download URL | pylibmql-0.3.0.tar.gz |
|---|---|
| Size | 88.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d47d5d21fba7c8beb54feaf61b9ace302d2d88bc8d25946875b5d306ed125ec8
|
|
BLAKE2b-256 checksum How to use checksums |
3199e0dbe8040d72840babbf941091ee835449d7d584182b9189092e3eb2a00b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-win_amd64.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 751.6 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5fa10c5bd7ec2e79bed4a25afe1f0fa18bfde57b4974eb03f93e0aa3dbcccd75
|
|
BLAKE2b-256 checksum How to use checksums |
0f23254d1a305defe093f4692a010a9a71d0b37bac63a7b99fd3221967d19f33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-win32.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-win32.whl |
|---|---|
| Size | 660.4 kB |
| Tags | CPython 3.8 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
9521f3c7fbb6aea0c1a61fea324d8b3496947e74b7aaddeb3c79577b1b2ef0db
|
|
BLAKE2b-256 checksum How to use checksums |
ecf76d21e0878de87f0c705e8591f5de2a58810e56e875d68ee5596ea7e2e96e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-musllinux_1_2_x86_64.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
bbf0fb030f405797b5676641984d5e31f3ffd5e8d62628042e3f2a0da5ce0aed
|
|
BLAKE2b-256 checksum How to use checksums |
d432e2e68b6018dcd56d4bd66c9c9e91c1131395822061f965b020f12d7b0a3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-musllinux_1_2_i686.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
edecc76e7deb4c472f54f7e2029bd8496804022e9c40c4c09e111570fd2c1f02
|
|
BLAKE2b-256 checksum How to use checksums |
4e543b2ca7ee0f0e2d7b63f650940f7e21562eb72d344935495d4e4b9576213d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-musllinux_1_2_armv7l.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.8 Linux musl 1.2+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
2083148c16189cb3ea0a2c15a7ff2206f315a0aa412a67d102058ceb0da05c11
|
|
BLAKE2b-256 checksum How to use checksums |
974bf973465fc4216fef39b73dae1e2ac83e6bafdb028f702cbfc4a4f09e19a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-musllinux_1_2_aarch64.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c3de8b03200112876137bbd55f09d6a9c91346207a7250afb41e7997c07093f4
|
|
BLAKE2b-256 checksum How to use checksums |
ea89141a0a7df142e9453e25211ee2b7105eb9ec751f13d55dc027b6530b4915
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 897.9 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a9bddc5653d554849f8d047e726497891be0240f27bca809eaac5738eac9a048
|
|
BLAKE2b-256 checksum How to use checksums |
0d96ad1cbb9521543e9726ab66c96d9ee4cdae9883ca770eeec2028892762234
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl |
|---|---|
| Size | 966.6 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ IBM System/390x abi3 |
|
SHA-256 checksum How to use checksums |
ed3bab8e6ce88103fc3c816907f368b6c38bc4109b75af72c14f9050b743f7a2
|
|
BLAKE2b-256 checksum How to use checksums |
ef1344032d10466f8b11ce9c1905502d3f23a70e57a2212955d1124f62bd6668
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ PowerPC 64-le abi3 |
|
SHA-256 checksum How to use checksums |
ebad5bf956e4bfdfe36965e6533cb38e9a67e69d9ad7b3a0836e0132ac495e73
|
|
BLAKE2b-256 checksum How to use checksums |
72edf87384977f3dd4364163822ff986b82156ebd2365a7ae83e236fb699e98c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl |
|---|---|
| Size | 897.3 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
91524e50345d273c21c99e093e65189804dedcd2ca0e3544e61cbad635edd819
|
|
BLAKE2b-256 checksum How to use checksums |
03223f578c181ae38c2bc88bd3a38447954985f8c6bba262276dd470007dc652
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 881.9 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
ba9cb65de30cb679d35848143ae3973d4df894d90bbc92cddce942e644404bf3
|
|
BLAKE2b-256 checksum How to use checksums |
628b9a2992e64ba12c6ed4e356d136470d666139c76f6960256279c5d0af9ed4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl |
|---|---|
| Size | 967.3 kB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
0d859fa78b056c64e11c38407a4e1240c2b691655d3386f30b6b92adf74d6e2e
|
|
BLAKE2b-256 checksum How to use checksums |
2ac51882a9898c749dca550f44709747cd8d005e8bab71722908b500716a6186
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 808.1 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5a04d8125b6f4fec99e8486b530beb0afe7caac1eda9d1671a1b6d5745a159a4
|
|
BLAKE2b-256 checksum How to use checksums |
1ab61852b5c7231426676d2cfa20ce6ec5e4c5deebb266a532813b88c784a277
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pylibmql-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | pylibmql-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 835.5 kB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
dbf6f8d1519077239a8034a57bb5ac427e54baa9ed7db4057fda0d614bcae642
|
|
BLAKE2b-256 checksum How to use checksums |
1b13ca59285b6bee3a8c417b722d0f2da21c5ffdcfd5ea46421366dcfe5fd86f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Security for pylibmql 0.3.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.