No project description provided
Project description
Finalytics Python Binding
Finalytics is a high-performance Python binding for the Finalytics Rust library, designed for retrieving financial data, security analysis, and portfolio optimization. It provides a fast, modular interface for advanced analytics, and powers dashboards and applications across platforms.
🚀 Installation
pip install finalytics
🐍 Main Modules
Finalytics Python exposes five core modules for financial analytics:
1. Screener
Efficiently filter and rank securities using advanced metrics and custom filters.
Usage Example:
from finalytics import Screener
screener = Screener(
quote_type="EQUITY",
filters=[
'{"operator": "eq", "operands": ["exchange", "NMS"]}',
'{"operator": "eq", "operands": ["sector", "Technology"]}',
'{"operator": "gte", "operands": ["intradaymarketcap", 10000000000]}',
'{"operator": "gte", "operands": ["returnonequity.lasttwelvemonths", 0.15]}'
],
sort_field="intradaymarketcap",
sort_descending=True,
offset=0,
size=10
)
print(screener.overview())
print(screener.metrics())
screener.display()
2. Ticker
Analyze a single security in depth: performance, financials, options, news, and more.
Usage Example:
from finalytics import Ticker
ticker = Ticker(
symbol="AAPL",
start_date="2023-01-01",
end_date="2024-12-31",
interval="1d",
benchmark_symbol="^GSPC",
confidence_level=0.95,
risk_free_rate=0.02
)
ticker.report("performance")
ticker.report("financials")
ticker.report("options")
ticker.report("news")
3. Tickers
Work with multiple securities at once—aggregate reports, batch analytics, and portfolio construction.
Usage Example:
from finalytics import Tickers
tickers = Tickers(
symbols=["NVDA", "GOOG", "AAPL", "MSFT", "BTC-USD"],
start_date="2023-01-01",
end_date="2024-12-31",
interval="1d",
benchmark_symbol="^GSPC",
confidence_level=0.95,
risk_free_rate=0.02
)
tickers.report("performance")
4. Portfolio
Optimize and analyze portfolios using advanced objective functions and constraints. Supports rebalancing strategies, scheduled cash flows (DCA), ad-hoc transactions, and out-of-sample evaluation.
Objective Functions:
max_sharpe, max_sortino, max_return, min_vol, min_var, min_cvar, min_drawdown,
risk_parity, max_diversification, hierarchical_risk_parity
Usage Example: Optimization with Out-of-Sample Evaluation
from finalytics import Portfolio
# Optimize on 2023 - 2024 data (in-sample)
portfolio = Portfolio(
ticker_symbols=["NVDA", "GOOG", "AAPL", "MSFT", "BTC-USD"],
benchmark_symbol="^GSPC",
start_date="2023-01-01",
end_date="2024-12-31",
interval="1d",
confidence_level=0.95,
risk_free_rate=0.02,
objective_function="max_sharpe"
)
portfolio.report("optimization")
# Update to 2025 data for out-of-sample evaluation
portfolio.update_dates("2025-01-01", "2026-01-01")
portfolio.performance_stats()
portfolio.report("performance")
Usage Example: Explicit Allocation with Rebalancing and DCA
from finalytics import Portfolio
portfolio = Portfolio(
ticker_symbols=["AAPL", "MSFT", "NVDA", "BTC-USD"],
benchmark_symbol="^GSPC",
start_date="2023-01-01",
end_date="2024-12-31",
interval="1d",
confidence_level=0.95,
risk_free_rate=0.02,
weights=[25000.0, 25000.0, 25000.0, 25000.0],
rebalance_strategy={"type": "calendar", "frequency": "quarterly"},
scheduled_cash_flows=[
{
"amount": 2000.0,
"frequency": "monthly",
"start_date": None,
"end_date": None,
"allocation": "pro_rata"
}
]
)
portfolio.report("performance")
Usage Example: Optimization with Weight & Categorical Constraints
from finalytics import Portfolio
portfolio = Portfolio(
ticker_symbols=["AAPL", "MSFT", "NVDA", "JPM", "XOM", "BTC-USD"],
benchmark_symbol="^GSPC",
start_date="2023-01-01",
end_date="2024-12-31",
interval="1d",
confidence_level=0.95,
risk_free_rate=0.02,
objective_function="max_sharpe",
# Per-asset bounds: (lower, upper) in the same order as ticker_symbols
asset_constraints=[
(0.05, 0.40), # AAPL
(0.05, 0.40), # MSFT
(0.05, 0.40), # NVDA
(0.05, 0.30), # JPM
(0.05, 0.20), # XOM
(0.05, 0.25), # BTC-USD
],
# Categorical constraints: (name, category_per_symbol, weight_per_category)
categorical_constraints=[
(
"Sector",
["Tech", "Tech", "Tech", "Finance", "Energy", "Crypto"],
[
("Tech", 0.30, 0.60),
("Finance", 0.05, 0.30),
("Energy", 0.05, 0.20),
("Crypto", 0.05, 0.25),
],
),
(
"Asset Class",
["Equity", "Equity", "Equity", "Equity", "Equity", "Crypto"],
[
("Equity", 0.70, 0.95),
("Crypto", 0.05, 0.30),
],
),
],
)
portfolio.report("optimization")
5. Custom Data
Load your own price data from CSV files as Polars DataFrames and use it with any Finalytics module.
DataFrames must have columns: timestamp (unix epoch i64), open, high, low, close, volume, adjclose.
Usage Example:
import polars as pl
from finalytics import Ticker, Tickers, Portfolio
# Load data from CSV files
aapl = pl.read_csv("examples/datasets/aapl.csv")
msft = pl.read_csv("examples/datasets/msft.csv")
nvda = pl.read_csv("examples/datasets/nvda.csv")
goog = pl.read_csv("examples/datasets/goog.csv")
btcusd = pl.read_csv("examples/datasets/btcusd.csv")
gspc = pl.read_csv("examples/datasets/gspc.csv")
# Single Ticker from custom data
ticker = Ticker(
symbol="AAPL",
benchmark_symbol="^GSPC",
confidence_level=0.95,
risk_free_rate=0.02,
ticker_data=aapl,
benchmark_data=gspc
)
ticker.report("performance")
# Multiple Tickers from custom data
tickers = Tickers(
symbols=["NVDA", "GOOG", "AAPL", "MSFT", "BTC-USD"],
benchmark_symbol="^GSPC",
confidence_level=0.95,
risk_free_rate=0.02,
tickers_data=[nvda, goog, aapl, msft, btcusd],
benchmark_data=gspc
)
tickers.report("performance")
# Portfolio optimization from custom data
portfolio = Portfolio(
ticker_symbols=["NVDA", "GOOG", "AAPL", "MSFT", "BTC-USD"],
benchmark_symbol="^GSPC",
confidence_level=0.95,
risk_free_rate=0.02,
objective_function="max_sharpe",
tickers_data=[nvda, goog, aapl, msft, btcusd],
benchmark_data=gspc
)
portfolio.report("optimization")
📚 Documentation
- See the Quarto documentation for full details.
🗂️ Multi-language Bindings
Finalytics is also available in:
Finalytics — Modular, high-performance financial analytics for Python.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file finalytics-0.9.0.tar.gz.
File metadata
- Download URL: finalytics-0.9.0.tar.gz
- Upload date:
- Size: 197.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c3299b3adb6dd7afdbcffdb065d6024a6195f3fe2a35fae5bac244f11242c61
|
|
| MD5 |
2d249dc7724b80de29e25a8058e9085d
|
|
| BLAKE2b-256 |
a92d9b0a2f5a4b989bd30cba707499496c4056c48ccaf6c18b6f28900a77ee7b
|
File details
Details for the file finalytics-0.9.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: finalytics-0.9.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 19.8 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0433d439690dc02bdbaac8e229be7c3f2f1d727e676ffe6f61afe7283a85e7d6
|
|
| MD5 |
ada69d49ef2b373bf408351619e1d2a1
|
|
| BLAKE2b-256 |
95b5801beba1123810debc4cb7e2cf37bde631ea17fb7e6b9a1134687c65a12e
|
File details
Details for the file finalytics-0.9.0-cp313-cp313-win32.whl.
File metadata
- Download URL: finalytics-0.9.0-cp313-cp313-win32.whl
- Upload date:
- Size: 16.8 MB
- Tags: CPython 3.13, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a98bfbd8a113c8d676d02597102306dc832502a38e326337768e12cb7b0bf16a
|
|
| MD5 |
3db301b678eaac2235175a142ff05fd2
|
|
| BLAKE2b-256 |
49816f12ab71cb94836cdbfcea8cd84a1332bf900efdfb531c11f4e8d04b6e6c
|
File details
Details for the file finalytics-0.9.0-cp313-cp313-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: finalytics-0.9.0-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 20.0 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9397077003e97c79be8f66a8657cb321b251de8121b654ba1e0fb32059255da
|
|
| MD5 |
0ba644afe7c4d29fbcc6452b80f35122
|
|
| BLAKE2b-256 |
79ba519d21332c387592fe004c3563d86d0c5d5f4e0917d4e6c474201621ef88
|
File details
Details for the file finalytics-0.9.0-cp313-cp313-macosx_10_13_universal2.whl.
File metadata
- Download URL: finalytics-0.9.0-cp313-cp313-macosx_10_13_universal2.whl
- Upload date:
- Size: 33.2 MB
- Tags: CPython 3.13, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aedd489dabb9fc129997838686e0e13f6f98887f49d127ec06647bf68894bae
|
|
| MD5 |
6462824d955f2c1225a92a251dd7063e
|
|
| BLAKE2b-256 |
19cfcf09f2ac802e3b562d29fc4d366db92919091cef40cdcb6f0050c22079e8
|
File details
Details for the file finalytics-0.9.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: finalytics-0.9.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 19.8 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9e7a8744cf82aaa0e200b0e6027498e5ba5fb89f886c019121b1acec742318f
|
|
| MD5 |
7db9e0ab672ff7339344a922a54d7aba
|
|
| BLAKE2b-256 |
4c0455c4924b99aa31b56f39d1780236ead94dfa572a706e9d8255db1a959937
|
File details
Details for the file finalytics-0.9.0-cp312-cp312-win32.whl.
File metadata
- Download URL: finalytics-0.9.0-cp312-cp312-win32.whl
- Upload date:
- Size: 16.8 MB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c5bb647ec4a190a459775df97d271fb864f425bdcb4e5c083e3afbb9efd75cd
|
|
| MD5 |
6a0c82e23caee4715d7fb34fc9ccd265
|
|
| BLAKE2b-256 |
641ca5a7427ef0b27e1f84646fa11710dbf2ec1a2192230e7e2b9fd4232ab596
|
File details
Details for the file finalytics-0.9.0-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: finalytics-0.9.0-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 20.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fd3f27950724edf7d45644ecdbb728857f004f6525ba2c684994297355a2a71
|
|
| MD5 |
87ee92b8ff47bf9f9d19c67ccf56e18d
|
|
| BLAKE2b-256 |
92b8c9d4c650ff0d4fff1133bd81bf68e97d4350919f8317206ff920831f8452
|
File details
Details for the file finalytics-0.9.0-cp312-cp312-macosx_10_13_universal2.whl.
File metadata
- Download URL: finalytics-0.9.0-cp312-cp312-macosx_10_13_universal2.whl
- Upload date:
- Size: 33.2 MB
- Tags: CPython 3.12, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
196c2e08e435fa0953b9d0f2db5da59d5995d6c4d1e3b5997fb207de40471ebb
|
|
| MD5 |
bfabc66361ae257eb92adc691ce79f8a
|
|
| BLAKE2b-256 |
c56759f71577a9e0586f627d27679df33ffa5d7b5ff9e3debf3cc0e3fecf369c
|
File details
Details for the file finalytics-0.9.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: finalytics-0.9.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 19.8 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
906bce2b1128965aef366bda4845ee18da36d24cbc6a378a3b15bd27cf5555f1
|
|
| MD5 |
31aeb42fd84fc96a646618a6e72454d3
|
|
| BLAKE2b-256 |
c730c1d08fe7a909e638a916b0eb1bdc192f46c2c96b20e3cad5110aae40bac5
|
File details
Details for the file finalytics-0.9.0-cp311-cp311-win32.whl.
File metadata
- Download URL: finalytics-0.9.0-cp311-cp311-win32.whl
- Upload date:
- Size: 16.8 MB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
061d5bd35a875f617bab3f53aa4a9230669856884f7fc3ac92c2e044ec506e3b
|
|
| MD5 |
68b3138ce500350edb7ddedd7e315e06
|
|
| BLAKE2b-256 |
024adc0dd90afa12130feead741490fdbaefbb7921743b96c68c02abfa091fac
|
File details
Details for the file finalytics-0.9.0-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: finalytics-0.9.0-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 20.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b44a8c301666250a60d3bf2f8bb93d84f871dfc1412d39f1e2765dc0d4603527
|
|
| MD5 |
cd72469aa15dd0177fb0cea25ed9ae19
|
|
| BLAKE2b-256 |
90e3281a8f62d25fc8252f3d76e6ccffc0eab456c360b78c880a6484f2f5ee8c
|
File details
Details for the file finalytics-0.9.0-cp311-cp311-macosx_10_13_universal2.whl.
File metadata
- Download URL: finalytics-0.9.0-cp311-cp311-macosx_10_13_universal2.whl
- Upload date:
- Size: 33.2 MB
- Tags: CPython 3.11, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3717d1d14d01f34d99685b847fd43d0702f48606a09dbb0b330eff241560518d
|
|
| MD5 |
47a2928ff5834b4b6533612084707bf9
|
|
| BLAKE2b-256 |
617e0ee7d08304b8cea3cc6133a4a9357073f24790ec4827afd048bc8266e511
|
File details
Details for the file finalytics-0.9.0-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: finalytics-0.9.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 19.8 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e64d5a5c031fc4b2d15738b2a20c284e5a563e3fe2fefe68a6c5429e2b5a6b7e
|
|
| MD5 |
ed3fca8b653b74dda4d37feafa1c2b19
|
|
| BLAKE2b-256 |
9bb15de4d85571db62329263475ba597553b171d141effc5d34715fe4473aff5
|
File details
Details for the file finalytics-0.9.0-cp310-cp310-win32.whl.
File metadata
- Download URL: finalytics-0.9.0-cp310-cp310-win32.whl
- Upload date:
- Size: 16.8 MB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a72cb925a570a7f9ca59338e7bb2f1e27bc98e4fb8ce43dc6dcee6db67aa8956
|
|
| MD5 |
b954ca767c0f47db116369b3a4282375
|
|
| BLAKE2b-256 |
d600bfab752182454080f7d1e787f4d270c35d11c192ec16d6eb6e7cdbd46daf
|
File details
Details for the file finalytics-0.9.0-cp310-cp310-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: finalytics-0.9.0-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 20.0 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eae9f1fcb6b3e0dd9b7378f09a4eed5da15bc87a284898a154def967827d7b5e
|
|
| MD5 |
6d88f40e99162a05b1d556276bbba4b2
|
|
| BLAKE2b-256 |
7597c362e0e339464c4ef757249f56e519ce9c5db1219458e42c0cd92094d8c4
|
File details
Details for the file finalytics-0.9.0-cp310-cp310-macosx_10_13_universal2.whl.
File metadata
- Download URL: finalytics-0.9.0-cp310-cp310-macosx_10_13_universal2.whl
- Upload date:
- Size: 33.2 MB
- Tags: CPython 3.10, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30b46159e37cffc89dcb89d13f4bb10124432a5d297334a11c99b23556530846
|
|
| MD5 |
28e6e3add9d1d4d938682b7850cb6fb5
|
|
| BLAKE2b-256 |
bbb50708ce02f51c89d2cbc3d4ada8c574fb9169167b863fd137765ca4010440
|
File details
Details for the file finalytics-0.9.0-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: finalytics-0.9.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 19.8 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adae523be09222028b8cf5507c62e0fdde4a16ac98d18588357e83f943571719
|
|
| MD5 |
c58bbc3e2b9f700a88772d32c3f073bc
|
|
| BLAKE2b-256 |
d134e6f1ea015981426979745f2863be7946d626d311fe6fe57b835af9c4d663
|
File details
Details for the file finalytics-0.9.0-cp39-cp39-win32.whl.
File metadata
- Download URL: finalytics-0.9.0-cp39-cp39-win32.whl
- Upload date:
- Size: 16.8 MB
- Tags: CPython 3.9, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35667a41923ddaef824bfbee04a59000fd1a14d610086b2b90cccd333013abd5
|
|
| MD5 |
e7781930a0d42b0a4596cd269988554b
|
|
| BLAKE2b-256 |
53953b03b083901ba895367125e4a50c0e47db4f82bda969e92eb905f1b4bbce
|
File details
Details for the file finalytics-0.9.0-cp39-cp39-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: finalytics-0.9.0-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 20.0 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba102535fe0539c99afa4b202a1eb50fc8fe3639c09d1ccb563446faa220d980
|
|
| MD5 |
26e73226955bce18568bce197d9df3ef
|
|
| BLAKE2b-256 |
086fd6ef896ae604813bb44dcbbaa36555531ceee857d6b84b94baea84971b96
|
File details
Details for the file finalytics-0.9.0-cp39-cp39-macosx_10_13_universal2.whl.
File metadata
- Download URL: finalytics-0.9.0-cp39-cp39-macosx_10_13_universal2.whl
- Upload date:
- Size: 33.2 MB
- Tags: CPython 3.9, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08a19c4fdf76c236190e2808d726202c166f149e836bfd4f34e674b823544389
|
|
| MD5 |
bfa79a7869373db08a8ef21bd946dbfb
|
|
| BLAKE2b-256 |
2f54cd387cb3774b7a81e93b42ee3e41df410e1249fb48c8383a3268ac0b736c
|