No project description provided
Project description
Dynamic-Expressions
A Python library for building, evaluating, and serializing expression trees.
Installation
pip install dynamic-expressions
With optional dependencies:
pip install dynamic-expressions[cache-redis,serialization-pydantic,serialization-msgspec]
Quick example
import asyncio
from dynamic_expressions.dispatcher import VisitorDispatcher
from dynamic_expressions.nodes import BinaryExpressionNode, LiteralNode
from dynamic_expressions.types import EmptyContext
from dynamic_expressions.visitors import BinaryExpressionVisitor, LiteralVisitor
dispatcher = VisitorDispatcher[EmptyContext](
visitors={
LiteralNode: LiteralVisitor(),
BinaryExpressionNode: BinaryExpressionVisitor(),
},
)
node = BinaryExpressionNode(
operator="+",
left=LiteralNode(value=1),
right=LiteralNode(value=2),
)
async def main() -> None:
result = await dispatcher.visit(node, None)
assert result == 3
asyncio.run(main())
See the getting started guide for more.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dynamic_expressions-0.2.3.tar.gz
(16.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dynamic_expressions-0.2.3.tar.gz.
File metadata
- Download URL: dynamic_expressions-0.2.3.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abc26ab7ff3571065af771dfe9df42bdc4dd322240b0da57fd20f4dabbd4ea7e
|
|
| MD5 |
c35e0026da423a85a1f4696e7366ca15
|
|
| BLAKE2b-256 |
8cf70071137215d9c181ebe38db247baa7340c7c02e4c1f4d7b3f6fec1bfb575
|
File details
Details for the file dynamic_expressions-0.2.3-py3-none-any.whl.
File metadata
- Download URL: dynamic_expressions-0.2.3-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ec567aea257a6cbb0e75e21e86f5f434ce2daf6711d735a3adc0dfb7ee67a8f
|
|
| MD5 |
f3ed4aa6c56dbf69d075a7fa9e455c29
|
|
| BLAKE2b-256 |
7538c089304ca6bbbe2b5c51adc4a847df00a938c1a4e1df7016a98ce44dd88c
|