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.11 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 DBやJ-QuantsなどのAPIキーを secret backend を使用して管理します。

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

事前に各公式サイト(J-Quants / 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 DB API キーの登録
pass insert ednetdb/api/EDNET_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 DB API キーの登録
secret-tool store \
    --label="Kabutam EDINET DB API Key" \
    service kabutam \
    username EDNET_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 19670

# ポートフォリオ表示
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%
===============================================================================================

License

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kabutam-0.1.8.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

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

kabutam-0.1.8-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

Details for the file kabutam-0.1.8.tar.gz.

File metadata

  • Download URL: kabutam-0.1.8.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for kabutam-0.1.8.tar.gz
Algorithm Hash digest
SHA256 5400a5bb664f1b3e8b44547604a5eca5d26e82f04f0af2caa578e295cba4ea22
MD5 e91aca8d3746610001a4d112154e3943
BLAKE2b-256 68f7a80b605ae2fb79b1912cd9b58f3c0c4211bfaeea18352cc46b5d1077e60f

See more details on using hashes here.

Provenance

The following attestation bundles were made for kabutam-0.1.8.tar.gz:

Publisher: release.yml on tonrl/kabutam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kabutam-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: kabutam-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 42.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for kabutam-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c74e65c1a16fe68f8fbd1f6274a0dac0c139e7338da0872e4f1af9ebf6e08da4
MD5 2db3a7e9051bdda9d0d6d2f5bbad55cb
BLAKE2b-256 ab8316fca0ca993620e4b7df8753b3899ef501bccd800a50313a0a20635c5d98

See more details on using hashes here.

Provenance

The following attestation bundles were made for kabutam-0.1.8-py3-none-any.whl:

Publisher: release.yml on tonrl/kabutam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.9

2 files

This release

0.1.8 This release

2 files

0.1.7

2 files

0.1.6

2 files

0.1.4

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page