Skip to main content

Risk-Weighted Assets

Version 1.2.1: IRB default correction and API migration.

License: GPL v3 Python CI

risk-weighted-assets is an institution-neutral, auditable Python reference engine for CRR III risk-weighted assets, regulatory capital, IRRBB and ICAAP. It combines a stable Python API, a command-line interface, a local browser application, canonical Excel contracts, realistic synthetic portfolios and reproducible reference calculations.

The distribution is intended for research, education, prototyping and independent model validation. It is not regulatory, legal, accounting or investment advice and is not a certified regulatory reporting system. Read the disclaimer before use.

Functional scope

  • CRR III credit risk under SA and IRB, credit-risk mitigation and output-floor views
  • counterparty credit risk, SFT, CCP, securitisation, CVA and crypto exposures
  • settlement, large exposures, market risk with parallel FRTB views, and operational risk
  • own funds, buffers, leverage, MREL/TLAC and capital headroom
  • IRRBB/CSRBB and ICAAP economic and normative perspectives
  • deterministic fingerprints, lineage, reconciliations and calculation controls
  • 38 public atomic regulatory formulae with explicit, analyst-controlled parameters
  • nine focused risk-domain analyses plus granular metric, table and control access
  • non-mutating parameter sensitivities with mandatory rationale, approver and audit trail
  • 16 canonical input and six output workbooks per persisted calculation

Credit supporting factors (1.2.0)

SA/IRB eligibility, combined factors, legacy compatibility and audit fields are explained in Supporting factors.

Installation

Python 3.10 or newer is required. Install a locally built wheel with:

python -m pip install dist/risk_weighted_assets-1.2.1-py3-none-any.whl

Install the latest published release from PyPI with:

python -m pip install risk-weighted-assets

For development from this source tree:

python -m pip install -e '.[test,build]'

First calculation

Create an isolated, writable workspace from the immutable package resources and run the supplied universal-bank dataset:

rwa init ./rwa-workspace
rwa run --dataset ./rwa-workspace/daten/rechenlaeufe/2026-08-31/v1.0.0

Or generate a deterministic synthetic dataset and calculate it in one step:

rwa all \
  --data-root ./rwa-workspace/daten/rechenlaeufe \
  --as-of-date 2026-08-31 \
  --version v1.0.1 \
  --seed 5752026 \
  --bank-profile MID_SIZE_UNIVERSAL

Set RWA_WORKSPACE=/absolute/path to change the default workspace used by the CLI and web application. Package resources are never modified in place.

Python API

from pathlib import Path

from rwa_engine import calculate_dataset, create_workspace, validate_dataset

workspace = create_workspace(Path("rwa-workspace"))
dataset = workspace.runs_root / "2026-08-31" / "v1.0.0"

validation = validate_dataset(dataset)
if validation.valid:
    result = calculate_dataset(dataset)
    print(result.status, result.run_id, result.metrics)

For integration without Excel I/O, use calculate_tables(tables) with the canonical dict[str, pandas.DataFrame] contract. It returns the same structured CalculationResult without persisting output workbooks.

For formula-by-formula control and focused analysis:

from rwa_engine import (
    analyze_credit_risk,
    compare_calculation_views,
    irb_capital_requirement,
    regulatory_parameter,
)

print(regulatory_parameter("RWA_MULTIPLIER", "PILLAR1"))
print(irb_capital_requirement(0.01, 0.45, 0.20, 2.5))
credit = analyze_credit_risk(result)
print(credit.metrics, credit.tables, credit.controls)
print(compare_calculation_views(result))

CLI and local app

rwa --help
rwa doctor
rwa data list
rwa sources
rwa-web --data-root ./rwa-workspace/daten/rechenlaeufe

The web server binds to 127.0.0.1:8080 by default and invokes the same calculation pipeline as the API and CLI. It has no authentication or TLS and is intended for a trusted local workstation only.

Bundled data and source boundary

The wheel includes both complete synthetic profiles (MID_SIZE_UNIVERSAL and KSA_BANK), their two calculation-ready datasets, retained reference outputs, configuration and the machine-readable inventory of official sources. Use rwa data export PATH or create_workspace(PATH) to obtain editable copies.

No downloaded regulation, standard, PDF or other third-party publication is redistributed. Official links and archival checksums are available through rwa sources and the regulatory source catalogue. The original construction scaffold is not part of this distribution.

Documentation and verification

Run the complete local verification suite with:

python -m pytest
python -m ruff check src tests tools
python -m build
python -m twine check dist/*
python tools/validate_distribution.py dist

This project is published by RiskDataScience GmbH. The legally binding company information is available in the imprint, and information about the processing of personal data is provided in the privacy policy.

The installed library contains no telemetry, analytics or tracking and does not transmit portfolio, calculation or usage data to RiskDataScience GmbH. The optional browser application communicates only with the locally started RWA server. Interactions performed on GitHub or PyPI are additionally subject to the terms and privacy practices of those platforms.

License

Copyright © 2026 RiskDataScience GmbH. Original content is licensed under the GNU General Public License, version 3 only. External publications remain subject to their respective rights and are not included. See third-party notices.

Metadata

Release files for risk-weighted-assets 1.2.1

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

Source distribution (sdist)

Source distribution for risk-weighted-assets 1.2.1
File Size Uploaded
risk_weighted_assets-1.2.1.tar.gz 4.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for risk-weighted-assets 1.2.1
File Interpreter ABI Platform
risk_weighted_assets-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 MB

Release files / risk_weighted_assets-1.2.1.tar.gz

Download URL risk_weighted_assets-1.2.1.tar.gz
Size 4.3 MB
Tags Source
SHA-256 checksum
How to use checksums
fd33543f24647dd50b2e4e9fc985d8370fcbc3a88d3d4358cbed0dd09da1c76f
BLAKE2b-256 checksum
How to use checksums
a593e45ea9501647db5936b021d74044168d1135dbdba2676acdfdca835ac64f
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 Oct 7, 2026.

Transparency log

Release files / risk_weighted_assets-1.2.1-py3-none-any.whl

Download URL risk_weighted_assets-1.2.1-py3-none-any.whl
Size 4.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
38e07ad1240eb4ecc78b9afefbd98b849f61866e8cfee456c86075710eed084e
BLAKE2b-256 checksum
How to use checksums
14916cbf2fe765c58c222ba3fe845477c4999c94b74c7efa794d90ba925ae0e8
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 Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

1.2.2

2 release files

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.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