Skip to main content

Zserio PyPi package contains Zserio compiler and Zserio Python runtime. Zserio is serialization framework available at GitHub.

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

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:

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:

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()

Download files

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

Source Distribution

zserio-2.18.2.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

zserio-2.18.2-py3-none-any.whl (4.7 MB view details)

Uploaded Python 3

File details

Details for the file zserio-2.18.2.tar.gz.

File metadata

  • Download URL: zserio-2.18.2.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for zserio-2.18.2.tar.gz
Algorithm Hash digest
SHA256 f7641f9967474f121bb07bb0af0ce6dde273ca0e9626512d1a50e8d95bb329db
MD5 d8d2a6f3cdab9ce0688ca9827cb906f7
BLAKE2b-256 8f1d7ca374631f63b1455b292171180bd701d479c01de720c914e530e77e72ef

See more details on using hashes here.

File details

Details for the file zserio-2.18.2-py3-none-any.whl.

File metadata

  • Download URL: zserio-2.18.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for zserio-2.18.2-py3-none-any.whl
Algorithm Hash digest
SHA256 98a857fddcebbd1508d838b1cbf3b07cccbd140818b7d585ee0d66bf470a02b2
MD5 0ef90ae9329ef94441a44fa74d071447
BLAKE2b-256 97d45c8881070469146dee0917881c8e0ba3a8fadc822a0d5818e5ae4adbc3d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page