Skip to main content

Welcome to hdhelpers

Maintenance build python PyPI version PyPI - License Downloads

What is hdhelpers?

hdhelpers is a package designed for and included in the standard installation of the hetida designer.

Currently, the package provides functions to retrieve metadata from Pandas objects (stored in the attr of the Pandas object). Pandas objects are the standard for processing time series data in the hetida designer. Additionally, a function is provided to handle time zone information. In the future, the package is planned to be expanded, for example by providing functions to facilitate visualization.

The documentation of the package is a GitHub page, on which the functions of the package are described and some tips for getting started with using the package are given.

Getting Started with hdhelpers

Since version >0.13.10 the hetida designer runtime comes with an installed version of hdhelpers. To start the hetida designer we recommend following the hetida designer setup guide.

The plotting helpers (hdhelpers.plotting and their names in hdhelpers) need plotly, which is the optional extra plotting: pip install "hdhelpers[plotting]". Everything else, e.g. the metadata models, works without plotly.

An example is given in GitHub page of how to use functionalities of hdhelpers inside a hetida designer component. Furthermore the base component Single Time Series Plot uses hdhelpers to demonstrate the usage (since version >0.13.10).

Developing for hdhelpers

For dependency management and venv setup, building and publishing, uv is used.

Setting up a Development Environment

Python environment

  1. Create a virtual environment with uv venv. This will create a hidden .venv directory.
  2. Activate the virtual environment via source .venv/bin/activate
  3. Run uv sync --all-extras to install all dependencies given in pyproject.toml, including the optional ones of the plotting helpers.
  4. In case you need to add a new dependency, do so via uv add <new_dependency>. That way, uv finds versions of all dependencies that are compatible with each other.
  5. In case you need a new requirement for development purposes please use uv add --dev <new_dependency>

Note: To install hdhelpers in editable mode in your venv please run uv pip install -e .

hetida designer with hdhelpers

To test designer images with current hdhelpers version please save a copy of docker-compose.yml from the hetida designer repository.

Then write a Dockerfile to install the current hdhelpers version in the required designer backend.

FROM hetida/designer-backend:<<hd_version>>

USER root

RUN pip install ".[plotting]"

USER hd_app

CMD ["bash", "/app/start.sh"]

Then modify the docker-compose.yml to work with the backend version defined by the modified Dockerfile.

...
  hetida-designer-backend:
    build:
      context: .
      dockerfile: Dockerfile
...

use docker-compose.yaml, e.g. via docker compose -f 'docker-compose.yaml' up -d --build. This compose setup loads the current hetida designer images and installs the hdhelpers package in the runtime. Thus, you can use functions of hdhelpers writing component code.

Code Quality

Once you are done writing your code, including unit tests, use ./run check to see if your code quality is sufficient.

Metadata schema snapshot

tests/metadata/test_conventions_schema.py compares the generated metadata JSON schemas with tests/data/convention_schemas.json. Class docstrings become schema descriptions, so documentation changes can also require a snapshot update.

After an intentional schema change, regenerate the snapshot in Bash/WSL:

UPDATE_SCHEMA_SNAPSHOT=1 uv run pytest tests/metadata/test_conventions_schema.py -q

Or in PowerShell:

$env:UPDATE_SCHEMA_SNAPSHOT = "1"
uv run pytest tests/metadata/test_conventions_schema.py -q
Remove-Item Env:UPDATE_SCHEMA_SNAPSHOT

Review the diff for unintended changes and rerun the test without the update flag:

git diff -- tests/data/convention_schemas.json
uv run pytest tests/metadata/test_conventions_schema.py -q

Commit the updated snapshot together with the corresponding model or docstring changes.

Documentation

For documentation we use the tool sphinx. Please apply ./run build_docs to create the current state of documentation. It will be stored in docs. You can open the documentation by opening docs/index.html, e.g. with your browser.

Build, Release and Publish

The first step for publishing a new package version is creating and merging a pull request from develop to main. In detail the following steps should be executed beforehand:

  1. Please execute ./run build_package <version_nr> where version number should follow semantic versioning. This will:
  • Runs uv sync --frozen to upgrade dependencies.
  • Update version in pyproject.toml
  • Update __version__ in __init__.py
  • Builds wheels of hdhelpers in ./dist
  1. Ensure that listed classifiers in pyproject.tomlare up to date. If not
  • Update pyproject.toml accordingly
  • Update ./run test-py-versions accordingly for local testing using uv
  • Update check_pull_request.yml accordingly for automated pipeline execution of checks
  • Update badge in this file for Python versions above
  1. Update CHANGELOG.md manually following Keep a Changelog

When the PR is accepted, the package can be published in a second step. To publish the build from the dist subdirectory to PyPI,

  1. tag your main branch with the specified package version

  2. use uv publish --index testpypi --token <API-token>. You need a Test-PyPI account with a token and you need maintainer/owner access to the hdhelpers Test-PyPI project.

  3. verifiy that package can be installed by using:

uv run --with 'hdhelpers==0.0.9' --refresh-package hdhelpers --default-index https://test.pypi.org/simple/ --index https://test.pypi.org/simple/ --no-project -- python -c "import hdhelpers; print(hdhelpers.__version__)"
  1. use uv publish dist/* to upload the package on hdhelpers PyPI project.

  2. After publishing please communicate to the hetida designer team so upgrade there dependencies. The hetida designer docker compose setup installs hdhelpers from PyPI as it does with any dependency listed in runtime/requirements.in.

Notes

  • Please ensure that dependencies specified for hdhelpers do work in current designer versions.
  • If you want to upgrade dependencies please run uv lock --upgrade
  • to install hdhelpers from testpypi you can use: uv pip install --extra-index-url https://test.pypi.org/simple/ --index-url https://pypi.org/simple --refresh --index-strategy unsafe-best-match hdhelpers

Metadata

Release files for hdhelpers 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hdhelpers 0.1.0
File Size Uploaded Provenance Actions
hdhelpers-0.1.0.tar.gz 24.1 MB Without provenance Details for hdhelpers-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hdhelpers 0.1.0
File Interpreter ABI Platform Actions
hdhelpers-0.1.0-py3-none-any.whl Python 3 none any Details for hdhelpers-0.1.0-py3-none-any.whl

Total release size: 24.2 MB

Release files / hdhelpers-0.1.0.tar.gz

Download URL hdhelpers-0.1.0.tar.gz
Size 24.1 MB
Tags Source
SHA-256 checksum
How to use checksums
ca45c2ce5de4491ec16a7d727f90102140225a0689c2df7dad8a05f75846127d
BLAKE2b-256 checksum
How to use checksums
0fc7c2546579ac98abf1bfa43e6605d0238223119e6711b2d8d2342cbdb7b5fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / hdhelpers-0.1.0-py3-none-any.whl

Download URL hdhelpers-0.1.0-py3-none-any.whl
Size 46.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff9acc18de2cb162b9faea9dfb5c874bad5d10ebd2e7e21e489dfab9e1a91a43
BLAKE2b-256 checksum
How to use checksums
0d46f163fb9ec69038ae009289a356a7e09b40ef30d6509f5da76e4bd432c88b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for hdhelpers 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page