haochengxia / vscode-pydata-viewer

Display PyData files (.npz .npy .pkl .pth) in VSCode.
https://marketplace.visualstudio.com/items?itemName=Percy.vscode-pydata-viewer
MIT License
14 stars 8 forks source link

Use pretty print when possible #3

Open JBrandonS opened 1 year ago

JBrandonS commented 1 year ago

A standard use case for data files is storing arrays and dicts of data. Currently this can lead to messy and confusing output. A simple method for cleaning up the output would be to attempt to case the data into a JSON and then use something like pprint to output the data in a more visually appealing method.

Thanks for the great extension.

haochengxia commented 1 year ago

That's a great idea and I agree that it may improve the users' experience. Thanks for your issue. This feature will be added in the next version as soon as possible.

aacmnv commented 1 year ago

I would also like to add that if a .pkl file contains a pandas dataframe it the extensions doesn't print the full dataframe. Maybe consider using a df.to_string() when the pkl file contains a dataframe.

I woulkd like to add this my self but I have no idea how to add or edit and extension in vscode

flolu commented 1 year ago

Pretty print would be hugely useful!

haochengxia commented 1 year ago

Would allowing users to specify a custom Python file to modify the output into their desired format be a useful feature? I would appreciate any suggestions or feedback on this. :blush:

aacmnv commented 1 year ago

Would allowing users to specify a custom Python file to modify the output into their desired format be a useful feature? I would appreciate any suggestions or feedback on this. 😊

I think that would be great! Very useful for me at least, and it would made it much more flexible for every type of user

haochengxia commented 1 year ago

Now, the custom script is supported from V0.0.10. Hope it can be helpful. An example here: image