pycapnp icon indicating copy to clipboard operation
pycapnp copied to clipboard

How to compile the capnp schema file to py?

Open Lemac opened this issue 4 years ago • 3 comments

I got a schema file in capnp language. But I don't know how to compile it to python file like what I did in C++.

Lemac avatar Oct 25 '21 07:10 Lemac

pycapnp uses import hooks to compile the .capnp files at runtime.

import capnp # Must be imported first to install the import hooks

import mycapnpfile_capnp # Import your capnp files, notice the _capnp, that corresponds to the .capnp file extension

Also see: https://github.com/capnproto/pycapnp/blob/master/examples/addressbook.py

haata avatar Oct 25 '21 07:10 haata

😲 cool

madhavajay avatar Jul 06 '22 03:07 madhavajay