Skip to content
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

How to convert to a dict when needed? #37

Closed
pushshift opened this issue Jun 8, 2022 · 2 comments
Closed

How to convert to a dict when needed? #37

pushshift opened this issue Jun 8, 2022 · 2 comments

Comments

@pushshift
Copy link

What is the best way to convert to a dict? I tried dict(obj) and was able to get a dict but some keys are still things like <cysimdjson.cysimdjson.JSONArray object at 0x7f523a0ff090>

Would creating a method to recursively go through the fields and convert be the best method or is there a built-in method to convert a JSON with nested fields / arrays into a dict? I understand the sacrifice in speed but we would only be doing this with JSON objects that match a specific key value within the JSON.

Thanks so much for this amazing module! It is amazingly fast.

@TkTech
Copy link

TkTech commented Jun 8, 2022

You're looking for export().

@pushshift
Copy link
Author

Thank you sir!

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