Closed tpatki closed 2 years ago
For me it sounds more like an issue on how to define the python representation of json_t
structure than supporting something for python out of a c project.
I'm not familiar with ctypes, but if you can wrap a json_t
pointer somehow as an opaque object, then you should be able to call Jansson's functions on it. You don't need to know what's inside a json_t
, it's fully opaque even if you use it from C. All usage happens through Jansson's API functions.
We have a C library that uses jansson, and we are looking into creating a python wrapper for our C API using ctypes. One issue I'm running into is how to pass the
json_t
object around from python to the shared library in C. It would be useful to be able to call into thejson_object
orjson_dumps
Jansson calls from our python wrapper class, or have a translation between Python's native JSON and the jansson C library.Does this exist at all, and if not, is there a recommendation from your team on how to address this issue ?