Skip to main content

The Analytic Companion for Portfolio Performance

Project description

pp-terminal - The Analytic Companion for Portfolio Performance

build status

A powerful command-line tool that uses the openness of Portfolio Performance data and the convenient access of ppxml2db to offer a whole new level of insights into your portfolio.

For example, pp-terminal includes a command to calculate the preliminary tax values ("Vorabpauschale") for Germany:

Vorabpauschale command in pp-terminal

pp-terminal is a lightweight tool for all the nice-to-have features that won't make it into the official Portfolio Performance app. This can be because of country-dependant tax rules, complex Java implementation, highly individual requirements, too many edge-cases, etc.

By default, pp-terminal provides the following commands:

Command Description
list accounts Get detailed information about the balances per each deposit and/or securities account
simulate interest Calculate how much interest you should have been earned per account and compare with actual values
simulate vorabpauschale Run a simulation for the German preliminary tax ("Vorabpauschale") on the portfolio
validate Run a number of different validation checks on the portfolio data, e.g. security prices up-to-date

Code completion for commands and options is available.
The application does not modify the original Portfolio Performance file.
You can choose between different output formats like JSON or CSV with the --format option.

In addition to the standard set, you can easily create your own commands and share them with the community.

[!IMPORTANT] I am not a tax consultant. All results of this application are non-binding and without guarantee. They may deviate from the actual values.

Requirements

  • pipx to install the application (without having to worry about different Python runtimes)
  • Portfolio Performance version >= 0.70.3
  • Portfolio Performance file must be saved as "XML with id attributes"

Installing

pipx install pp-terminal

Once installed, the latest updates can be obtained with pipx upgrade pp-terminal.

Usage 💡

The commands mentioned above all require the Portfolio Performance XML file as input.
You can either provide that file as first option to the command

pp-terminal --file=depot.xml list accounts

or by setting an environment variable you can omit the option

export PP_TERMINAL_INPUT_FILE=depot.xml
pp-terminal list accounts

To view all available arguments you can always use the --help option.

Customize Number Formats

If you want another formatting for numbers, assure that the terminal has the correct language settings, e.g. for Germany:

export LANG=de_DE.UTF-8

Disable Colored Output

To disable all colors in the console output for a better readability, you can set the NO_COLOR environment variable to any value like this

export NO_COLOR=1

Create Your Own Command ⚒️

Developers can easily extend the default pp-terminal functionality by implementing their own commands. Therefore, the Python entry point pp_terminal.commands is provided. To hook into a sub-command, e.g. list, you have to prefix the entry point name with list..

The most basic pp-terminal command looks like this:

from pp_terminal.output import Console
import typer

app = typer.Typer()
console = Console()


@app.command
def hello_world() -> None:
    console.print("Hello World")

This will result in the command pp-terminal hello-world being available.

For more sophisticated samples take a look at the packaged commands in the pp_terminal/commands directory, e.g. a good starting point is list_accounts.py.

The app uses Typer for composing the commands and Rich for nice console outputs. The Portfolio Performance XML file is read with ppxml2db and efficiently held in panda dataframes.

If your command makes sense for a broader audience, I'm happy to accept a pull request.

Known Limitations 🚧

  • The script is still in beta version, so there might be Portfolio Performance files that are not compatible with and also public APIs can change

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for more details.

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

pp_terminal-0.5.1.tar.gz (45.6 kB view details)

Uploaded Source

Built Distribution

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

pp_terminal-0.5.1-py3-none-any.whl (65.8 kB view details)

Uploaded Python 3

File details

Details for the file pp_terminal-0.5.1.tar.gz.

File metadata

  • Download URL: pp_terminal-0.5.1.tar.gz
  • Upload date:
  • Size: 45.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pp_terminal-0.5.1.tar.gz
Algorithm Hash digest
SHA256 31ccb0b85e89f55b50ab54ea106d3d758b1452f2b592f9f2a915cfa8cf1d6892
MD5 04b6844a48348859fe358126627afd25
BLAKE2b-256 a693b7a797f3209fae6072434a2e391d4253d8eab2db4f494e84f5925f672615

See more details on using hashes here.

Provenance

The following attestation bundles were made for pp_terminal-0.5.1.tar.gz:

Publisher: ci.yml on ma4nn/pp-terminal

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

File details

Details for the file pp_terminal-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: pp_terminal-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 65.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pp_terminal-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef1ddbc89bc20296b916ae6c92cf23142bd6fdbe6b035f9fa9bcadcbb4f41f37
MD5 dab70e2f586a3a494d03a9f942830506
BLAKE2b-256 b8ec667fca8c70419d6bc33ddc56a6548f86b810f39a4f12d04d960161a4aabc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pp_terminal-0.5.1-py3-none-any.whl:

Publisher: ci.yml on ma4nn/pp-terminal

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

Supported by

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