Skip to main content

NISA Account Tracker

Track a Japanese NISA account: import purchase history exported from the SBI Securities website, fetch daily fund NAV from the Fund Library, and view on a local web dashboard the current value, historical value/profit graph, NISA limit usage, and a 10-year forecast. UI is available in Japanese and English.

Files

  • input.csv — purchase history exported from SBI Securities (see below)
  • db.py — SQLite storage, CSV import, valuation, NISA limit usage, forecast
  • fetch.py — downloads daily NAV from toushin-lib.fwg.ne.jp into the DB
  • app.py — Flask web app
  • nisa.db — SQLite database (created on first run; delete to start over)

Export purchases from SBI Securities

SBI証券 のマイページ → 取引・投信 → 「取引履歴」から絞り込んでCSVダウンロードします。 The exported file should have these columns, in this order:

約定日,銘柄,銘柄コード,市場,取引,期限,預り,課税,約定数量,約定単価,手数料/諸経費等,税額,受渡日

Save it as input.csv in this folder (replace the bundled sample).

Notes:

  • Dates use M/D/Y (e.g. 8/4/2026 = 2026-08-04). The import assumes this format; it is NOT D/M/Y.
  • 銘柄 is matched by normalizing spaces and case, so you can keep the full-width names as exported (eMAXIS Slim 米国株式(S&P500)).
  • 約定単価 is the NAV per 10,000 units (万口), so invested cost is computed as 約定数量 × 約定単価 ÷ 10,000.
  • Rows are deduplicated on (date, fund, quantity, unit price, account); re-importing the same file is safe.

Each fund needs an entry in db.FUNDS (ISIN + Fund Library code). The bundled eMAXIS Slim funds are already mapped; add new ones there. The CSV import explains which names could not be matched.

Setup

python3 -m venv .venv
.venv/bin/pip install -e .

This installs Flask + requests into the venv (requirements live in pyproject.toml) and provides the nisa-app / nisa-fetch commands.

Run

.venv/bin/python app.py

Opens at http://localhost:5000.

On startup the app imports input.csv (only when the DB is empty), refreshes prices, then keeps refreshing in the background every 24h. Use the 「価格更新」 button to refresh manually.

Using the dashboard

  • Cards show total invested, current value, and profit (¥ and %, green/red).
  • Value graph plots total value and total profit with 1Y / 5Y / All buttons to set the time range (no reload, instant).
  • Tsumitate simulation (stacked chart): cumulative invested over time plus a 10-year projection at the monthly amounts and assumed annual return from the forecast settings; projected profit is stacked on top of invested.
  • NISA limits show yearly usage for つみたて/成長/combined vs. the new-NISA caps, including a forecast of when you would exceed them.
  • Forecast (10 years) shows projected value, contributions, and profit from the settings below it.
  • Forecast settings (monthly つみたて amount, monthly 成長 amount, assumed annual return) are editable on the page and stored in the DB.
  • Buy a fund (+ button or POST /api/buy with {"date":"YYYY-MM-DD","amount":100000,"fund":"<ISIN>"}) adds a purchase using the fund's NAV on or before that date; duplicates are rejected. Costs count against NISA limits by account type.

CLI tools

  • Import / refresh manually:
    .venv/bin/python db.py -i input.csv      # import purchases
    .venv/bin/python fetch.py                # fetch latest NAV for all funds
    
  • Or use the installed commands: nisa-app / nisa-fetch.

NISA limits (new NISA)

  • Tsumitate yearly: ¥1,200,000
  • Growth yearly: ¥2,400,000
  • Combined yearly: ¥3,600,000
  • Lifetime: ¥18,000,000 (growth: ¥12,000,000)

Constants live in db.py.

Download files

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

Source Distribution

nisa_tracker-0.1.0.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

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

nisa_tracker-0.1.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nisa_tracker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c1de03680dbeb17d6258c6c4e1f6022be7e7b519db5df346081d06321e0a9754
MD5 eb3672f6865f6baa2ff3956124575fa5
BLAKE2b-256 2a9457f72fef711b0741674333a221bce2582ef2f404088e55acb404ae4262b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for nisa_tracker-0.1.0.tar.gz:

Publisher: pypi.yml on perrinjerome/nisa-tracker

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

File details

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

File metadata

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

File hashes

Hashes for nisa_tracker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c379df3d35072e30bf31d42c674060b2bb4399711b39f48cf3ede0207a79e229
MD5 2237ae64b98e256c6543db086c64a898
BLAKE2b-256 4746ca5383d508341644a9f3073d375e1dedb42f58b7328bf8f3a2b6c1b573db

See more details on using hashes here.

Provenance

The following attestation bundles were made for nisa_tracker-0.1.0-py3-none-any.whl:

Publisher: pypi.yml on perrinjerome/nisa-tracker

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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