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.0.tar.gz (149.0 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.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: japan_finance_factors-0.1.0.tar.gz
  • Upload date:
  • Size: 149.0 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.0.tar.gz
Algorithm Hash digest
SHA256 415fc6d6c325ef7d9e177c8dcb55c2e12d518566c02ed5d1cfc8f2b34f5daa36
MD5 0c64b3d99f46ccedb30ceeb93d3528fd
BLAKE2b-256 b79d65c3023fd286e910a4f4906f9536c4bbeda93449079170b77b1b6d91a843

See more details on using hashes here.

File details

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

File metadata

  • Download URL: japan_finance_factors-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ab332528bee06d6c41596b4b19efbcc1daf96d67d2a33da12361b5e862c2ad2
MD5 e098269fafed694b14c14578a410886b
BLAKE2b-256 c2f9c0c3422001fcafef52ed45a794ec71295d15c6c4e197ec1f383625f93438

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