Skip to main content

Pygritia: Lazy Symbolic Evaluation

Project description

Pygritia

Pygritia is a symbolic expression library.

It can

  • create symbolic expressions with one or more symbols
  • resolve symbolic expressions by substituting values to symbols
  • partially resolve symbolic expression

Example:

from pygritia import symbol, evaluate, update

this = symbol('this')
that = symbol('that')
arr = [1, 2, 3]
print(5 / this + 2 * 6)  # 5 / this + 12
print(evaluate(5 / this + 2 * 6, this=2))  # 14.5
print(evaluate(this[that], this=arr)) # [1, 2, 3][that]
update(this[that], 42, this=arr, that=1)
print(arr)  # [1, 42, 3]

Documentation of all public functions can be found in pygritia

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

pygritia-0.2.0.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

pygritia-0.2.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file pygritia-0.2.0.tar.gz.

File metadata

  • Download URL: pygritia-0.2.0.tar.gz
  • Upload date:
  • Size: 61.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pygritia-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9d27f2f2546ff2b58e929b6414cd1d97fc23f9182a3059da06f52f37716d6ec6
MD5 86d75096097436fe3c2c582fbbd2d52c
BLAKE2b-256 e41d1bf32acadbd95823d9e3ddd2002e4be6fecf8893d21b03be4c41b98ea8e9

See more details on using hashes here.

File details

Details for the file pygritia-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pygritia-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pygritia-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4126dd4e56b38963ec547c18ec9e5498478b3416fae2b987c2d47707489c7c6d
MD5 fc32b5413bbd6a45b1ea0ba6eb5507c7
BLAKE2b-256 82d3e4bdffe38a2947e07cb3d8cdd120ae123df17a077ae7874f367075e7aa42

See more details on using hashes here.

Supported by

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