A Python package for HoloViz utilities
Project description
holoviz-utils
A Python package for HoloViz utilities.
Installation
pip install -e .
For development:
pip install -e ".[dev]"
Usage
import holoviz_utils
Caption templates
DataPresentation renders the __doc__ of its components — and its
title / introduction / conclusion params — as live captions. Any
{...} token is substituted against current parameter values and re-rendered
automatically whenever a referenced value changes.
A token is {[func(]param[keys][:fmt])} (only param is required):
param— a parameter name, resolved on the presentation or any reachable sub-object (aDataCombiner, a layer, a colormap, …).[keys]— index/key lookups. A quoted key (['label']) is literal; an unquoted key ([highlight_name]) is another param ref whose value is used as the key — this is how you turn a code into a display name.func(...)— an optional whitelisted function (len,sum,min,max,abs,round,sorted,int,float,str,bool).:fmt— an optional Python format spec (:0.1f,:,,%Y-%m-%d, …).
A token that resolves to None renders as unknown.
# highlight_name == "Q"; cmap_var_styles == {"Q": {"label": "Discharge (m³/s)"}, ...}
dgl.__doc__ = (
"Time-series for the {cmap_var_styles[highlight_name]['label']} at the "
"{click_state['properties']['S6_SB_NAME']} sub-basin."
)
# -> "Time-series for the Discharge (m³/s) at the <name> sub-basin."
"{len(subbasins)} sub-basins selected" # -> "3 sub-basins selected"
"mean = {max(scores['a']):0.2f}" # -> "mean = 12.34"
To add a code -> display mapping, just expose it as a parameter and reference
{table[code_param]['field']} — no derived params or manual watchers needed.
See DataPresentation.update_doc for the full reference.
Development
Run tests:
pytest
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file holoviz_utils-0.6.0.tar.gz.
File metadata
- Download URL: holoviz_utils-0.6.0.tar.gz
- Upload date:
- Size: 841.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f383c86bab4dcf92adc64adcd42ff7ff15a9d2c9e5a22119182c2b93a6aa196
|
|
| MD5 |
8f83ea2be2a07c0378cd3e1c91aa524b
|
|
| BLAKE2b-256 |
deb83b6594c3ba11efaa99ca2436fe6b106b3cdd06c0d090b7df433ff9a50a00
|
Provenance
The following attestation bundles were made for holoviz_utils-0.6.0.tar.gz:
Publisher:
release.yml on bertcoerver/holoviz-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
holoviz_utils-0.6.0.tar.gz -
Subject digest:
5f383c86bab4dcf92adc64adcd42ff7ff15a9d2c9e5a22119182c2b93a6aa196 - Sigstore transparency entry: 1908995728
- Sigstore integration time:
-
Permalink:
bertcoerver/holoviz-utils@c238739c541dcd73e3411c7fd74431d6d826a3e4 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/bertcoerver
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c238739c541dcd73e3411c7fd74431d6d826a3e4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file holoviz_utils-0.6.0-py3-none-any.whl.
File metadata
- Download URL: holoviz_utils-0.6.0-py3-none-any.whl
- Upload date:
- Size: 781.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d111c26d93bfc493898e9ce8e2556a99eddf91a2d1f8a4dafe908d7dc537b06d
|
|
| MD5 |
579b6eecbe4e76240fba33f50abdafbc
|
|
| BLAKE2b-256 |
fd3ed2c380612a9d8ade8b83a2e5a2e73330819908641160800f5bae50b16b66
|
Provenance
The following attestation bundles were made for holoviz_utils-0.6.0-py3-none-any.whl:
Publisher:
release.yml on bertcoerver/holoviz-utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
holoviz_utils-0.6.0-py3-none-any.whl -
Subject digest:
d111c26d93bfc493898e9ce8e2556a99eddf91a2d1f8a4dafe908d7dc537b06d - Sigstore transparency entry: 1908995792
- Sigstore integration time:
-
Permalink:
bertcoerver/holoviz-utils@c238739c541dcd73e3411c7fd74431d6d826a3e4 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/bertcoerver
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c238739c541dcd73e3411c7fd74431d6d826a3e4 -
Trigger Event:
push
-
Statement type: