Skip to main content

Rossum Transaction Scripts

The Rossum platform for automating document-based business transactions can evaluate snippets of Python code that can manipulate such transactions: Transaction Scripts (or TxScripts). The principal use of these TxScript snippets is to automatically fill in computed values of formula type fields. The code can be also evaluated in serverless function based extensions.

This is a user-friendly Python "extended runtime" that allows for code snippets in the Rossum platform (formula fields or serverless functions) that are very short, easy to read and follow, and easy to write (possibly in a recipe-like way for non-programmers, or by LLMs with low risk of mistakes).

See Rossum Transaction Scripts in Rossum API Docs for reference documentation.

Python 3.8

Note that the module code must be compatible with Python 3.8, since that's the serverless runtime. This mainly means that | None and type[...] constructs are not available.

Benchmarking

curl -H "Authorization: Bearer ..." -H "Content-Type: application/json" -XPOST "https://...rossum.app/api/v1/hooks/.../generate_payload" -d '{"annotation":"https://...rossum.app/api/v1/annotations/...", "event":"annotation_content", "action":"initialize", "status": "to_review"}' >payload.json
time ./benchmark.py payload.json

This is also an easy way to run txscript locally e.g. for debugging purposes.

Fields data model

We have three levels of data:

  • attrs stored in FlatData._content dict indexed by schema_id.
  • Field (and descendants) instances that provide a typed interface to attrs as well as the logic to work with complex data types and generating values and tracking updates.
  • FieldValueBase (and descendants) instances that provide the user-facing interface to Field objects and emulate native Python types backed ultimately by attrs content.

User changes are tracked as such:

  • When changing fields, the field is added to the Fields._updates journal, together with the information about which attributes changed. The field's .attrs itself (also stored in the FlatData) is updated with the new value. Removed fields are removed from all_objects.
  • Newly added fields can be identified by the missing id attribute.

Publishing updates to PyPI

In the txscript package root directory, run:

pip install build twine
python3 -m build

Next, inspect the dist/txscript*.tar.gz tarball of source distribution to make sure it looks sane and doesn't contain any surprising extra files.

Finally, run:

python3 -m twine upload dist/*

Download files

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

Source Distribution

txscript-1.2.0.tar.gz (50.2 kB view details)

Uploaded Source

Built Distribution

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

txscript-1.2.0-py3-none-any.whl (55.8 kB view details)

Uploaded Python 3

File details

Details for the file txscript-1.2.0.tar.gz.

File metadata

  • Download URL: txscript-1.2.0.tar.gz
  • Upload date:
  • Size: 50.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for txscript-1.2.0.tar.gz
Algorithm Hash digest
SHA256 df23141a594af88ff12f8e2aa6f06781df9786d82f342a6a515db34c02782b99
MD5 641277053da6d641fe6b98652fac5216
BLAKE2b-256 3db0cecd002d2762e9cdd421c5fcb1972083f0c7ea69eeefa9b449bdc373049c

See more details on using hashes here.

File details

Details for the file txscript-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: txscript-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 55.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for txscript-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aca438dcdd17255e6fd6ce02d3ec775957cad1da0d22e5bc47ace31d0397a0c7
MD5 5ce7e8eb071babc5af6f497b806ec56b
BLAKE2b-256 0577f879d1d9af408f85ece2e40bd9c1a850e13066ed2a2046c43815a4d6d47b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 files

1.1.0

2 files

1.0.1

2 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