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

Metadata

Release files for zserio 2.19.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zserio 2.19.0
File Size Uploaded
zserio-2.19.0.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zserio 2.19.0
File Interpreter ABI Platform
zserio-2.19.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.7 MB

Release files / zserio-2.19.0.tar.gz

Download URL zserio-2.19.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3b89321d6f85529fea0589387de084a768212436fb02db153baff078a88158ed
BLAKE2b-256 checksum
How to use checksums
2eb3dd0b89917bfba77c391f87644c28ac4bdf97cf3089796075cc97e7cdc830
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / zserio-2.19.0-py3-none-any.whl

Download URL zserio-2.19.0-py3-none-any.whl
Size 4.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
159d22ffc71ec8d7f61778ae1ce5462671b00535ea0882c0e678a054640d2c67
BLAKE2b-256 checksum
How to use checksums
c52f88f9c292621e33520dd86e37743db57a84b8538c988690454681b523c67a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page