Skip to main content

ppar

Portfolio performance attribution, contribution, and ex-post risk analytics.

ppar compares a portfolio with a benchmark, explains active return by classification, and produces reviewable HTML tables and PNG charts. It runs locally and accepts vendor-neutral CSV files or Axys/APX exports.

Start here

ppar supports Python 3.11.9 through Python 3.14.

ppar is available under a 90-day, single-user internal evaluation license. Production, commercial, multi-user, or continued use requires a separate agreement; contact jjjkreynolds@gmail.com. Review the license before installing.

python -m pip install ppar

Then choose one demonstration.

Vendor-neutral (the default):

ppar setup ./my_ppar
python ./my_ppar/ppar_demo.py

Axys/APX:

ppar setup ./my_ppar --axys-apx
python ./my_ppar/ppar_demo.py

Either setup command creates a demonstration directory:

my_ppar/
  README.md
  ppar_demo.py
  input/
  output/

The extensively commented ppar_demo.py is both a tutorial and the executable workflow. Edit its Python values to choose input paths, calculation assumptions, and reports, then replace the demonstration files under input/ with your data.

What it produces

The standard demonstration writes security and classification attribution tables, attribution and contribution charts, cumulative return charts, heatmaps, and an ex-post risk-statistics table.

The gallery below shows examples of available output, including reports that can be selected by editing ppar_demo.py.

Over the demonstrated period, the Mega-Cap Alpha portfolio returned 83.4% versus 76.8% for the benchmark, outperforming by approximately 656 basis points. Security selection generated about 644 basis points of that result, while sector allocation added about 12 basis points. Information Technology was the largest positive source, contributing approximately 337 basis points. The portfolio was slightly more volatile, but its annualized Sharpe ratio of 0.70 and Sortino ratio of 1.55 were both better than the benchmark's 0.66 and 1.46.

Overall attribution by economic sector chart Overall contribution by economic sector chart Sub-period attribution effects chart Sub-period portfolio and benchmark returns Active contributions heatmap Total attribution effects heatmap Cumulative attribution effects Cumulative portfolio and benchmark returns Cumulative attribution table Overall attribution table by economic sector Overall attribution table by security Ex-post risk statistics table

Python

This prints the overall security attribution view as a Polars DataFrame:

from pathlib import Path

from ppar import Analytics
from ppar.attribution import View

# Use the performance files created by: ppar setup ./my_ppar
performance_input_directory = Path("./my_ppar") / "input" / "performance"

# The portfolio is the first file and the benchmark is the second.
analytics = Analytics(
    performance_input_directory / "Mega-Cap Alpha Portfolio.csv",
    performance_input_directory / "Mega-Cap Benchmark.csv",
)

# Calculate security-level attribution and request its overall table.
overall_attribution = analytics.attribution().to_polars(View.OVERALL_ATTRIBUTION)
print(overall_attribution)

The generated ppar_demo.py is the complete reporting example. Results are available as Polars DataFrames, HTML text, PNG bytes, or CSV files.

Documentation

Downloading, installing, accessing, copying, or using ppar constitutes acceptance of the license.

Metadata

Release files for ppar 0.4.1

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

Built distribution (wheel)

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

Release files / ppar-0.4.1-py3-none-any.whl

Download URL ppar-0.4.1-py3-none-any.whl
Size 749.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77fb54d4a23e0810e734b57dea540fb674db7649380d7c08d285baf6612688ff
BLAKE2b-256 checksum
How to use checksums
850469c0265bb8e54d70b6d06188ba036d4d0dccbe3da6b1e48c6560ce308ee9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.1 This release

1 release file

0.4.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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