PythonCall.jl
PythonCall.jl copied to clipboard
convenient julia->python conversion of structured data
Hello! Thanks for PythonCall/juliacall :)
Currently, passing e.g. {"s": 2, "t": 3}
to Julia will result in a PyDict{Py, Py}
. It would be great to have a way to convert such structured data with "simple" python elements into native types (in this case Dict{String, Int}
).
The pyconvertnative()
idea from #172 seems like it could handle this case?
Indeed, there is no such thing implemented, but I'd happily take a PR for it.
My current hack is to do python->JSON->julia, which handles the "nested dict of simple types" case pretty well, but is clearly not optimal :)