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"),
)

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.0.tar.gz (44.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.0-cp310-abi3-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.10+Windows x86-64

techr-0.1.0-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.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

techr-0.1.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (6.0 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.0.tar.gz.

File metadata

  • Download URL: techr-0.1.0.tar.gz
  • Upload date:
  • Size: 44.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.0.tar.gz
Algorithm Hash digest
SHA256 7cc22fce37685f2c998bffefe09acf8b332369977e0e1072450872e1d22669ca
MD5 2918e4ac71313618f22426253ec18183
BLAKE2b-256 f27fa0e5caa10ee9b45da968905917d3d4c24e5683ef32c1f5cbb53c87752adb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: techr-0.1.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.6 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.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f63ddabee7532d647925f70c41e6259616d66541d3b12b00f06657c7e40303d9
MD5 2123227037752ffd8d1ef92202122e4e
BLAKE2b-256 2b8cadb8ba87ceaa6afcf64db5b3fe37da446aa5e46fa5d4fc8faadc212d6725

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for techr-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4c32d766666f89b29bf954c75aa4537d3edacb513ccea0ca1780a6e0ad8d1a13
MD5 f6476f88c36dd314dfeb91c5ef4f944d
BLAKE2b-256 1f86f31fd95c1dd43e686266e17a15ac257ce30099769713b8d3d371aa5b37d8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for techr-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7f82d556b94d64ad5393c6a2a4469209c94572e8882d67a706fe2dbed1d33401
MD5 cc1ca4a78cb61fd8e6184035af6a7e0d
BLAKE2b-256 0a8f3fa00098261aee5afade16a55e983819673c1488ec5862ce648de3a01623

See more details on using hashes here.

Provenance

The following attestation bundles were made for techr-0.1.0-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.0-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.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 7ca5f0167b0c4d32f95160673a4de28c415535bbafb448199c3925d499394cdb
MD5 45787a5462c55705df25dbad364550d1
BLAKE2b-256 cc422ef19ccb466479720ebd878c13df85a9ee6e90be2e7e17c939bd69d7f730

See more details on using hashes here.

Provenance

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