We've released Exevalator (a compact expression-evaluation library) v2.3.0!
We also shipped a small update recently, but that one focused on Japanese error messages and minor fixes/adjustments.
This time, as the minor version bump from 2.2 → 2.3 suggests, it's our first major update in about a year.
So what changed in a big way?
hat brings Exevalator's language lineup to seven: Java / Rust / C++ / C# / VB.NET / TypeScript, and now Python.
Below, we'll walk through using Exevalator from Python right away.
As always, let's briefly revisit what Exevalator actually is.
Exevalator parses and evaluates math expressions given as strings like:
You'll often need this in app development. A classic case is a "type the whole formula" scientific calculator: the user's input is captured as text, which the app must parse and evaluate.
In fact, the recently released online version of our scientific calculator RINPn uses the TypeScript implementation of Exevalator to evaluate entered expressions: Oct 22, 2025 — Inside the Architecture of RINPn Online
Exevalator prioritizes simplicity and ease of use.
Notably, it's a single-file library — everything fits in one file that you can drop into your project's source tree.
It's released under public-domain-equivalent licenses (Unlicense / CC0, selectable). That means you can use it in any project — commercial or non-commercial, open-source or proprietary — without fuss.
As mentioned above, Exevalator's compact design makes it easy to port. It currently supports:
We plan to add more language bindings over time, including Go.
We expect the next major release to prioritize MCP support, with Go likely to follow in a subsequent release.
Here's the main news: starting with this release, Exevalator can now be used from Python.
Below are the details.
You probably don't need an introduction — Python is a hugely popular, interpreted programming language.
While it has long been used for data analysis, in recent years its presence has exploded in AI-related work. In research and prototyping especially, it's fair to say Python has become a dominant force.
Python includes a built-in `eval` function that evaluates expressions provided as strings — no external library required:
However, `eval` can do far more than simple arithmetic. In practice, it can execute almost anything you could write directly in Python, which is very powerful — but also potentially dangerous.
If you are the one entering the expression, that might be acceptable.
But if the expression comes from a third party you can't fully trust, it can be risky. In the worst case, malicious input could overwrite important files, read secrets from environment variables, and so on. That's scary.
Unlike languages used primarily to power public websites, Python is often run under the user's own control (local scripts, notebooks, etc.). So today, "evaluate unknown expressions from others" may not feel like a common Python scenario.
But this may change.
AI systems have advanced rapidly, and AI agents can now proactively use tools and perform tasks semi-autonomously.
This implies a near-future where humans build tools for AI to use, connect them to agents, and then let the AI run workflows end-to-end. Many such AI-consumable tools will likely be built in Python.
Those tools will need to process inputs not from the end user directly, but from the AI acting on their behalf.
And since AIs can be very assertive and fast-moving, you may not want to grant full, unrestricted execution privileges (arbitrary scripts/commands) for every step — it's easy to imagine things going off the rails.
In short, you can readily imagine steps where string expressions must be evaluated, but you don't want to pass them to Python's built-in `eval`.
That's where the newly added Python version of Exevalator comes in as a safer drop-in alternative.
Instead of calling Python's `eval`, you can evaluate expressions with Exevalator like this:
If the input contains anything other than math expression evaluation, it fails with an error — no execution beyond math expressions.
You can of course use variables and functions, but only those registered beforehand are available. That means no calls into system-affecting operations and no access to sensitive data you haven't explicitly exposed.
So even in Python — despite having a built-in `eval` — there are plenty of scenarios where using Exevalator is preferable, and for AI tool development this may become quite important.
Let's actually download and use the Python version of Exevalator.
As a prerequisite, have a working Python 3.10+ environment on your PC. That's all you need.
First, visit the Exevalator repository on GitHub:
Near the upper-right of the page, click the green "Code" button and choose "Download ZIP." You'll get a file like:
Extract (unzip) this ZIP file.
If you prefer `git`, you can clone the repository instead:
Inside the downloaded package, open the `python` directory and locate:
Copy this file into your project's source folder, in the same directory as the .py file where you want to evaluate expressions.
That's it for setup. Let's call it from Python.
Create a new `.py` file in the same folder as `exevalator.py` and add:
Run it with `python` and you should see:
It's working!
You'll also find several sample scripts (`example*.py`) in the downloaded package — take a look to get a feel for the available features. The Python README will also be helpful.
-
That's all for today's announcement.
We'll continue sharing updates about Exevalator here. Stay tuned!