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, trix_line, trix_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.4.tar.gz (56.5 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.4-cp310-abi3-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.10+Windows x86-64

techr-0.1.4-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.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: techr-0.1.4.tar.gz
  • Upload date:
  • Size: 56.5 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.4.tar.gz
Algorithm Hash digest
SHA256 8720a290e179901fdd35d5aa390c9fbd6fcbc2b5a21baa28ccace6128baa8ec5
MD5 0287efdb1b91f13aa0be322cfa691d67
BLAKE2b-256 cacb9fcb3d1c3ccb74b71c82158e3461d57f6a3987038e384d437837083c8658

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.4.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.4-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: techr-0.1.4-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.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2e2744af381163bd5561013aea4c26dd91f1461ece66d0166a8635fbd76ccfdb
MD5 df0eb4fb9304c48a1a00364f80d2cdb4
BLAKE2b-256 3939aef331ac13f876d2f4b97c35e5ce3a8818edf796b9d4b1238839980564c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.4-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.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for techr-0.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 817c95b6b003ce067f898e2c3204d52cee574fa97518884fc891827782bb80aa
MD5 4b54ed39e84a35b23ac98e69d3874a27
BLAKE2b-256 7e8e740e615ea1ec2519471f586ccb3def1c63aed9c4adb626527ea99caf361e

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.4-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.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for techr-0.1.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9b52458bdace8dc890da91b5715b30af3a9346da11d951d5c329b8f01f6de09e
MD5 cba81b9bda4405f002b49b237e0e9eea
BLAKE2b-256 90da7f5489b0c83d18382762202b601b94a0e6c55cbe5190c130d21c7997161f

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.4-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.4-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.4-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 2e1d9bd7e41c8b08d7f1a3dfa76ff198d2d11200a50b73432dec83b89f4c14ac
MD5 6f938c1af1a0145777f0b522b2e54685
BLAKE2b-256 dbe0b5c9fe303bae17a7d69df22d95e4fbdd4b34bae4f97edf1bcfd62b24d423

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.4-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