Skip to main content

A minimalistic symbolic package.

Project description

symbolite: a minimalistic symbolic python package


Symbolite allows you to create symbolic mathematical expressions. Just create a symbol (or more) and operate with them as you will normally do in Python.

>>> from symbolite.symbol.abstract import Symbol
>>> x = Symbol("x")
>>> y = Symbol("y")
>>> expr1 = x + 3 * y
>>> print(expr1)
(x + (3 * y))

You can easily replace the symbols by the desired value.

>>> expr2 = expr1.subs_by_name(x=5, y=2)
>>> print(expr2)
(5 + (3 * 2))

The output is still a symbolic expression, which you can evaluate:

>>> expr2.eval()
11

Notice that we also got a warning (No libsymbol provided, defaulting to 'math'). This is because evaluating an expression requires a actual library implementation, name usually as libsl. The default one just uses python's math module.

You can avoid this warning by explicitely providing an libsl implementation.

>>> from symbolite.symbol import default
>>> expr2.eval(libsymbol=default)
11

You can also import it with the right name and it will be found

>>> from symbolite.symbol import default as libsymbol
>>> expr2.eval()
11

I guess you want to do some math now, right? 70 math functions are defined can be used through symbolite-scalar with implementations using the Python math module, numpy and scipy. Check it out!

Installing:

pip install -U symbolite

FAQ

Q: Is symbolite a replacement for SymPy?

A: No

Q: Does it aim to be a replacement for SymPy in the future?

A: No

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

symbolite-0.3.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

symbolite-0.3-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file symbolite-0.3.tar.gz.

File metadata

  • Download URL: symbolite-0.3.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for symbolite-0.3.tar.gz
Algorithm Hash digest
SHA256 666e9431a8099741fb43671d7e879b9dd832a404bc8fd3fe6a917b7c913c1ecc
MD5 536a3f62032a711581d5cd0eb61e937a
BLAKE2b-256 e30cc8953d417a05bd3d3d0d49a5c79d79ccfee214f139bd8657245c271a215c

See more details on using hashes here.

File details

Details for the file symbolite-0.3-py3-none-any.whl.

File metadata

  • Download URL: symbolite-0.3-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for symbolite-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 97d3c66333cc34cf78311cf45037af7c479175aad970314242ddc3c4dfa587c5
MD5 1eec834cd3593ab755f8541833e61c2e
BLAKE2b-256 7284d499f3956f8efdb189691bffc23c475e14abdd10a872ea919f78c8794b22

See more details on using hashes here.

Supported by

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