Name | txscript JSON |
Version |
1.0.1
JSON |
| download |
home_page | None |
Summary | Transaction scripts for manipulating business transactions and documents in Rossum platform |
upload_time | 2024-10-16 23:06:30 |
maintainer | None |
docs_url | None |
author | None |
requires_python | ~=3.8 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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).
See `https://elis.rossum.ai/api/docs/#rossum-transaction-scripts`
for reference documentation.
## How it looks like in practice
Various examples are part of the test suite.
You can execute the runtime locally on a sample annotation by running
the `standalone.py` script.
## 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" "https://us.api.rossum.ai/v1/annotations/5565949/content" >examples/standalone/annotation-5565949.json
curl -H "Authorization: Bearer ..." -H "Content-Type: application/json" https://us.api.rossum.ai/v1/schemas/1488014 >examples/standalone/schema-1488014.json
time ./benchmark.py examples/standalone/annotation-5565949.json examples/standalone/schema-1448014.json
```
## 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 datapoints, the datapoint is added to the `Fields._updates`
backlog, together with the information about which attributes changed.
The datapoint itself (that's also stored in the `Fields._content` dict)
is updated with the new value. Removed datapoints are removed from
`all_objects`.
* Newly added datapoints 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/*
```
Raw data
{
"_id": null,
"home_page": null,
"name": "txscript",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Petr Baudis <petr.baudis@rossum.ai>",
"download_url": "https://files.pythonhosted.org/packages/0e/65/57b10b29cc12e5b6509aed26f3962c8d516eb5737a17249e1f742cfe90f1/txscript-1.0.1.tar.gz",
"platform": null,
"description": "# Rossum Transaction Scripts\n\nThe Rossum platform for automating document-based business transactions can\nevaluate snippets of Python code that can manipulate such transactions:\nTransaction Scripts (or TxScripts). The principal use of these TxScript\nsnippets is to automatically fill in computed values of formula type fields.\nThe code can be also evaluated in serverless function based extensions.\n\nThis is a user-friendly Python \"extended runtime\" that allows for code snippets\nin the Rossum platform (formula fields or serverless functions) that are very\nshort, easy to read and follow, and easy to write (possibly in a recipe-like\nway for non-programmers).\n\nSee `https://elis.rossum.ai/api/docs/#rossum-transaction-scripts`\nfor reference documentation.\n\n## How it looks like in practice\n\nVarious examples are part of the test suite.\n\nYou can execute the runtime locally on a sample annotation by running\nthe `standalone.py` script.\n\n## Python 3.8\n\nNote that the module code must be compatible with Python 3.8, since that's\nthe serverless runtime. This mainly means that `| None` and `type[...]`\nconstructs are not available.\n\n## Benchmarking\n\n```\ncurl -H \"Authorization: Bearer ...\" -H \"Content-Type: application/json\" \"https://us.api.rossum.ai/v1/annotations/5565949/content\" >examples/standalone/annotation-5565949.json\ncurl -H \"Authorization: Bearer ...\" -H \"Content-Type: application/json\" https://us.api.rossum.ai/v1/schemas/1488014 >examples/standalone/schema-1488014.json\ntime ./benchmark.py examples/standalone/annotation-5565949.json examples/standalone/schema-1448014.json\n```\n\n## Fields data model\n\nWe have three levels of data:\n* `attrs` stored in `FlatData._content` dict indexed by `schema_id`.\n* `Field` (and descendants) instances that provide a typed interface\n to attrs as well as the logic to work with complex data types and\n generating values and tracking updates.\n* `FieldValueBase` (and descendants) instances that provide the\n user-facing interface to Field objects and emulate native Python\n types backed ultimately by attrs content.\n\nUser changes are tracked as such:\n* When changing datapoints, the datapoint is added to the `Fields._updates`\n backlog, together with the information about which attributes changed.\n The datapoint itself (that's also stored in the `Fields._content` dict)\n is updated with the new value. Removed datapoints are removed from\n `all_objects`.\n* Newly added datapoints can be identified by the missing `id` attribute.\n\n## Publishing updates to PyPI\n\nIn the txscript package root directory, run:\n\n```\npip install build twine\npython3 -m build\n```\n\nNext, inspect the `dist/txscript*.tar.gz` tarball of source distribution\nto make sure it looks sane and doesn't contain any surprising extra files.\n\nFinally, run:\n\n```\npython3 -m twine upload dist/*\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Transaction scripts for manipulating business transactions and documents in Rossum platform",
"version": "1.0.1",
"project_urls": {
"Documentation": "https://elis.rossum.ai/api/docs/#rossum-transaction-scripts"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e1812e9827d082f10d272109f4d8ed28ed68f829f22700006f165df6bebb5950",
"md5": "9ee75e01d8b739fff58d9c8cf15a915b",
"sha256": "f8bf68216490d6b8f9e3173f43b35d02a5d7d9f1fd24f75472ec8b75fe4476f9"
},
"downloads": -1,
"filename": "txscript-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9ee75e01d8b739fff58d9c8cf15a915b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 32477,
"upload_time": "2024-10-16T23:06:28",
"upload_time_iso_8601": "2024-10-16T23:06:28.791158Z",
"url": "https://files.pythonhosted.org/packages/e1/81/2e9827d082f10d272109f4d8ed28ed68f829f22700006f165df6bebb5950/txscript-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0e6557b10b29cc12e5b6509aed26f3962c8d516eb5737a17249e1f742cfe90f1",
"md5": "3fd2410da1ccca31aff737d352b6ca33",
"sha256": "a8ca374503ad91b6d37753c4d0532b459389411a4b12633d46e248be8d6acecc"
},
"downloads": -1,
"filename": "txscript-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "3fd2410da1ccca31aff737d352b6ca33",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 30953,
"upload_time": "2024-10-16T23:06:30",
"upload_time_iso_8601": "2024-10-16T23:06:30.494247Z",
"url": "https://files.pythonhosted.org/packages/0e/65/57b10b29cc12e5b6509aed26f3962c8d516eb5737a17249e1f742cfe90f1/txscript-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-16 23:06:30",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "txscript"
}