Zserio PyPi package contains Zserio compiler and Zserio Python runtime. Zserio is serialization framework
available at [GitHub](http://zserio.org).
## Installation
To install Zserio compiler together with Zserio Python runtime, just run
```
pip install zserio
```
## Usage from command line
Consider the following zserio schema which is stored to the source `appl.zs`:
```
package appl;
struct TestStructure
{
int32 value;
};
```
To compile the schema by compiler and generate Python sources to the directory `gen`, you can run Zserio
compiler directly from command line by the following command:
```
zserio appl.zs -python gen
```
Then, if you run the python by the command
```
PYTHONPATH="gen" python
```
you will be able to use the generated Python sources by the following python commands
```py
import appl.api as api
test_structure = api.TestStructure()
```
## Usage from Python
Consider the following zserio schema which is stored to the source `appl.zs`:
```
package appl;
struct TestStructure
{
int32 value;
};
```
To compile the schema by compiler and generate Python sources to the directory `gen`, you can run the
following python commands:
```py
import zserio
api = zserio.generate("appl.zs", gen_dir = "gen")
test_structure = api.TestStructure()
```
For convenience, the method `generate` returns imported API for generated top level package.
Alternatively, you can run zserio compiler directly by the following python commands:
```py
import sys
import importlib
import zserio
completed_process = zserio.run_compiler(["appl.zs", "-python", "gen"])
if completed_process.returncode == 0:
sys.path.append("gen")
api = importlib.import_module("appl.api")
test_structure = api.TestStructure()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ndsev/zserio-pypi",
"name": "zserio",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Navigation Data Standard e.V.",
"author_email": "support@nds-association.org",
"download_url": "https://files.pythonhosted.org/packages/9c/8f/0671e936ee13564565ad6b2f6e225d152899fa1f4e6a0956a3b3eeef2f42/zserio-2.17.0.tar.gz",
"platform": null,
"description": "Zserio PyPi package contains Zserio compiler and Zserio Python runtime. Zserio is serialization framework\navailable at [GitHub](http://zserio.org).\n\n## Installation\n\nTo install Zserio compiler together with Zserio Python runtime, just run\n\n```\npip install zserio\n```\n\n## Usage from command line\n\nConsider the following zserio schema which is stored to the source `appl.zs`:\n\n```\npackage appl;\n\nstruct TestStructure\n{\n int32 value;\n};\n```\n\nTo compile the schema by compiler and generate Python sources to the directory `gen`, you can run Zserio\ncompiler directly from command line by the following command:\n\n```\nzserio appl.zs -python gen\n```\n\nThen, if you run the python by the command\n\n```\nPYTHONPATH=\"gen\" python\n```\n\nyou will be able to use the generated Python sources by the following python commands\n\n```py\nimport appl.api as api\ntest_structure = api.TestStructure()\n```\n\n## Usage from Python\n\nConsider the following zserio schema which is stored to the source `appl.zs`:\n\n```\npackage appl;\n\nstruct TestStructure\n{\n int32 value;\n};\n```\n\nTo compile the schema by compiler and generate Python sources to the directory `gen`, you can run the\nfollowing python commands:\n\n```py\nimport zserio\napi = zserio.generate(\"appl.zs\", gen_dir = \"gen\")\ntest_structure = api.TestStructure()\n```\n\nFor convenience, the method `generate` returns imported API for generated top level package.\n\nAlternatively, you can run zserio compiler directly by the following python commands:\n\n```py\nimport sys\nimport importlib\nimport zserio\ncompleted_process = zserio.run_compiler([\"appl.zs\", \"-python\", \"gen\"])\nif completed_process.returncode == 0:\n sys.path.append(\"gen\")\n api = importlib.import_module(\"appl.api\")\n test_structure = api.TestStructure()\n```\n",
"bugtrack_url": null,
"license": "BSD-3 Clause",
"summary": "Zserio runtime with compiler.",
"version": "2.17.0",
"project_urls": {
"Homepage": "https://github.com/ndsev/zserio-pypi"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1c952157685d7ca35c741c7bfbbe36ca7d69696c293d12a8781c9a3a39a29323",
"md5": "5397ebeedaf5579552f67551dc82a0e3",
"sha256": "62d22933cec3c3b77242a276edb72104ffcf3764b9b71c541af54724982e44b5"
},
"downloads": -1,
"filename": "zserio-2.17.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5397ebeedaf5579552f67551dc82a0e3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4731710,
"upload_time": "2025-07-24T12:38:16",
"upload_time_iso_8601": "2025-07-24T12:38:16.596576Z",
"url": "https://files.pythonhosted.org/packages/1c/95/2157685d7ca35c741c7bfbbe36ca7d69696c293d12a8781c9a3a39a29323/zserio-2.17.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9c8f0671e936ee13564565ad6b2f6e225d152899fa1f4e6a0956a3b3eeef2f42",
"md5": "e1200150b393d2a6590812abd17d5cae",
"sha256": "dce454f4ed890be92fc67015a09c8323660b52a55736014be58ae9f22047908e"
},
"downloads": -1,
"filename": "zserio-2.17.0.tar.gz",
"has_sig": false,
"md5_digest": "e1200150b393d2a6590812abd17d5cae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 7947,
"upload_time": "2025-07-24T12:38:18",
"upload_time_iso_8601": "2025-07-24T12:38:18.213481Z",
"url": "https://files.pythonhosted.org/packages/9c/8f/0671e936ee13564565ad6b2f6e225d152899fa1f4e6a0956a3b3eeef2f42/zserio-2.17.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-24 12:38:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ndsev",
"github_project": "zserio-pypi",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "zserio"
}