Skip to main content

Ratus

Documentation Status CircleCI PyPI

Ratus is a simple expression language that can be used to easily extend Python applications with an embedded expression language. Evaluating basic expressions is as simple as:

from ratus import Evaluator

evaluator = Evaluator()
evaluator.evaluate("1 + 1") # => 1
evaluator.evaluate("1 > 1") # => False
evaluator.evaluate("if(1 < 2, 10, 5)") #  => 5

For more information, please check out the docs

What's in a name?

When I first started this project I did a bit of research around parsing techniques as this is really the most complex part. One idea that that really stuck out to me was packrat parsing. This technique allows for linear time parsing, as opposed to the usual exponential time of backtracking parsing.

Currently packrat parsing isn't implemented for ratus but I'm working on it!

Roadmap

v1.0.0

  • Fully document all features
    • API
    • Grammar
  • Fix known bugs
    • Don't require functions to be the root of an expression
      • e.g. pow(2, 2) + 1 should be allowed

Release files for ratus 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ratus 0.0.3
File Size Uploaded
ratus-0.0.3.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ratus 0.0.3
File Interpreter ABI Platform
ratus-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / ratus-0.0.3.tar.gz

Download URL ratus-0.0.3.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
86defd88bbe5c65a8f6d941dba8cbe4f41ffd1f2dc770e746c0e323b6fa3bf6a
BLAKE2b-256 checksum
How to use checksums
628cd4719d2bd22198f7354a83d7b2a1ea08508f49438b7284edd21fd0431cc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

Release files / ratus-0.0.3-py3-none-any.whl

Download URL ratus-0.0.3-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c076c96612b48400217c4a419bd8690d76eee1f8c84a4951a8c95aa983147ca9
BLAKE2b-256 checksum
How to use checksums
70736946f21e1a8f4f5fcd8b11bc22248a4652b9a5954b8c2bb7017b86378c49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page