Skip to main content

ml4t-engineer

Python 3.12-3.15 PyPI License: MIT

Feature engineering, labeling, alternative bars, and leakage-safe datasets for financial ML.

ml4t-engineer provides 120 registry features across 11 categories, path-dependent and fixed-horizon labeling, activity-based bar sampling, and train-only preprocessing. The core interface uses Polars DataFrames.

Installation

Development source supports Python 3.12, 3.13, 3.14, and 3.15 on Linux, macOS, and Windows. Python 3.15 support and the calendar API used below are intended for the 0.2 release. Release 0.1.6 supports Python 3.12-3.14; use its version-matched quick start instead of passing the new calendar argument to that release.

pip install ml4t-engineer

Until 0.2 is available from PyPI, run the examples below from a source checkout with uv sync --no-dev, using that environment's Python.

The quick start uses only core dependencies. Optional extras provide TA-Lib validation, DuckDB and PyArrow storage, market calendars, visualization, statistics, and ML tools:

pip install "ml4t-engineer[ta]"
pip install "ml4t-engineer[store]"
pip install "ml4t-engineer[calendars]"
pip install "ml4t-engineer[viz]"
pip install "ml4t-engineer[stats]"
pip install "ml4t-engineer[ml]"

The development ta extra uses TA-Lib 0.8.2 or later in the 0.8 series; its wheels include the native library. For source builds, follow the upstream installation guide. The core package does not require an external service, credentials, or special hardware.

Quick Start

from datetime import date, timedelta

import polars as pl
from ml4t.engineer import compute_features

close = [100.0 + i * 0.1 + (i % 7) * 0.2 for i in range(100)]
ohlcv = pl.DataFrame(
    {
        "timestamp": [date(2024, 1, 1) + timedelta(days=i) for i in range(100)],
        "open": close,
        "high": [price + 1.0 for price in close],
        "low": [price - 1.0 for price in close],
        "close": close,
        "volume": [100_000 + i * 100 for i in range(100)],
    }
)

features = compute_features(ohlcv, ["rsi", "macd", "atr"], calendar=None)

assert {"rsi", "macd", "atr"} <= set(features.columns)
assert features.height == ohlcv.height

compute_features() returns the input columns with the requested feature columns appended. This example explicitly uses observation-row mode with calendar=None; periods count rows, not scheduled sessions or elapsed days. Use the feature registry to inspect categories and parameters before building larger pipelines.

Supported Workflows

  • Technical, volatility, risk, microstructure, statistical, and ML-oriented features
  • Triple-barrier, ATR-barrier, percentile, fixed-horizon, trend-scanning, and meta-labels
  • Tick, volume, dollar, imbalance, and run bars
  • Train/test splitting with train-only scaling
  • Feature metadata search and discovery

See the documentation for tutorials, task-oriented guides, explanations, and the API reference. Report defects and request changes through GitHub Issues.

  • ml4t-specs defines the shared market-data and artifact contracts used by this package.
  • ml4t-data supplies validated market data for feature computation.
  • ml4t-diagnostic evaluates features, labels, and model signals produced from engineered datasets.

Development

Read CONTRIBUTING.md before opening an issue or pull request.

git clone https://github.com/ml4t/engineer.git
cd engineer
uv sync --dev --extra docs --extra ta --extra store --extra viz
uv run ruff check src/ tests/ examples/ scripts/
uv run ruff format --check src/ tests/ examples/ scripts/
uv run ty check
uv run pytest tests/ -q
uv build
uv run python -c "import ml4t.engineer"
uv run mkdocs build --strict

Pull requests must also pass the supported Python and operating-system matrix, dependency and vulnerability review, clean-wheel installation, documented workflow tests, and ecosystem qualification.

Project Information

Metadata

Release files for ml4t-engineer 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ml4t-engineer 0.2.1
File Size Uploaded Provenance Actions
ml4t_engineer-0.2.1.tar.gz 5.8 MB With provenance Details for ml4t_engineer-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ml4t-engineer 0.2.1
File Interpreter ABI Platform Actions
ml4t_engineer-0.2.1-py3-none-any.whl Python 3 none any Details for ml4t_engineer-0.2.1-py3-none-any.whl

Total release size: 6.2 MB

Release files / ml4t_engineer-0.2.1.tar.gz

Download URL ml4t_engineer-0.2.1.tar.gz
Size 5.8 MB
Tags Source
SHA-256 checksum
How to use checksums
823d14ce9a7d895000aeb1ecd7c3d0661ee88c545afad29a934d593931627845
BLAKE2b-256 checksum
How to use checksums
537a1991f31bdfb83220ea15f943f671b1de28a94c62f860a2239cab8f767eaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / ml4t_engineer-0.2.1-py3-none-any.whl

Download URL ml4t_engineer-0.2.1-py3-none-any.whl
Size 446.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1a35515778a9c8621f48ddbad28b1e267a1a811e91fa5a55e9d0f75b469a0bf
BLAKE2b-256 checksum
How to use checksums
ace9e5a47baa96f231150649fbe53a94d95de6c9cc900d6bf2cb7599f7d160ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for ml4t-engineer 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ml4t_engineer-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page