Skip to content

convenient julia->python conversion of structured data #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amilsted opened this issue Jul 14, 2022 · 2 comments
Closed

convenient julia->python conversion of structured data #200

amilsted opened this issue Jul 14, 2022 · 2 comments

Comments

@amilsted
Copy link

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?

@cjdoris
Copy link
Collaborator

cjdoris commented Jul 19, 2022

Indeed, there is no such thing implemented, but I'd happily take a PR for it.

@amilsted
Copy link
Author

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

@cjdoris cjdoris closed this as completed Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants