Quantitative factor calculation for Japanese equities with PIT safety
Project description
japan-finance-factors
Quantitative factor calculation for Japanese equities with point-in-time (PIT) safety.
Features
- 10 quantitative factors across 4 categories (value, momentum, quality, risk)
- PIT-safe: All calculations respect point-in-time constraints to prevent lookahead bias
- Lightweight: Only depends on pydantic; data source integrations are optional
- Optional integrations: Convenience wrappers for edinet-mcp and stockprice-mcp
Installation
pip install japan-finance-factors
# With optional data source integrations
pip install japan-finance-factors[all]
Quick Start
from datetime import datetime
from japan_finance_factors import compute_factors, FinancialData, PriceData
# Prepare financial data (JPY units)
fd = FinancialData(
ticker="7203",
revenue=45_000_000_000_000,
net_income=2_800_000_000_000,
operating_income=3_500_000_000_000,
total_assets=90_000_000_000_000,
total_equity=35_000_000_000_000,
operating_cf=4_500_000_000_000,
capex=-1_800_000_000_000,
market_cap=50_000_000_000_000,
published_at=datetime(2025, 6, 25),
)
# Compute all factors
result = compute_factors(
financial_data=fd,
as_of=datetime(2025, 7, 1),
)
print(result.to_dict())
# {'ev_ebitda': 12.77, 'fcf_yield': 0.054, 'earnings_yield': 0.056, ...}
Factors
| Category | Factor | Description |
|---|---|---|
| Value | ev_ebitda |
Enterprise Value / EBITDA |
| Value | fcf_yield |
Free Cash Flow / Market Cap |
| Value | earnings_yield |
Net Income / Market Cap |
| Value | book_to_market |
Book Value / Market Cap |
| Momentum | mom_3m |
3-month price return |
| Momentum | mom_12m |
12-month price return (12-1 convention) |
| Quality | piotroski_f_score |
Piotroski F-Score (0-9) |
| Quality | accruals_ratio |
(Net Income - Operating CF) / Total Assets |
| Risk | realized_vol_60d |
60-day annualized volatility |
| Risk | max_drawdown_252d |
Maximum drawdown over 252 trading days |
License
Apache-2.0
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
japan_finance_factors-0.2.1.tar.gz
(151.8 kB
view details)
Built Distribution
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 japan_finance_factors-0.2.1.tar.gz.
File metadata
- Download URL: japan_finance_factors-0.2.1.tar.gz
- Upload date:
- Size: 151.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b16b9dd7dd2382d3ece25cf0b440cf8bcf4ea2d465c6a987f6e0c54a956f0720
|
|
| MD5 |
4464c6b2a5d023781906dae7663a40d4
|
|
| BLAKE2b-256 |
6c87edc101ea992f2b2937ea684db97d122582b746263b008112ad6f3bfc9251
|
File details
Details for the file japan_finance_factors-0.2.1-py3-none-any.whl.
File metadata
- Download URL: japan_finance_factors-0.2.1-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8d468ff6d1bf4c4fa44a9d8020b4a5d3729ddbc9839027334d94207f14ba5ad
|
|
| MD5 |
695d34a730e02db4d76a1bf3de7374f4
|
|
| BLAKE2b-256 |
999eca358786d49f7bf899e3251cb1cc8610c9d9a76469f470f88896632e2d1f
|