Skip to main content

Polars expression plugins for techr indicators

Project description

techr

techr exposes technical indicators as Polars expression plugins.

Installation

uv add techr

Supported indicators

  • Price/trend: sma, wma, ema, disparity, mom, roc, rsi, psl
  • Bands/channels: bband_middle, bband_lower, bband_upper, env_upper, env_middle, env_lower, pchan_upper, pchan_middle, pchan_lower
  • Momentum/oscillators: macd, macd_line, macd_signal, macd_hist, macd_histogram, ppo_line, ppo_signal, ppo_histogram, pvo_line, pvo_signal, pvo_histogram, sonar_line, sonar_signal, stochf_percent_k, stochf_percent_d, stoch_percent_k, stoch_percent_d, stochrsi_percent_k, stochrsi_percent_d
  • High/low/volume indicators: ad, adx, adxr, aroon_up, aroon_down, aroonosc, atr, cci, cmf, co, cv, dmi_plus, dmi_minus, efi, eom_line, eom_signal, erbear, erbull, massi_line, massi_signal, mfi, nvi_line, nvi_signal, obv_line, obv_signal, psar, pvi_line, pvi_signal, ultosc, vr, willr
  • Ichimoku: ichimoku_base_line, ichimoku_conversion_line, ichimoku_leading_span_a, ichimoku_leading_span_b, ichimoku_lagging_span

Usage

import polars as pl
import techr as ta

df = pl.DataFrame(
    {
        "high": [11.0, 12.0, 13.0],
        "low": [9.0, 10.0, 11.0],
        "close": [10.0, 11.0, 12.0],
    }
)

result = df.select(
    ta.sma(pl.col("close"), period=2).alias("sma_2"),
    ta.macd(pl.col("close"), fast_period=12, slow_period=26).alias("macd"),
    ta.stochf_percent_k(
        pl.col("high"),
        pl.col("low"),
        pl.col("close"),
        fastk_period=14,
        fastd_period=3,
    ).alias("stochf_k"),
)

Null input values are accepted. Indicators preserve row alignment and emit nulls according to the core rolling-window and seed recovery rules.

Ichimoku Notes

  • Standalone Ichimoku rolling-window lines such as ichimoku_base_line and ichimoku_conversion_line use period.
  • ichimoku_leading_span_a uses base_line_period and conversion_line_period because it combines two lines.
  • ichimoku_leading_span_b uses period for the rolling window and base_line_period for the forward displacement. The Python wrapper defaults base_line_period to 26.
  • ichimoku_lagging_span uses base_line_period for its backward displacement.
  • Polars plugins keep the output row-aligned with the input, so ichimoku_leading_span_a and ichimoku_leading_span_b truncate the forward-projected tail from the core result.

Development

cd polars
uv sync --group dev
uv run maturin develop --uv
uv run pytest

Build distributable artifacts locally with:

cd polars
uv run maturin build --release --sdist --out dist
uv run python scripts/check_artifacts.py dist

Release

  1. Update the version in Cargo.toml.
  2. Merge the version bump to main.
  3. Polars Release builds the artifacts and publishes them to PyPI.
  4. After the PyPI publish succeeds, the workflow creates the matching polars-vX.Y.Z GitHub Release.

If the matching GitHub Release already exists, the workflow exits without publishing a duplicate release.

Before the first release, configure a Trusted Publisher for PyPI on alphaprime-dev/techr.

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

techr-0.1.3.tar.gz (55.6 kB view details)

Uploaded Source

Built Distributions

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

techr-0.1.3-cp310-abi3-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.10+Windows x86-64

techr-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

techr-0.1.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

techr-0.1.3-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (6.6 MB view details)

Uploaded CPython 3.10+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file techr-0.1.3.tar.gz.

File metadata

  • Download URL: techr-0.1.3.tar.gz
  • Upload date:
  • Size: 55.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for techr-0.1.3.tar.gz
Algorithm Hash digest
SHA256 20deb6d75c3ddf6bc560601998afbd99d65b84abda98fcb808d3faff2be8ee81
MD5 e87bbf555fdb167972fda6d599e5efb9
BLAKE2b-256 355850d799fbec57db5da3e3475ad849b623e0e4eadb5ebf7a5f51beebc5dabf

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.3.tar.gz:

Publisher: polars-release.yml on alphaprime-dev/techr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file techr-0.1.3-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: techr-0.1.3-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for techr-0.1.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 97d563efc86f80a22bed8d2960de698e36ebe60137e690fac2f79ffa61c2057d
MD5 57063aa5acbb4c6b0fcc67f01d76cdea
BLAKE2b-256 36bd1c09ab1697ac6933f473ccb037a8b1bae4cfad97819c24a1a33a26188dd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.3-cp310-abi3-win_amd64.whl:

Publisher: polars-release.yml on alphaprime-dev/techr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file techr-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for techr-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1fbc94e9be0408f06a39e338833555d2a6d08f8f7ba6e4cf782bb123af3d016a
MD5 1866cf3400a1b658a24be0f9208c9596
BLAKE2b-256 642157d18859288cadbaa6ae2b8cf4cd8d5dca4a52cbf8acead6c664f2fcb05b

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: polars-release.yml on alphaprime-dev/techr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file techr-0.1.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for techr-0.1.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f4b5161bc73a7120f9421cab14e2723b26aebbf85b4e071767bec7a509074575
MD5 8475b0250dcdf49c178551fb83fe1251
BLAKE2b-256 58f468c6e6e6becdcf39b71b1ab265a7ffb7f8c164e5e015cfd3a0c9c1d40f24

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: polars-release.yml on alphaprime-dev/techr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file techr-0.1.3-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for techr-0.1.3-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 2f0321d6fabac09eca67d57a7a836368d82aaa2309adc06e341e8ea15ae60e6f
MD5 6ae4a841c9c3137412ee55aa303ae0d9
BLAKE2b-256 825011021e6b893a3fe21e2391506a458a4be07e670767c5f40ff2e318c32b1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.3-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: polars-release.yml on alphaprime-dev/techr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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