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:
attrsstored inFlatData._contentdict indexed byschema_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._updatesjournal, 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 fromall_objects. - Newly added fields can be identified by the missing
idattribute.
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/*
Metadata
Release files for txscript 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| txscript-1.2.0.tar.gz | 50.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| txscript-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 106.0 kB
Release files / txscript-1.2.0.tar.gz
| Download URL | txscript-1.2.0.tar.gz |
|---|---|
| Size | 50.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df23141a594af88ff12f8e2aa6f06781df9786d82f342a6a515db34c02782b99
|
|
BLAKE2b-256 checksum How to use checksums |
3db0cecd002d2762e9cdd421c5fcb1972083f0c7ea69eeefa9b449bdc373049c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / txscript-1.2.0-py3-none-any.whl
| Download URL | txscript-1.2.0-py3-none-any.whl |
|---|---|
| Size | 55.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aca438dcdd17255e6fd6ce02d3ec775957cad1da0d22e5bc47ace31d0397a0c7
|
|
BLAKE2b-256 checksum How to use checksums |
0577f879d1d9af408f85ece2e40bd9c1a850e13066ed2a2046c43815a4d6d47b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|