Skip to main content

Fast, safe, loud expression evaluation — a Pythonic skin over the Go expr-lang core.

Project description

enchanter-golem

Fast, safe, loud expression evaluation for Python — a thin Pythonic skin over a compiled Go core (expr-lang/expr). Evaluate expressions like 2 + 3 * (x - 1) against named variables; a typo'd variable is a compile error, not a silent 0.

import golem

e = golem.Engine(variables={"x": 0.0})
print(e.eval("2 + 3 * (x - 1)", {"x": 5}))   # => 14

Install

pip install enchanter-golem        # the import is `import golem`

Prebuilt wheels embed the compiled Go core, so there is no Go toolchain and no C compiler to install. Evaluation runs in Go; Python is just the interface.

Why

  • Loud — an undeclared or typo'd variable fails at compile time with a "did you mean" hint, instead of silently becoming 0.
  • Safe — a sandboxed function/math allowlist, cost + timeout guards, and no silent NaN/Inf.
  • One source of truth — the same Go core powers the Go API, so Python and Go agree.

Full documentation, the Go API, and the architecture diagrams live in the project README: https://github.com/enchanter-ai/golem

MIT © Enchanter Labs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

enchanter_golem-0.1.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

enchanter_golem-0.1.0-cp313-cp313-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.13Windows x86-64

enchanter_golem-0.1.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

enchanter_golem-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

enchanter_golem-0.1.0-cp312-cp312-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.12Windows x86-64

enchanter_golem-0.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

enchanter_golem-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

enchanter_golem-0.1.0-cp311-cp311-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.11Windows x86-64

enchanter_golem-0.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

enchanter_golem-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file enchanter_golem-0.1.0.tar.gz.

File metadata

  • Download URL: enchanter_golem-0.1.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for enchanter_golem-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4e8358890bff9d2f1ccc98223c19f3d0aee74c894956b03b9d41b59270225c81
MD5 f0bd6e09a9efdefd6d4ba687ebf72261
BLAKE2b-256 1cdc3db912366c2368df1b008809d4e3fdc58e2134c3d399c084b1078f857e06

See more details on using hashes here.

Provenance

The following attestation bundles were made for enchanter_golem-0.1.0.tar.gz:

Publisher: release.yml on enchanter-ai/golem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enchanter_golem-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for enchanter_golem-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a0e6a7bf7db4242e9e9646977157bbf6ced09d5a6f465cf27d9ed2beedcd9037
MD5 f64da7be745aa15cf73f1169fe625510
BLAKE2b-256 2defc3c7c0aa3bfe3efbf480d54fd2e495d79085cf769caf2f85de1a679fddeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for enchanter_golem-0.1.0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on enchanter-ai/golem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enchanter_golem-0.1.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for enchanter_golem-0.1.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 19aa139c7a10b9ac81605103ef3f3c1f089eef706aa77b18d132ec874463cef8
MD5 499ec6252d6601ce4b6dcd4f609304fc
BLAKE2b-256 5e2e77c1cf5e6758a2d7a0599063429233ea3682be35355ecaa7d4df3d97977a

See more details on using hashes here.

Provenance

The following attestation bundles were made for enchanter_golem-0.1.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: release.yml on enchanter-ai/golem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enchanter_golem-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for enchanter_golem-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d3f32c2e08772c3ea96320f15e55f8ccaad7771654b76778a925bf745bd7439
MD5 3df8fb61387ec85f7800cce69bd961a1
BLAKE2b-256 8908a6061ddeae8aed438d32c5bcb45511739739fd6236ae78d1436313cab82c

See more details on using hashes here.

Provenance

The following attestation bundles were made for enchanter_golem-0.1.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on enchanter-ai/golem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enchanter_golem-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for enchanter_golem-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 95b6983d9b40262a85ef648e0b2d121913dbd639e712a629358630cb6356af47
MD5 122b7c6837e3758c5c7d7491345dfba4
BLAKE2b-256 7f92892419dfdb57edc0b999245295f50f5217e70d652af9b94308d8260944f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for enchanter_golem-0.1.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on enchanter-ai/golem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enchanter_golem-0.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for enchanter_golem-0.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 35750bd749be4cb8ce2dcc45074717a0249f24686c14a42338ecac3cb2047ce9
MD5 189f5c9da4865cc29b922ac2e2efcce8
BLAKE2b-256 b118b7bccc2943402cf0912f6d888725f2a554265d61b485e2991df7173841b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for enchanter_golem-0.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: release.yml on enchanter-ai/golem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enchanter_golem-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for enchanter_golem-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c2d7f3875ef9abd4d069423736d87b32db06cb9555cec82f08a3ccd38af86ba3
MD5 9c34793ebd9634c2d61caed9ab909e46
BLAKE2b-256 b2d54c35be9698a2f0a77a6733f13024774a7287112f9f56a3c9f67a533890ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for enchanter_golem-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on enchanter-ai/golem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enchanter_golem-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for enchanter_golem-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 53e22bc3dd6c42cc423df36998786f91ae969ef12549b70260ff21da487a0420
MD5 00a1c85df8747a358673b08dd209f06c
BLAKE2b-256 e5537d4fd0bafe2b64635e8942d2cf7a4414ee18ae15d5f6095b4d48d6ab7569

See more details on using hashes here.

Provenance

The following attestation bundles were made for enchanter_golem-0.1.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on enchanter-ai/golem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enchanter_golem-0.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for enchanter_golem-0.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 15fce78697e26da696bde4f74e1ebfa0b8adef035b7d5c200b721cc3ab35940a
MD5 f86769932361e1d0c07da1ef7b896568
BLAKE2b-256 ec33936e3fa8d8e9d2fce8e95941cc2ac1038a0e632870f64a0afa3d85fe49e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for enchanter_golem-0.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: release.yml on enchanter-ai/golem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enchanter_golem-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for enchanter_golem-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a1f6e2342d3de2970a0a1d032ff42afc41290b3810d7a919f059921ff87aa34
MD5 f4e0472cea120ce1cf11608179625eac
BLAKE2b-256 ce608651f2e963fe9bf1c2bba9dcac8eb4ff56891c08ec8b82423fb89087a233

See more details on using hashes here.

Provenance

The following attestation bundles were made for enchanter_golem-0.1.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on enchanter-ai/golem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page