Skip to main content

Polars expression plugins for techr indicators

Project description

polars-techr

polars-techr exposes techr indicators as Polars expression plugins.

Installation

uv add polars-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 polars_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

polars_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.

polars_techr-0.1.0-cp310-abi3-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.10+Windows x86-64

polars_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

polars_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

polars_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 polars_techr-0.1.0.tar.gz.

File metadata

  • Download URL: polars_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 polars_techr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f2106465140f92c02e178237be4d097346c0c7969c44ba413c61acc07df7d72
MD5 ff325c3a9e6760193005047a1636c518
BLAKE2b-256 a437250bc7da5f5d0c86e8abe0283fa7d6b1768ec759f41a141fd22709f034e0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: polars_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 polars_techr-0.1.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0e759dbddb022991eff19e9913a79b6bc7be58d2680c6eb313dda6570ac329e7
MD5 09e1c22eeebb91afc1f54ac4aec16a0f
BLAKE2b-256 d2807171218bc529a95c640505f9640516dd945b8f50f61111ce26cb7828d105

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for polars_techr-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0d4305f193a3d67a565fa864e13ad20ff63e54bb3ce5be39ec27c405a1cdf4c8
MD5 9f19003e93e03adbc0c457fd693554ea
BLAKE2b-256 a9a10b68a8b6af6c56038061a39bbe71913767131011482feec83d4d63c41b16

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for polars_techr-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fb427dd8927b0b4b6f6e910b2e22ba6f48fdd12b476894de7801836a1b4f2b08
MD5 807f31829e870b93d2684822a26ba1c8
BLAKE2b-256 8316ead9606cbdfb471114a4febb0a500d5f1a332db7f52e9f97654f7d57a31f

See more details on using hashes here.

Provenance

The following attestation bundles were made for polars_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 polars_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 polars_techr-0.1.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 480c9bff4c326d4741a290c679bd42cc2ca355015abd4d5d7d27c4c135943d76
MD5 8e534579b632449ed3a63def0b3cc0f1
BLAKE2b-256 9f69a1ff3cbb9d7de0da85939333756c12471948d5027b6e42c1f71181bc3847

See more details on using hashes here.

Provenance

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