datavizhub.assets package¶
Static assets for DataVizHub (images, templates, styles, and more).
Provides a central, importable location for all non-code resources used by DataVizHub. Assets are packaged with the library so they can be discovered consistently at runtime across environments (sdist/wheel, editable installs, and CI).
Examples
Access an image file using importlib.resources
:
from importlib.resources import files, as_file
resource = files("datavizhub.assets").joinpath("images/earth_vegetation.jpg")
with as_file(resource) as p:
path = str(p) # pass to libraries that require a filesystem path
Subpackages¶
Packaged image resources (basemaps, overlays, examples).
Contains image files used by visualization utilities and sample pipelines,
including global basemaps and overlays. Access these resources via
importlib.resources
to avoid hard-coded filesystem paths.
Examples
Obtain a path-like object to a packaged image:
from importlib.resources import files, as_file
resource = files("datavizhub.assets").joinpath("images/earth_vegetation.jpg")
with as_file(resource) as p:
path = str(p)