Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zserio

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zserio

Zserio runtime with compiler.

  • 2.16.0
  • PyPI
  • Socket score

Maintainers
3

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc