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, rsi_line, rsi_signal, 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, cci_line, cci_signal, 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.5.tar.gz (57.1 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.5-cp310-abi3-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.10+Windows x86-64

techr-0.1.5-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.5-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.5-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.5.tar.gz.

File metadata

  • Download URL: techr-0.1.5.tar.gz
  • Upload date:
  • Size: 57.1 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.5.tar.gz
Algorithm Hash digest
SHA256 37a484f4fca20c7179da4dd5a618c9c7c3f2db6370711909f60e69163de0ad3b
MD5 d775aa791b92648ef3596afc04f5da3c
BLAKE2b-256 c7ce68743b8a1e9f46e0159b5565b60f28fd1105ae81051c62e44f3d9ef32297

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: techr-0.1.5-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.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 60f6cfa202d2d00f764fc7869ba9c97650231869860d6c586d5a6b475df08e43
MD5 a44366f85f548f933b9281a46af1b02b
BLAKE2b-256 9e9442b2f893adcd4b688b8242fc52ba35406a97fc91a1700fa4f0f44f868680

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for techr-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 22902e92240d30f745deaf03b98a99eb271e7e9600d7f7dd65e9b2dfb0d92f33
MD5 8fc31cd41690b99608ed0e0783b764d6
BLAKE2b-256 4a9d43328a37429edc3acab21d53c17c261d70619f6e594b230eed0bc966188b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for techr-0.1.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 db5a72db92b39c40c88b11a2806ba0022b85fd0e5b88866bbf6f6b2f42d93195
MD5 bed5fb5438aa7ab580486aefd31cd379
BLAKE2b-256 fb74126ae9bab89632190ad60a7e6c0af8f07ab2473da5b762d184174a5c1374

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.5-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.5-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.5-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 3afe7e80f305c3351997658a404311bc74b32c296ee5a6542dc2243cb07445c5
MD5 1242eec1292cd42d13888cd67a56e263
BLAKE2b-256 ff81d9d7c9af742d9c0ac0fec18dc97c665b3af5522e42742acc6fb52f9c8f2d

See more details on using hashes here.

Provenance

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