Skip to main content

Transformation functions for Tyche market data pipelines

Project description

Tyche Transforms

This package provides the transformation functions defined in MARKETS_INFO.md for Tyche market data pipelines. The intent is to keep the same implementations between local development and the Chainlink adapter.

Install

python3 -m pip install tyche-transforms

For development:

python3 -m pip install -e ".[test]"

Usage

import pandas as pd
from tyche_transforms.transforms import daily_average, hdd, runlen_lt

series = pd.Series([15.0, 10.0, 8.0], index=pd.date_range("2024-01-01", periods=3))
print(hdd(series))
print(runlen_lt(series, threshold=9.0))

GitHub Actions

This repo includes a workflow that runs tests on every push/PR and publishes to PyPI when you push a tag matching v* (for example v0.2.0). To enable publishing:

  1. Add a repository secret named PYPI_API_TOKEN containing your PyPI token.
  2. Push a version tag:
git tag v0.2.0
git push origin v0.2.0

Transform list

  • CONVERT_M_TO_MM: convert meters to millimeters.
  • CUMULATIVE_TO_INCREMENT: convert cumulative totals to daily increments.
  • DAILY_AVERAGE, DAILY_SUM, DAILY_MAX: daily resampling functions.
  • HDD, CDD: heating/cooling degree days (base 18 C).
  • SUM, AVG, MAX, MIN: aggregations to scalars.
  • DATE_MAX, DATE_FIRST: timestamp utilities.
  • RUNLEN_LT: longest run length below a threshold.
  • ABS, SUBTRACT_V, SUBTRACT: scalar transforms.

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

tyche_transforms-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

tyche_transforms-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file tyche_transforms-0.1.0.tar.gz.

File metadata

  • Download URL: tyche_transforms-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tyche_transforms-0.1.0.tar.gz
Algorithm Hash digest
SHA256 71fff819e74a3a9b25e252711ec5b772690b3de715df4ecd9aabee187e9bb298
MD5 80691aba6a929d5326e981e0256756ff
BLAKE2b-256 3fb3f58e78218743116b5121452519e3454829fd33293e335b3b566961dda3a1

See more details on using hashes here.

File details

Details for the file tyche_transforms-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tyche_transforms-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9c86f45160c5656742f6a17cad90d1acdb66c1246ace5b5bf72a2bb4d594350
MD5 a4369d350135d1e894132e213efae4da
BLAKE2b-256 0b10b45d46ecc95a64a3c46bc3014788e05e1ab1c0cdbcbd61021a1e361834a6

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