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

  • sma, wma, ema, disparity
  • macd, macd_signal, macd_hist
  • bband_middle, bband_lower, bband_upper
  • stochf_percent_k, stochf_percent_d
  • stoch_percent_k, stoch_percent_d
  • 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.2.tar.gz (51.4 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.2-cp310-abi3-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.10+Windows x86-64

techr-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB view details)

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

techr-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

techr-0.1.2-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (6.4 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.2.tar.gz.

File metadata

  • Download URL: techr-0.1.2.tar.gz
  • Upload date:
  • Size: 51.4 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.2.tar.gz
Algorithm Hash digest
SHA256 ecde78d80087527a34075f775881d4d56c69677c44e024040a1b26dab3e91051
MD5 7ec2e56d2e4042750142301625ed1af5
BLAKE2b-256 049e6a7e0e965804f90f95839e8fa929e6d35928ccacacb681cc043cac327e6e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: techr-0.1.2-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.8 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.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bf04cfcf4fbce3a5662343c3cd819a3a85f62c0dff8d22026deb7e9570cf90bb
MD5 e31f286a6fc5511ee5431f47c573f18c
BLAKE2b-256 a9d44e56a585d483f840d14af00ece1aadc5d52451c3fbe4cfbf9f60fc3ae1fe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for techr-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a008b8a04c4e0f0dbfc2229de6bcc14aa0744ac7ca3a94e1e6c48bfbe2332c7e
MD5 fd13567f1882168a7888303d1ed54236
BLAKE2b-256 0c7ecb1196fced62f65f3df8a75eece622d2513712023aaabd72702b4a320194

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for techr-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7e7823fbc49da185598e2b7adb4015d23a98c9453986118bce067609e4357180
MD5 85bf65fd24e7ecc1cb710d2d01de9a1c
BLAKE2b-256 ee942a450b072018aba2bed169f5dc77b0cbfa5fa181bdb38728448cc867457c

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.2-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.2-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.2-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 b502d6a36406631fc9ab991dfee689ec1a426b0ce9e4c8d03b67b72e6d9a3de8
MD5 e697621a5bb8201d0277e112efc23235
BLAKE2b-256 94189ef8a8fa9faa8d5cb0086a756b46054c2c4fab5647cf89023b150bd79e2c

See more details on using hashes here.

Provenance

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