promql-parser Python binding, a PromQL parser for Python.
pip install promql-parser
import promql_parser
ast = promql_parser.parse('prometheus_http_requests_total{code="200", job="prometheus"}')
print(ast)
This work is released under the MIT license. A copy of the license is provided in the LICENSE file.