Stream: python

Topic: โœ” pyDataverse missing attribute in NativeAPI


view this post on Zulip Sherry Lake (Oct 17 2024 at 16:22):

I am trying to execute:
api.dataverse_tree_walker(tree, dv_keys = ['dataverse_id','dataverse_alias'], ds_keys = ['dataset_id','pid'])

But am getting the error:

AttributeError: 'NativeApi' object has no attribute 'dataverse_tree_walker'

I have upgraded and installed V 0.3.4 pyDataverse

Name: pyDataverse
Version: 0.3.4

Have imported NativeAPI:

dir()

['DataAccessApi', 'Dataset', 'NativeApi', '__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'api', 'data_api', 'read_file', 'resp', 'tree']

I have confirmed "tree_walker" is not in "NativeApi". Am I missing a import?

view this post on Zulip Philip Durbin ๐Ÿš€ (Oct 17 2024 at 19:33):

In a test I see from pyDataverse.utils import read_json, dataverse_tree_walker so I guess it's in utils.

view this post on Zulip Sherry Lake (Oct 17 2024 at 20:03):

Thanks. I saw something about "utils", but I was trying to import "utils" from pyDataverse.api adding "utils" to this line - didn't work.

from pyDataverse.api import NativeApi, DataAccessApi, utils

I don't think the pyDataverse.utils is explained. But now I know what to look for. It's working for me.

:dataverse_man:

view this post on Zulip Notification Bot (Oct 17 2024 at 20:04):

Sherry Lake has marked this topic as resolved.


Last updated: Nov 01 2025 at 14:11 UTC