Skip to main content

kabutam

Terminal-based stock and portfolio tracking tool for Japanese stocks.

Features

  • Fetch and manage Japanese stock data
  • Track your portfolio directly from the terminal
  • Lightweight and easy to use

Prerequisites

  • Python 3.12 or later
  • Git (ソースからのインストール時)
  • pass (pass を使用する場合)
  • libsecret (secret-tool) (Secret Serviceを使用する場合)

Installation

For Arch Linux (via AUR)

AUR ヘルパーを使用する場合 (推奨)

yay -S kabutam
# または
paru -S kabutam

PKGBUILDからビルドする場合

git clone https://aur.archlinux.org/kabutam.git
cd kabutam
makepkg -si

PyPIからのインストール

pip install kabutam

For Development (Virtual Environment)

git clone https://codeberg.org/tonrl/kabutam.git
cd kabutam
python -m venv .venv
source .venv/bin/activate
pip install -e .

Configuration

Kabutamでは、EDINET、EDINET DBやJ-QuantsなどのAPIキーを secret backend を使用して管理します。

デフォルトでは pass を使用しますが、D-Bus Secret Service APIに対応したパスワードマネージャーも利用できます。

事前に各公式サイト(J-Quants / EDINET /EDINET DB)等でAPIキーを取得し、選択したsecret backend に登録してください

pass (デフォルト)

J-QuantsおよびEDINET DBのAPIキーを取得し、pass に登録してください。

APIキーの登録

J-Quants API キーの登録
pass insert jpx-jquants.com/api/JPX_JQUANTS_API_KEY
EDINET (金融庁) API キーの登録
pass insert edinet-fsa/api/EDINET_FSA_API_KEY
EDINET DB API キーの登録
pass insert edinetdb/api/EDINET_DB_API_KEY

設定ファイルを作成しない場合、pass がデフォルトで使用されます。

Secret Service対応パスワードマネージャー

pass の代わりに、D-Bus Secret Service APIに対応した パスワードマネージャーを利用できます。

対応例:

Kabutam はこれらのパスワードマネージャーと直接連携するのではなく、D-Bus Secret Service APIを通じてsecretを取得します。

APIキーの登録

J-Quants API キーの登録
secret-tool store \
    --label="Kabutam J-Quants API Key" \
    service kabutam \
    username JPX_JQUANTS_API_KEY
EDINET (金融庁) API キーの登録
secret-tool store \
    --label="Kabutam EDINET DB API Key" \
    service kabutam \
    username EDINET_FSA_API_KEY
EDINET DB API キーの登録
secret-tool store \
    --label="Kabutam EDINET DB API Key" \
    service kabutam \
    username EDINET_DB_API_KEY

Secret Serviceを使用する場合は、Kabutamの設定ファイルでSecret Service backendを選択してください。

Configuration file

設定ファイルはXDG Base Directory Specificationに従い、通常は以下に配置されます。

~/.config/kabutam/config.toml
[secrets]
backend = "secretservice"

[secrets.secretservice]
service = "kabutam"

service の値はSecret Serviceに登録した service 属性と一致している必要があります。

Usage

# ヘルプの表示
kabutam --help

# 初期化設定
kabutam --init

# 銘柄の検索・表示
kabutam -C 72030

# ポートフォリオ表示
kabutam --portfolio

# ライセンス情報の表示
kabutam --license

Example output

$ kabutam --portfolio

===============================================================================================
ポートフォリオ
===============================================================================================
Code    Company                 Account      Shares     Avg Price         Price           Value
-----------------------------------------------------------------------------------------------
XXXXX   サンプルホールディングス 特定         1,200        190.47        233.80         280,560
XXXXX   テストカンパニー         特定           100      2,401.75      3,002.00         300,200
XXXXX   テストカンパニー         NISA           100      2,300.00      3,002.00         300,200
XXXXX   サンプル電鉄             特定           100      2,708.00      2,959.50         295,950
XXXXX   サンプル通信             NISA           100        144.00        166.10          16,610
-----------------------------------------------------------------------------------------------
取得総額       : 1,292,520 円
保有資産額     : 1,392,520 円
評価損益       : +100,000 円
評価損益率     : +7.74%
===============================================================================================
年間配当金(税引前): 45,000 円
年間配当金(税引後): 35,858 円
配当利回り(取得額ベース): 3.48%
配当利回り(評価額ベース): 3.23%
===============================================================================================
$kabutam --market prime --sector 陸運業 --index large70

================================================================================
指数: TOPIX Large70 / 市場: プライム / 業種: 陸運業 — 3銘柄
================================================================================
Code    Company                       Industry
--------------------------------------------------------------------------------
90200   東日本旅客鉄道                 陸運業
90210   西日本旅客鉄道                 陸運業
90220   東海旅客鉄道                   陸運業

License

This project is licensed under the GNU General Public License v3.0 or later - see the LICENSE file for details.

Metadata

Release files for kabutam 0.2.3

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

Source distribution (sdist)

Source distribution for kabutam 0.2.3
File Size Uploaded
kabutam-0.2.3.tar.gz 55.2 kB Details

Built distribution (wheel)

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

Total release size: 116.5 kB

Release files / kabutam-0.2.3.tar.gz

Download URL kabutam-0.2.3.tar.gz
Size 55.2 kB
Tags Source
SHA-256 checksum
How to use checksums
babe755a8797847fdbc54c9697f0a00e420892632a837ac7283ea4b4a7f98883
BLAKE2b-256 checksum
How to use checksums
40a0305ceeea758c31b4d829f7e104814946a1b9c1fbe1a043f1663f056506c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log

Release files / kabutam-0.2.3-py3-none-any.whl

Download URL kabutam-0.2.3-py3-none-any.whl
Size 61.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a423af305eb318cb7c08394172d850d896411c91918e8a98843f4bf57a25c995
BLAKE2b-256 checksum
How to use checksums
9a528c0ef723753fc28341eab0902439e558db50b7830b762d288904aa36a7f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

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