Python client for the Empower (Personal Capital) unofficial API
Project description
personalcapital2
Typed Python client for the Empower (formerly Personal Capital) API. Authenticate, fetch your financial data, and get back clean dataclasses — frozen dataclasses with Decimal values, not raw JSON.
Built on the reverse-engineering work of haochi/personalcapital and traviscook21/personalcapital (both MIT).
Install
pip install personalcapital2
# or with uv
uv add personalcapital2
Quick start
from datetime import date
from personalcapital2 import authenticate
client = authenticate() # interactive login with 2FA
result = client.get_accounts()
for acct in result.accounts:
print(f"{acct.name:<30} {acct.firm_name}")
print(f"Net worth: ${result.summary.networth:.2f}")
result = client.get_transactions(date(2026, 1, 1), date(2026, 3, 31))
for txn in result.transactions:
print(f"{txn.date} {txn.description:<30} ${txn.amount:.2f}")
Authentication
authenticate() reads credentials from environment variables, falling back to interactive prompts:
| Variable | Purpose |
|---|---|
EMPOWER_EMAIL |
Empower account email |
EMPOWER_PASSWORD |
Empower account password |
PC2_SESSION_PATH |
Custom session file location (default: ~/.config/personalcapital2/session.json) |
Sessions are saved and reused until they expire (typically 1-2 days). The session path can also be overridden per-command with --session.
CLI
A command-line tool is included as pc2. All output is structured JSON. See CLI Reference for commands, date shortcuts, and examples.
pc2 accounts # list linked accounts
pc2 transactions --start 90d # last 90 days
pc2 net-worth --start yb --format csv # YTD as CSV
Python API
All methods return frozen dataclasses with datetime.date and decimal.Decimal fields. See API Reference for methods, response containers, and examples, and Model Reference for every field and type.
MCP Server
An MCP tool server exposes all data methods to AI agents (Claude Code, Claude Desktop, etc.). Requires the [mcp] extra:
pip install "personalcapital2[mcp]"
Start the server (requires a valid session from pc2 login):
pc2 mcp
See MCP Testing Guide for client configuration and testing.
Known API quirks
This library uses Empower's unofficial internal web API, which is not affiliated with Empower and may change without notice.
is_spendingis unreliable on refunds. Usetransaction_type(e.g."Refund") instead.performanceandbenchmarksshare one API call.get_performance()returns both in a singlePerformanceResult.get_accountsmay not list all accounts with holdings. Some accounts (employer 401k plans, crypto exchanges) can appear inget_holdings,get_account_balances, andget_performancebut not inget_accounts. Useget_holdingsto discover investment account IDs.get_spendingignores date range and interval. The API always returns current-period spending for all three interval types (MONTH, WEEK, YEAR), regardless of thestart_date,end_date, orintervalparameters.- Sessions expire. Typically 1-2 days. Run
pc2 loginagain on auth errors.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file personalcapital2-0.1.1.tar.gz.
File metadata
- Download URL: personalcapital2-0.1.1.tar.gz
- Upload date:
- Size: 115.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c92961a95fcde16fc95b6442700f2ca27b8a312ab0101845806d1a91163f5589
|
|
| MD5 |
16debbcc690c681d4cdf8f05264ce998
|
|
| BLAKE2b-256 |
26743907d17a0d266ee029c98b803eb88b099db4219e6356f13fbc72c0ff3d0c
|
Provenance
The following attestation bundles were made for personalcapital2-0.1.1.tar.gz:
Publisher:
release.yml on wpwilson10/personalcapital2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
personalcapital2-0.1.1.tar.gz -
Subject digest:
c92961a95fcde16fc95b6442700f2ca27b8a312ab0101845806d1a91163f5589 - Sigstore transparency entry: 1250006925
- Sigstore integration time:
-
Permalink:
wpwilson10/personalcapital2@4b439e32638ce269649b3924a9065a9fd029c5a1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wpwilson10
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4b439e32638ce269649b3924a9065a9fd029c5a1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file personalcapital2-0.1.1-py3-none-any.whl.
File metadata
- Download URL: personalcapital2-0.1.1-py3-none-any.whl
- Upload date:
- Size: 45.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4e22061d1d1be4f46d83e6bf63610448a42179b98c06d2a3b2c53c8d86b8fe1
|
|
| MD5 |
279d0cfc63632fe3b7cb29508dc51ce5
|
|
| BLAKE2b-256 |
fd14d120fe50ff1bc7e298930de88cc48613deabb6d4d4b8a41dd540f7d615ca
|
Provenance
The following attestation bundles were made for personalcapital2-0.1.1-py3-none-any.whl:
Publisher:
release.yml on wpwilson10/personalcapital2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
personalcapital2-0.1.1-py3-none-any.whl -
Subject digest:
c4e22061d1d1be4f46d83e6bf63610448a42179b98c06d2a3b2c53c8d86b8fe1 - Sigstore transparency entry: 1250006993
- Sigstore integration time:
-
Permalink:
wpwilson10/personalcapital2@4b439e32638ce269649b3924a9065a9fd029c5a1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wpwilson10
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4b439e32638ce269649b3924a9065a9fd029c5a1 -
Trigger Event:
push
-
Statement type: