Visidata: method visidata.view(obj) is not existing, moved to visidata.pyobj.view

Created on 15 Oct 2020  路  2Comments  路  Source: saulpw/visidata

Small description
Web blog writes on https://www.visidata.org/blog/2020/ten/
that i can view python object by:
```py
visidata.view(obj)


**Expected result**
I expect examples from main webpage and from videos on youtube to be working :) 
I exped the view method to be there.

**workaround**

After minute of source diving I found that I can do this:

```py
visidata.pyobj.view(my_object)

I know 2.0 is big change. Maybe its not a bug, but a feature.
But in that case, web should be improved with examples that work with current version.

bug fixed

Most helpful comment

Yes, I had forgotten to expose visidata.view. I have now made that change on develop, and visidata.view will be part of the next release. I am going to adjust the blogpost so it works with the current version.

Thanks for bringing this to my attention!

All 2 comments

While the underlying API might have changed, I believe the short form is just neat.

>>> visidata.view(obj)

Maybe we can just bring back the view function by importing it into the main module namespace? That would also save us from updating the documentation.

Currently, the output is:

>>> import visidata
>>> visidata.view("foobar")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'visidata.aggregators' has no attribute 'view'

Yes, I had forgotten to expose visidata.view. I have now made that change on develop, and visidata.view will be part of the next release. I am going to adjust the blogpost so it works with the current version.

Thanks for bringing this to my attention!

Was this page helpful?
0 / 5 - 0 ratings