nordpy 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nordpy-0.1.0/PKG-INFO +128 -0
- nordpy-0.1.0/README.md +107 -0
- nordpy-0.1.0/pyproject.toml +45 -0
- nordpy-0.1.0/src/nordpy/.nordnet_session.json +1 -0
- nordpy-0.1.0/src/nordpy/BrowserClient/BrowserClient.py +423 -0
- nordpy-0.1.0/src/nordpy/BrowserClient/CustomSRP.py +158 -0
- nordpy-0.1.0/src/nordpy/BrowserClient/Helpers.py +96 -0
- nordpy-0.1.0/src/nordpy/BrowserClient/LICENSE +24 -0
- nordpy-0.1.0/src/nordpy/BrowserClient/__init__.py +0 -0
- nordpy-0.1.0/src/nordpy/__init__.py +3 -0
- nordpy-0.1.0/src/nordpy/__main__.py +5 -0
- nordpy-0.1.0/src/nordpy/app.py +237 -0
- nordpy-0.1.0/src/nordpy/auth.py +194 -0
- nordpy-0.1.0/src/nordpy/client.py +222 -0
- nordpy-0.1.0/src/nordpy/export.py +167 -0
- nordpy-0.1.0/src/nordpy/exports/balances.csv +5 -0
- nordpy-0.1.0/src/nordpy/exports/holdings.csv +30 -0
- nordpy-0.1.0/src/nordpy/exports/transactions.csv +454 -0
- nordpy-0.1.0/src/nordpy/models.py +202 -0
- nordpy-0.1.0/src/nordpy/screens/__init__.py +0 -0
- nordpy-0.1.0/src/nordpy/screens/accounts.py +138 -0
- nordpy-0.1.0/src/nordpy/screens/auth.py +294 -0
- nordpy-0.1.0/src/nordpy/screens/detail.py +99 -0
- nordpy-0.1.0/src/nordpy/screens/holdings.py +94 -0
- nordpy-0.1.0/src/nordpy/screens/trades.py +164 -0
- nordpy-0.1.0/src/nordpy/screens/transactions.py +199 -0
- nordpy-0.1.0/src/nordpy/session.py +83 -0
- nordpy-0.1.0/src/nordpy/styles/nordpy.tcss +133 -0
- nordpy-0.1.0/src/nordpy/widgets/__init__.py +0 -0
- nordpy-0.1.0/src/nordpy/widgets/export_dialog.py +125 -0
nordpy-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: nordpy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Interactive TUI for browsing and exporting Nordnet financial data
|
|
5
|
+
Author: Kilian Tscherny
|
|
6
|
+
Author-email: Kilian Tscherny <90620239+kiliantscherny@users.noreply.github.com>
|
|
7
|
+
Requires-Dist: beautifulsoup4>=4.14.3
|
|
8
|
+
Requires-Dist: duckdb>=1.2.0
|
|
9
|
+
Requires-Dist: lxml>=6.0.2
|
|
10
|
+
Requires-Dist: openpyxl>=3.1.5
|
|
11
|
+
Requires-Dist: paddleocr>=3.4.0
|
|
12
|
+
Requires-Dist: paddlepaddle>=3.3.0
|
|
13
|
+
Requires-Dist: pycryptodome>=3.23.0
|
|
14
|
+
Requires-Dist: pydantic>=2.11.0
|
|
15
|
+
Requires-Dist: pyjwt>=2.11.0
|
|
16
|
+
Requires-Dist: qrcode>=8.2
|
|
17
|
+
Requires-Dist: requests>=2.32.5
|
|
18
|
+
Requires-Dist: textual>=3.1.0
|
|
19
|
+
Requires-Python: >=3.13
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
<p align="center">
|
|
23
|
+
<img src="nordpy-logo.png" alt="nordpy" width="200" />
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<h1 align="center">nordpy</h1>
|
|
27
|
+
|
|
28
|
+
<p align="center">
|
|
29
|
+
A terminal UI for browsing and exporting your Nordnet portfolio data.
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
> [!CAUTION]
|
|
35
|
+
> **Disclaimer** — This tool is provided as-is, with no warranty of any kind. Use it at your own risk. 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.
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
- Browse accounts, balances, holdings, transactions, trades, and orders
|
|
40
|
+
- Export data to **CSV**, **Excel**, or **DuckDB**
|
|
41
|
+
- Session persistence with automatic re-authentication
|
|
42
|
+
- Headless export mode (no TUI) for scripting
|
|
43
|
+
- SOCKS5 proxy support
|
|
44
|
+
|
|
45
|
+
## How It Works
|
|
46
|
+
|
|
47
|
+
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.
|
|
48
|
+
|
|
49
|
+
> [!IMPORTANT]
|
|
50
|
+
> **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. Session cookies are saved locally on your machine (with `0600` permissions) solely to avoid repeated logins. No telemetry, analytics, or external services are involved.
|
|
51
|
+
|
|
52
|
+
## Requirements
|
|
53
|
+
|
|
54
|
+
- Python 3.13+
|
|
55
|
+
- [uv](https://docs.astral.sh/uv/) package manager
|
|
56
|
+
- A Nordnet account with MitID (Danish)
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
git clone https://github.com/kiliantscherny/nordpy.git
|
|
62
|
+
cd nordpy
|
|
63
|
+
uv sync
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Usage
|
|
67
|
+
|
|
68
|
+
### Interactive TUI
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# MitID App approval (default)
|
|
72
|
+
uv run nordpy --user <your-mitid-username>
|
|
73
|
+
|
|
74
|
+
# Force re-authentication (ignore saved session)
|
|
75
|
+
uv run nordpy --user <your-mitid-username> --force-login
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> [!NOTE]
|
|
79
|
+
> The first time you log in, you will 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.
|
|
80
|
+
|
|
81
|
+
### Headless Export
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
uv run nordpy --user <your-mitid-username> --export csv
|
|
85
|
+
uv run nordpy --user <your-mitid-username> --export xlsx
|
|
86
|
+
uv run nordpy --user <your-mitid-username> --export duckdb
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Exported files are saved to the `exports/` directory.
|
|
90
|
+
|
|
91
|
+
> [!WARNING]
|
|
92
|
+
> Exported files contain sensitive financial data. Make sure the `exports/` directory is not shared, synced to public cloud storage, or committed to version control. Keep your exports in a secure location accessible only to you.
|
|
93
|
+
|
|
94
|
+
### Keybindings
|
|
95
|
+
|
|
96
|
+
| Key | Action |
|
|
97
|
+
|-----|--------|
|
|
98
|
+
| `Enter` | Select account / drill into detail |
|
|
99
|
+
| `e` | Export current view |
|
|
100
|
+
| `r` | Refresh data |
|
|
101
|
+
| `q` / `Esc` | Quit |
|
|
102
|
+
|
|
103
|
+
## Development
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Install dev dependencies
|
|
107
|
+
uv sync --dev
|
|
108
|
+
|
|
109
|
+
# Run tests
|
|
110
|
+
uv run pytest
|
|
111
|
+
|
|
112
|
+
# Run tests with coverage
|
|
113
|
+
uv run pytest --cov=nordpy --cov-report=term-missing
|
|
114
|
+
|
|
115
|
+
# Lint
|
|
116
|
+
uv run ruff check src/
|
|
117
|
+
|
|
118
|
+
# Type check
|
|
119
|
+
uv run ty check src/
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
125
|
+
|
|
126
|
+
## Acknowledgments
|
|
127
|
+
|
|
128
|
+
This project includes code from [MitID-BrowserClient](https://github.com/Hundter/MitID-BrowserClient) by Hundter, licensed under the MIT License.
|
nordpy-0.1.0/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="nordpy-logo.png" alt="nordpy" width="200" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">nordpy</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
A terminal UI for browsing and exporting your Nordnet portfolio data.
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
> [!CAUTION]
|
|
14
|
+
> **Disclaimer** — This tool is provided as-is, with no warranty of any kind. Use it at your own risk. 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.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- Browse accounts, balances, holdings, transactions, trades, and orders
|
|
19
|
+
- Export data to **CSV**, **Excel**, or **DuckDB**
|
|
20
|
+
- Session persistence with automatic re-authentication
|
|
21
|
+
- Headless export mode (no TUI) for scripting
|
|
22
|
+
- SOCKS5 proxy support
|
|
23
|
+
|
|
24
|
+
## How It Works
|
|
25
|
+
|
|
26
|
+
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.
|
|
27
|
+
|
|
28
|
+
> [!IMPORTANT]
|
|
29
|
+
> **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. Session cookies are saved locally on your machine (with `0600` permissions) solely to avoid repeated logins. No telemetry, analytics, or external services are involved.
|
|
30
|
+
|
|
31
|
+
## Requirements
|
|
32
|
+
|
|
33
|
+
- Python 3.13+
|
|
34
|
+
- [uv](https://docs.astral.sh/uv/) package manager
|
|
35
|
+
- A Nordnet account with MitID (Danish)
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git clone https://github.com/kiliantscherny/nordpy.git
|
|
41
|
+
cd nordpy
|
|
42
|
+
uv sync
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
### Interactive TUI
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# MitID App approval (default)
|
|
51
|
+
uv run nordpy --user <your-mitid-username>
|
|
52
|
+
|
|
53
|
+
# Force re-authentication (ignore saved session)
|
|
54
|
+
uv run nordpy --user <your-mitid-username> --force-login
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
> [!NOTE]
|
|
58
|
+
> The first time you log in, you will 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.
|
|
59
|
+
|
|
60
|
+
### Headless Export
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
uv run nordpy --user <your-mitid-username> --export csv
|
|
64
|
+
uv run nordpy --user <your-mitid-username> --export xlsx
|
|
65
|
+
uv run nordpy --user <your-mitid-username> --export duckdb
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Exported files are saved to the `exports/` directory.
|
|
69
|
+
|
|
70
|
+
> [!WARNING]
|
|
71
|
+
> Exported files contain sensitive financial data. Make sure the `exports/` directory is not shared, synced to public cloud storage, or committed to version control. Keep your exports in a secure location accessible only to you.
|
|
72
|
+
|
|
73
|
+
### Keybindings
|
|
74
|
+
|
|
75
|
+
| Key | Action |
|
|
76
|
+
|-----|--------|
|
|
77
|
+
| `Enter` | Select account / drill into detail |
|
|
78
|
+
| `e` | Export current view |
|
|
79
|
+
| `r` | Refresh data |
|
|
80
|
+
| `q` / `Esc` | Quit |
|
|
81
|
+
|
|
82
|
+
## Development
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Install dev dependencies
|
|
86
|
+
uv sync --dev
|
|
87
|
+
|
|
88
|
+
# Run tests
|
|
89
|
+
uv run pytest
|
|
90
|
+
|
|
91
|
+
# Run tests with coverage
|
|
92
|
+
uv run pytest --cov=nordpy --cov-report=term-missing
|
|
93
|
+
|
|
94
|
+
# Lint
|
|
95
|
+
uv run ruff check src/
|
|
96
|
+
|
|
97
|
+
# Type check
|
|
98
|
+
uv run ty check src/
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
104
|
+
|
|
105
|
+
## Acknowledgments
|
|
106
|
+
|
|
107
|
+
This project includes code from [MitID-BrowserClient](https://github.com/Hundter/MitID-BrowserClient) by Hundter, licensed under the MIT License.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "nordpy"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Interactive TUI for browsing and exporting Nordnet financial data"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Kilian Tscherny", email = "90620239+kiliantscherny@users.noreply.github.com" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.13"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"beautifulsoup4>=4.14.3",
|
|
12
|
+
"duckdb>=1.2.0",
|
|
13
|
+
"lxml>=6.0.2",
|
|
14
|
+
"openpyxl>=3.1.5",
|
|
15
|
+
"paddleocr>=3.4.0",
|
|
16
|
+
"paddlepaddle>=3.3.0",
|
|
17
|
+
"pycryptodome>=3.23.0",
|
|
18
|
+
"pydantic>=2.11.0",
|
|
19
|
+
"pyjwt>=2.11.0",
|
|
20
|
+
"qrcode>=8.2",
|
|
21
|
+
"requests>=2.32.5",
|
|
22
|
+
"textual>=3.1.0",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.scripts]
|
|
26
|
+
nordpy = "nordpy.app:main"
|
|
27
|
+
|
|
28
|
+
[dependency-groups]
|
|
29
|
+
dev = [
|
|
30
|
+
"commitizen>=4.4.0",
|
|
31
|
+
"freezegun>=1.4.0",
|
|
32
|
+
"pytest>=8.3.0",
|
|
33
|
+
"pytest-cov>=6.0.0",
|
|
34
|
+
"pytest-mock>=3.14.0",
|
|
35
|
+
"responses>=0.25.0",
|
|
36
|
+
"textual-dev>=1.7.0",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[tool.pytest.ini_options]
|
|
40
|
+
testpaths = ["tests"]
|
|
41
|
+
addopts = "--tb=short -q"
|
|
42
|
+
|
|
43
|
+
[build-system]
|
|
44
|
+
requires = ["uv_build>=0.9.26,<0.10.0"]
|
|
45
|
+
build-backend = "uv_build"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"cookies": {"JSESSIONID": "EA28B32AC9B2C52B3DEFD356154F4F2A.sig-prod-auth11", "JSESSIONID-fallback": "EA28B32AC9B2C52B3DEFD356154F4F2A.sig-prod-auth11", "transid": "55itwsdvporuop2m9d2j6imuidtriy1yst2occg25hy5a4zyd3", "transid-fallback": "55itwsdvporuop2m9d2j6imuidtriy1yst2occg25hy5a4zyd3", "94204b0ad32ff32d0fad7509ef2e5f0fa0697277859c2b6e296eaf2145ce9cfe": "1", "signicat_session": "eyJhbGciOiJub25lIn0.e30.", "signicat_session-fallback": "eyJhbGciOiJub25lIn0.e30.", "lang": "da", "_csrf": "nnbjMmRiRTgzxu7_Kph_byaQ", "nordnet_theme": "%7B%22theme%22%3A%22auto%22%2C%22osPref%22%3A%22light%22%7D", "NNX_SESSION_ID": "46f87d89-0469-4944-ae6e-a140f456ea1f"}, "headers": {"User-Agent": "python-requests/2.32.5", "Accept-Encoding": "gzip, deflate", "Accept": "*/*", "Connection": "keep-alive", "client-id": "NEXT", "ntag": "ca72df54-7331-432e-a37f-358fd6a33807"}, "saved_at": "2026-02-11T00:07:38.861656"}
|