[QGIS-Developer] Enumerating QGIS data sources using python

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[QGIS-Developer] Enumerating QGIS data sources using python

Bo Victor Thomsen
Hi list members --

Is it possible to enumerate the data sources shown in the QGIS "Data
Source Manager" dialog, tab"Browser" using python ?  I can't find any
documentation for it.

My intension was to enumerate file-based datasources in a particular
directory and maybe further enumerate through a specific file in the
chosen directory (ex. a geopackage) containing several data layers.

--
Med venlig hilsen / Kind regards

Bo Victor Thomsen

_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Enumerating QGIS data sources using python

Nyall Dawson
On Wed, 13 Nov 2019 at 21:55, Bo Victor Thomsen
<[hidden email]> wrote:

>
> Hi list members --
>
> Is it possible to enumerate the data sources shown in the QGIS "Data
> Source Manager" dialog, tab"Browser" using python ?  I can't find any
> documentation for it.
>
> My intension was to enumerate file-based datasources in a particular
> directory and maybe further enumerate through a specific file in the
> chosen directory (ex. a geopackage) containing several data layers.

You could access this through the browser model -- it's exposed to
python via iface.browserModel().

Nyall


>
> --
> Med venlig hilsen / Kind regards
>
> Bo Victor Thomsen
>
> _______________________________________________
> QGIS-Developer mailing list
> [hidden email]
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer