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

uv pip install tyche-transforms

For development:

uv 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.
  • KELVIN_TO_CELSIUS: convert Kelvin to Celsius.
  • 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.1.tar.gz (5.5 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.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tyche_transforms-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 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.1.tar.gz
Algorithm Hash digest
SHA256 4e547551f72154dded54cc3419a81dbc263c63e91c4487fccc19c311954f55ed
MD5 db86ca360c7f9ff429e954bea7a81509
BLAKE2b-256 dff774721efbca9bf7b3675c7590c436488ac237bcce416bd8a4e313365414df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tyche_transforms-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 981c55ee02ddfd8de6f49179aaa43cbe2b116ed81243f20a3d82b38bda35a18a
MD5 8c64a5b48767cfe5bec60211edd3e16e
BLAKE2b-256 8628d2e2af7517e97774fcd6d21277286e54e8ae55717df5717ddf3f6e7ef42d

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