diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml
index b09e865d..e38b44a8 100644
--- a/bindings/python/Cargo.toml
+++ b/bindings/python/Cargo.toml
@@ -11,6 +11,7 @@ crate-type = ["cdylib"]
[dependencies]
anyhow = { workspace = true }
+bumpalo = "3"
either = "1.13"
pyo3 = { version = "0.23", features = ["anyhow", "serde", "either"] }
pyo3-async-runtimes = { version = "0.23", features = ["tokio-runtime", "attributes"] }
diff --git a/bindings/python/src/expression.rs b/bindings/python/src/expression.rs
index 1e2f982a..2d32d013 100644
--- a/bindings/python/src/expression.rs
+++ b/bindings/python/src/expression.rs
@@ -1,10 +1,11 @@
use crate::variable::PyVariable;
use anyhow::{anyhow, Context};
use either::Either;
-use pyo3::types::PyDict;
+use pyo3::types::{PyAnyMethods, PyDict};
use pyo3::{pyclass, pyfunction, pymethods, Bound, IntoPyObjectExt, Py, PyAny, PyResult, Python};
use pythonize::depythonize;
use zen_expression::expression::{Standard, Unary};
+use zen_expression::validate::{validate_expression, validate_unary_expression, ValidationError};
use zen_expression::{Expression, Variable};
#[pyfunction]
@@ -97,3 +98,31 @@ impl PyExpression {
PyVariable(result).into_py_any(py)
}
}
+
+#[pyfunction]
+#[pyo3(name = "validate_expression")]
+pub fn py_validate_expression(py: Python, expression: String) -> PyResult