Skip to main content

ECG k-Fold utilities

Project description

ECG-k-Fold

Utilities for creating reproducible k-fold splits for open-access ECG datasets (FAIR compliant), packaged as a Python library with a CLI and CI/CD. Includes an option to push datasets to the Hugging Face Hub.

Install

pip install ecg-k-fold

For development:

git clone <this-repo>
cd ECG-k-Fold
make init

Or manually:

git clone <this-repo>
cd ECG-k-Fold
# Install uv if not already installed: curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install -e .[dev]
uv run pre-commit install

CLI

Push a local dataset directory to the Hugging Face Hub. Requires an access token with write permissions.

export HF_TOKEN=hf_************************
ecg-k-fold push-dataset ./path/to/dataset \
  --repo-id org_or_user/dataset-name \
  --private \
  --commit-message "Add v1"

Flags:

  • --repo-id: target dataset repo, e.g. your-org/ecg-dataset
  • --private/--public: repository visibility (default private)
  • --commit-message: commit title for the upload
  • --token: override HF_TOKEN env var

Dataset contents are uploaded as-is; common temp files are ignored.

Python API

from pathlib import Path
from ecg_k_fold.datasets.push_hf import push_local_dataset_to_hub

push_local_dataset_to_hub(
    local_dir=Path("./path/to/dataset"),
    repo_id="your-org/ecg-dataset",
    private=True,
    commit_message="Initial upload",
    hf_token="hf_...",
)

CI/CD

  • Lint, type-check, and tests run on PRs and pushes to develop and main (.github/workflows/ci.yml).
  • Publishing to PyPI happens on pushing a tag like vX.Y.Z (.github/workflows/publish.yml). Uses PyPI Trusted Publishers, no PyPI token needed. See https://docs.pypi.org/trusted-publishers/
  • A manual workflow can push datasets to Hugging Face (.github/workflows/hf-dataset-push.yml). Set HF_TOKEN in repo secrets.

Gitflow

  • Default branches: main (stable), develop (integration).
  • Create feature branches off develop (feature/<name>), open PRs into develop.
  • Release by creating a tag vX.Y.Z on main to trigger PyPI publish.

See CONTRIBUTING.md for details.

License

Apache-2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ecg_k_fold-0.1.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecg_k_fold-0.1.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file ecg_k_fold-0.1.1.tar.gz.

File metadata

  • Download URL: ecg_k_fold-0.1.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for ecg_k_fold-0.1.1.tar.gz
Algorithm Hash digest
SHA256 89683032e2f41634a6e53955a8082558b5f1c223c877e1416564cd1408377436
MD5 e4d7e60873e499c63074db8ee42f1f4f
BLAKE2b-256 7742b63f297e5207221a165facfc3640da694a44ff6ae6dac2240ff510b0fb16

See more details on using hashes here.

File details

Details for the file ecg_k_fold-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ecg_k_fold-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for ecg_k_fold-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03c2368046142481c99479939a464605896f68bbbb94bf296e097f66daf5fad1
MD5 9320f07cd2d1a96658294143983c1310
BLAKE2b-256 5fa2522f4f9b787ae55df569666be2359591eb554a91bac7e9e96c686e209847

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page