Skip to main content

Python SDK for Kessan — Japan financial disclosure intelligence via DuckDB

Project description

kessan — Python SDK

Local DuckDB SDK for Kessan (coming soon) — Japan financial disclosure intelligence.

Which Kessan package do I need?

  • kessan (this package) — Query a local DuckDB file directly. For on-prem deployments and data teams running their own pipeline. No API key required.
  • kessan-client (sdk-python-http / pip install kessan-client) — HTTP client for api.kessan.io. For typical SaaS API users with an API key.

Install

pip install "kessan>=0.0.1"  # coming soon — not yet on PyPI; install from source for now
# From source: pip install duckdb>=1.0 and use the repo directly

Quickstart

Set the DB path once:

export KESSAN_DB_PATH=~/.kessan/db.duckdb
import kessan

# EDINET-only (audited annual/quarterly XBRL data — default)
rows = kessan.get_financials("E02144")
print(rows[0]["revenue"], rows[0]["src_type"])  # 48036704000000  edinet

# IR PDF only (best-effort Q1/Q3 earnings short reports — unaudited)
ir_rows = kessan.get_financials("E02144", source_types=("ir_pdf",))
print(ir_rows[0]["period_type"], ir_rows[0]["src_type"])  # Q3  ir_pdf

# UNION: both EDINET XBRL and IR PDF sources
all_rows = kessan.get_financials("E02144", source_types=("edinet", "ir_pdf"))
for r in all_rows:
    print(r["fiscal_year"], r["period_type"], r["src_type"], r["revenue"])

# Disclosure filings
filings = kessan.get_filings("E02144", doc_type=120)  # 120 = 有価証券報告書
print(filings[0]["filed_date"], filings[0]["doc_id"])

# Company search (name JP/EN, EDINET code, ticker)
hits = kessan.search_companies("トヨタ", limit=5)
print(hits[0]["name_en"], hits[0]["edinet_code"])

get_financials — source_types

source_types controls which tables are queried:

source_types Tables queried Notes
("edinet",) financials Default. EDINET XBRL, audited
("ir_pdf",) ir_financials Best-effort IR PDF Q1/Q3 short reports
("edinet", "ir_pdf") Both (UNION) Full coverage incl. post-2024 Q1/Q3

Returned columns (unified across both tables): edinet_code, ticker, fiscal_year, period_type, period_end, revenue, operating_income, ordinary_income, net_income, eps, currency, src_type, src_publisher, src_audited, src_fetched_at, src_source_url

Note: EDINET rows have period_end=None (the financials table stores only fiscal_year + period). IR PDF rows have period_end as an ISO date string.

Background: EDINET abolished Q1/Q3 quarterly filings from April 2024. IR PDF parsing fills this gap for the 10 Nikkei225 companies in the alpha cohort.

Path resolution

  1. Explicit db_path= argument
  2. KESSAN_DB_PATH env var
  3. ~/.kessan/db.duckdb (raises FileNotFoundError if missing)

Links

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

kessan-0.0.1.tar.gz (62.9 kB view details)

Uploaded Source

Built Distribution

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

kessan-0.0.1-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file kessan-0.0.1.tar.gz.

File metadata

  • Download URL: kessan-0.0.1.tar.gz
  • Upload date:
  • Size: 62.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for kessan-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b7077ba2d6232bf2906acbdd349615beebdecf97ac702fc738972b029656cf98
MD5 2bb0c3be783381b642bb7159e407e284
BLAKE2b-256 6bd6a38678f4205a3839c6f648f650ae368a2e0ffc533b0c6a80d07181c45e02

See more details on using hashes here.

File details

Details for the file kessan-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: kessan-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for kessan-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be6ffab45decac25cfae03e914a1110a6d3a2f4b823b0683453f3f8b110513ef
MD5 7ea12037e1fb16c36dd2ec69312183a0
BLAKE2b-256 af7dbc6ec5ebea7163435a30a22281674598a2e688641c619937e8088aa8d557

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