Skip to main content

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)

Metadata

Release files for kessan 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kessan 0.0.1
File Size Uploaded Provenance Actions
kessan-0.0.1.tar.gz 62.9 kB Without provenance Details for kessan-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kessan 0.0.1
File Interpreter ABI Platform Actions
kessan-0.0.1-py3-none-any.whl Python 3 none any Details for kessan-0.0.1-py3-none-any.whl

Total release size: 97.3 kB

Release files / kessan-0.0.1.tar.gz

Download URL kessan-0.0.1.tar.gz
Size 62.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b7077ba2d6232bf2906acbdd349615beebdecf97ac702fc738972b029656cf98
BLAKE2b-256 checksum
How to use checksums
6bd6a38678f4205a3839c6f648f650ae368a2e0ffc533b0c6a80d07181c45e02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / kessan-0.0.1-py3-none-any.whl

Download URL kessan-0.0.1-py3-none-any.whl
Size 34.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be6ffab45decac25cfae03e914a1110a6d3a2f4b823b0683453f3f8b110513ef
BLAKE2b-256 checksum
How to use checksums
af7dbc6ec5ebea7163435a30a22281674598a2e688641c619937e8088aa8d557
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for kessan 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page