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.2.0.tar.gz (151.7 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.2.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: japan_finance_factors-0.2.0.tar.gz
  • Upload date:
  • Size: 151.7 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.2.0.tar.gz
Algorithm Hash digest
SHA256 d029b3c377611d96c8eff8f117fd7252104cbb9cf8d843325b42e2a51fc61a13
MD5 4440364e2a163c9ef9eae52bd0e3919f
BLAKE2b-256 86ee9f98f54f0e93792ef4356b1a31c4ad64ed2a38d1528febd6b9ea924ede8f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: japan_finance_factors-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7ca228cbd6dfe767efb3bd31b48d32030e681e4e0ecd423ac8c71ffeceb50e8
MD5 5f930d438736de61ced2dca1ee428bde
BLAKE2b-256 4e8f80f2dc02954654400d6faf403899e3c7f81745cd256e567cecd5fb7c4f88

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