skillfed

finlab

Analyzing stock has never been easier.

finlab v2.0.17 77.4K downloads/30d#14,533 on PyPI
Copyleft license GPL-3.0-or-later Active released

What it is and what it does

Finlab is a backtesting framework designed for Taiwan stock market analysis. It provides one-line access to historical price and fundamental data for 2000 stocks, integrates seamlessly with pandas for strategy definition, and executes multi-stock backtests with detailed performance reports. Strategies are written using familiar pandas syntax—boolean conditions on rolling windows, resampling logic, and position signals—making it accessible to traders without deep programming expertise.

The package combines data retrieval, strategy expression, and backtesting into a unified workflow. It handles multi-frequency data alignment automatically and uses Cython-optimized computation to run backtests on large stock universes in seconds. It also supports machine-learning strategy development via qlib integration. The 10 runtime dependencies (requests, numpy, pandas, pyarrow, lz4, tqdm, jinja2, ipython, scipy, cryptography) provide data fetching, numerical computation, and reporting capabilities.

Use it for:

  • Test a mean-reversion strategy on 2000 Taiwan stocks over a decade of historical data in minutes.
  • Develop and iterate on technical-indicator-based trading rules using pandas rolling-window operations.
  • Generate detailed backtest reports with performance metrics to compare strategy variants.
  • Prototype machine-learning trading strategies using qlib within the finlab framework.
  • Analyze historical stock performance and identify patterns across Taiwan's equity market.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Backtest trading strategies on Taiwan stock market data by writing simple pandas-based logic, with historical data for 2000 stocks and detailed performance analysis.

Yes, with conditions. Install if you are backtesting Taiwan stock strategies and accept GPL-3.0-or-later licensing. The package is actively maintained, supports modern Python versions, and has no known vulnerabilities. Medium install friction from 10 dependencies is typical for data-science workflows. Not suitable if you require proprietary or closed-source derivative work.

Install

finlab on PyPI

pip

pip install finlab

uv

uv add finlab

poetry

poetry add finlab

Installing finlab

Before you install

Medium install friction due to 10 runtime dependencies including numpy, pandas, scipy, and cryptography. Package is actively maintained with recent release history and supports modern Python versions (3.9–3.14) across multiple platforms via precompiled wheels.

License in practice

Licensed under GPL-3.0-or-later (copyleft). Any derivative work or distribution must also be open-source under a compatible GPL license; proprietary use or closed-source modifications are not permitted.

Quickstart

from finlab import data, backtest

close = data.get('price:收盤價')
position = close >= close.rolling(300).max()
report = backtest.sim(position, resample='M')
report.display()

Requires Python 3.9 or later; data retrieval depends on finlab's remote database access.

Verify before relying

  • Whether the 2000 stocks dataset covers all Taiwan-listed companies or a specific subset.
  • Exact historical data depth and date range available beyond 'past ten years' mentioned in description.
  • Performance characteristics and typical runtime for backtesting 2000 stocks as claimed.
  • Whether qlib machine-learning integration is built-in or requires separate installation.

Package facts

License GPL-3.0-or-later (copyleft)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies 10 — requests, numpy, pandas, pyarrow, lz4, tqdm, jinja2, ipython, scipy, cryptography
Maintenance actively maintained — 12 days since the last release
First released
Downloads 77,351/month — #14,533 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: finlab-2.0.17-cp310-cp310-macosx_10_15_universal2.whl; finlab-2.0.17-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; finlab-2.0.17-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; finlab-2.0.17-cp310-cp310-win_amd64.whl; finlab-2.0.17-cp311-cp311-macosx_10_15_universal2.whl; finlab-2.0.17-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; finlab-2.0.17-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; finlab-2.0.17-cp311-cp311-win_amd64.whl; finlab-2.0.17-cp312-cp312-macosx_10_15_universal2.whl; finlab-2.0.17-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; finlab-2.0.17-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; finlab-2.0.17-cp312-cp312-win_amd64.whl; finlab-2.0.17-cp313-cp313-macosx_10_15_universal2.whl; finlab-2.0.17-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; finlab-2.0.17-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; finlab-2.0.17-cp313-cp313-win_amd64.whl; finlab-2.0.17-cp314-cp314-macosx_10_15_universal2.whl; finlab-2.0.17-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; finlab-2.0.17-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; finlab-2.0.17-cp314-cp314-win_amd64.whl

Operating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

stock backtesting frameworktrading strategy testinghistorical stock data taiwanquantitative trading librarypandas-based strategy backteststock market simulationautomated trading analysis
backtestingquantitative-tradingtaiwan-stocks

More Information Analysis packages