Skip to main content

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.1.1.tar.gz (150.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

japan_finance_factors-0.1.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file japan_finance_factors-0.1.1.tar.gz.

File metadata

  • Download URL: japan_finance_factors-0.1.1.tar.gz
  • Upload date:
  • Size: 150.6 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

Hashes for japan_finance_factors-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7db4633bdb0f38f38106e96b1d21783f114403e8502f81a5ae8dada7b750453e
MD5 2befd10b3823255e98b6ddadfefb2b9e
BLAKE2b-256 d7719bc594dd78dfa0027bf91c97a7b45af2268d9c7ea8d4d3c42c48b945fafd

See more details on using hashes here.

File details

Details for the file japan_finance_factors-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: japan_finance_factors-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.7 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

Hashes for japan_finance_factors-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 63c8f5f716c760ae5aeb40d6c07a6050e9e56cbc3939dcc0393fbf18c3f2da3a
MD5 e3ddad238d30a4d20378348181c89080
BLAKE2b-256 8e6e938d9873146a398cc0718c307fe9004286fdd9a7648fd8845b07293d746e

See more details on using hashes here.

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