Skip to main content

A sUTL implementation for python

Project description

# sUTL_py
sUTL Universal Transform Language for Python

This is a python implementation of sUTL. See the [sUTL spec]( here.

Import sUTL like this:

from sUTL_py import sUTL

Evaluate a transform like this:

transform = {
"&": "+",
"a": "^@",
"b": 5

source = 6

result = sUTL.evaluate(source, transform, {})

# here result is 11

To use library distributions, do the following:

1: Load the libraries. The following loads the core library.

coreString = urllib2.urlopen("").read()
distributions = [json.loads(coreString)]

2: Add your transform to a declaration

transform = {
"&": "map_core",
"list": "^@",
"t": {":": {
"&": "+",
"a": "^@.item",
"b": 1

declaration = {
"transform-t": transform,
"requires": ["map_core"]

3: Compile a set of libraries from the distribution

lib = sUTL.compilelib([declaration], distributions, false)

4: Evaluate your transform

source = [1, 2, 3, 4]

result = sUTL.evaluate(source, transform, lib)

# here result is [2, 3, 4, 5]

Project details

Download files

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

Files for sUTL, version 1.0.6
Filename, size File type Python version Upload date Hashes
Filename, size sUTL-1.0.6-py2.py3-none-any.whl (8.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size sUTL-1.0.6.tar.gz (7.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page