Get dataset url and version from python API

Hello,
I have a repo that had “dvc import --rev xxx” multiple datasets from a data registry repo, as recommended in the dvc documentation. From inside that first repo (the one that did the imports) I want to know with python code the list of dataset urls and revisions. One way of doing it that I can think of is to search for all .dvc files, parse them and extract the “deps/repo/url”, “deps/repo/rev” and “deps/repo/rev_lock” fields. I’m just wondering if there is a cleaner way to do that, maybe the information can be retrieved using the DVC python API in some way ???
Thanks
Edouard