FlatBuffer binary message to JSON in python

842 views
Skip to first unread message

Ron Potashnik

unread,
May 30, 2021, 5:07:25 AM5/30/21
to FlatBuffers
Hi,

There is a way to convert the FlatBuffer binary message to JSON(in python) with FlatBuffer API(without de serialize it first)?

For example, something like this: ToJson(buffer)

Wouter van Oortmerssen

unread,
Jun 1, 2021, 12:00:37 PM6/1/21
to Ron Potashnik, FlatBuffers
There's currently no way to do that directly in Python. You'd have to invoke the flatc command-line tool, or if you want to do it in memory, you'd have to compile the C++ JSON conversion code into a Python C extension.

--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flatbuffers/1b20f0cd-51de-4ff1-848a-da23e038adf4n%40googlegroups.com.

mikkelfj

unread,
Jun 2, 2021, 1:55:26 AM6/2/21
to FlatBuffers
Or you could generate a C JSON parser with flatcc and use that in an extension.
Reply all
Reply to author
Forward
0 new messages