Skip to main content

nordpy

nordpy

A terminal UI for browsing and exporting your Nordnet portfolio data.
PyPI - Version

Python versions prek uv Ruff ty tox Pydantic Pydantic
CI Release to PyPI


[!CAUTION] Disclaimer – This tool is provided as-is, with no warranty of any kind. Use it at your own risk.

This project is not affiliated in any way with Nordnet nor MitID.

The author assumes no liability for any loss, damage, or misuse arising from the use of this software. You are solely responsible for securing any exported data and ensuring it is only accessible to you.

Features

  • Browse accounts, balances, holdings, transactions, trades, and orders
  • Portfolio value chart and instrument price charts in the terminal
  • Sparkline trends on holdings (3-month price history via yfinance)
  • Export data to CSV, Excel, or DuckDB
  • Session persistence with automatic re-authentication
  • Headless export mode (no TUI) for scripting
  • SOCKS5 proxy support

How It Works

nordpy authenticates with Nordnet through the same MitID flow your browser uses – it simply performs the login via Nordnet's API directly from the terminal, rather than through a web page. Once authenticated, it fetches your portfolio data using Nordnet's standard API endpoints.

[!IMPORTANT] Privacy – nordpy does not collect, transmit, or store any of your personal information. Your credentials are sent directly to MitID and Nordnet – never to any third-party server. No telemetry, analytics, or external services are involved.

Session cookies are saved locally, 0600, solely to avoid repeated logins:

where
session $XDG_CONFIG_HOME/nordpy/nordnet-session.json, or ~/.config/nordpy/…
log $XDG_STATE_HOME/nordpy/nordpy.log, or ~/.local/state/nordpy/…

Both are the same place on every run. nordpy --logout deletes the session.

Quickstart

# Run with Python 3.10–3.13 and replace <your-mitid-username> with your MitID username
uvx --python 3.13 nordpy --user <your-mitid-username>

Using nordpy (step by step with screenshots)

Sign in with your MitID username
Step 1
Approve the login on your MitID app, then enter your CPR number if prompted
Step 2
If you have authorized correctly, you will see a confirmation message
Step 3
You are now logged in and will see your list of accounts
Step 4
Select an account to view its holdings
Step 5
View the transactions for the selected account
Step 6
See the price history for the selected instrument in your holdings
Step 7

Requirements

  • Python 3.10–3.13
  • A Nordnet account with MitID (Danish)

Installation

nordpy is a command-line tool, not a library. There is nothing here worth importing, so the way to run it is the way you run any other tool:

uvx nordpy --user <your-mitid-username>

That fetches it, runs it, and leaves nothing behind. If you use it often:

uv tool install nordpy        # or: pipx install nordpy
nordpy --user <your-mitid-username>

[!TIP] uv add nordpy would work, but it is not what this is for. Adding a TUI that logs you in with MitID to a project's dependencies buys you nothing and ties that project to everything nordpy pulls in.

Usage

Interactive TUI

nordpy --user <your-mitid-username>

# Force re-authentication (ignore saved session)
nordpy --user <your-mitid-username> --force-login

# Verbose logging (debug output to stderr, and the log path printed)
nordpy --user <your-mitid-username> --verbose

# Delete saved session and exit
nordpy --logout

[!NOTE] The first time you log in, you may be prompted to enter your CPR number as part of the MitID verification process. This is a one-time step required by MitID to link your identity – subsequent logins will skip this.

Headless Export

nordpy --user <your-mitid-username> --export csv
nordpy --user <your-mitid-username> --export xlsx
nordpy --user <your-mitid-username> --export duckdb

# Export to a specific folder
nordpy --user <your-mitid-username> --export csv --output-dir ~/my-exports

Exported files are saved to the exports/ directory.

[!WARNING] Exported files contain sensitive financial data. Make sure you do not share these filesnor commit them to version control. Keep your exports in a secure location accessible only to you.

Keybindings

Key Action
Enter Select account / view instrument chart
Tab Switch between tabs
e Export current view
r Refresh data
Backspace / Esc Go back / quit
q Quit

Development

git clone https://github.com/kiliantscherny/nordpy.git
cd nordpy
uv sync --dev

Running checks

# Run all checks (tests on Python 3.10–3.13, lint, type check)
uv run tox

# Run tests only
uv run pytest

# Run tests with coverage
uv run pytest --cov=nordpy --cov-report=term-missing

# Lint
uv run ruff check .

# Type check
uv run ty check

License

This project is licensed under the MIT License.

Acknowledgments

This project includes code from MitID-BrowserClient by Hundter, licensed under the MIT License.

Credit also to Morten Helmstedt for the groundwork of looking into this.

Metadata

Release files for nordpy 1.4.0

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

Source distribution (sdist)

Source distribution for nordpy 1.4.0
File Size Uploaded
nordpy-1.4.0.tar.gz 49.1 kB Details

Built distribution (wheel)

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

Total release size: 112.1 kB

Release files / nordpy-1.4.0.tar.gz

Download URL nordpy-1.4.0.tar.gz
Size 49.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9392c6b5ffcddc4531ccbb5cf48879a5a87996d9b2ef61e0d447bdf1347cfe36
BLAKE2b-256 checksum
How to use checksums
58451acf4147f7f9655d269f82cefb56e22a345f6b48d7913862bd4a6f71ac85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nordpy-1.4.0-py3-none-any.whl

Download URL nordpy-1.4.0-py3-none-any.whl
Size 63.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6865d79db9ad3a37416fcdd511952ec977565af02ba27072aab0e5820a683ffd
BLAKE2b-256 checksum
How to use checksums
fafcc7e47c9e25b4de334f38036becdbf4894282006e5347641dbdbc145d698b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

0.2.0

2 release files

0.1.0

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