zserio


Namezserio JSON
Version 2.16.0 PyPI version JSON
download
home_pagehttps://github.com/ndsev/zserio-pypi
SummaryZserio runtime with compiler.
upload_time2024-12-05 13:55:42
maintainerNone
docs_urlNone
authorNavigation Data Standard e.V.
requires_python>=3.8
licenseBSD-3 Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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/2a/5a/3c7aad6eef7e5294a55036549b4155c0b6e114fae0df05b849aeb5dc711e/zserio-2.16.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.16.0",
    "project_urls": {
        "Homepage": "https://github.com/ndsev/zserio-pypi"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "67a5ac2576849a47e749b3f3cab76fca63c3f8e73598efde877c997ef458e8d7",
                "md5": "4ceea50db99ccd34db63b817c698b6d9",
                "sha256": "d4a86261e4fab7cc942d49dd2526a6b1924ac89a14ceb360446032b64a1c77ff"
            },
            "downloads": -1,
            "filename": "zserio-2.16.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4ceea50db99ccd34db63b817c698b6d9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4728054,
            "upload_time": "2024-12-05T13:55:40",
            "upload_time_iso_8601": "2024-12-05T13:55:40.049049Z",
            "url": "https://files.pythonhosted.org/packages/67/a5/ac2576849a47e749b3f3cab76fca63c3f8e73598efde877c997ef458e8d7/zserio-2.16.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2a5a3c7aad6eef7e5294a55036549b4155c0b6e114fae0df05b849aeb5dc711e",
                "md5": "9cbff9784f03955817686dbce31fa6f0",
                "sha256": "892968e06b56b3631c9a2cb494383cd5dd0bcfb13f8910af25cb597057d52764"
            },
            "downloads": -1,
            "filename": "zserio-2.16.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9cbff9784f03955817686dbce31fa6f0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7865,
            "upload_time": "2024-12-05T13:55:42",
            "upload_time_iso_8601": "2024-12-05T13:55:42.186636Z",
            "url": "https://files.pythonhosted.org/packages/2a/5a/3c7aad6eef7e5294a55036549b4155c0b6e114fae0df05b849aeb5dc711e/zserio-2.16.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-05 13:55:42",
    "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"
}
        
Elapsed time: 1.07652s