Skip to main content

Risk-Weighted Assets

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
  • 34 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

Installation

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

python -m pip install dist/risk_weighted_assets-1.1.0-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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

risk_weighted_assets-1.1.0.tar.gz (4.3 MB view details)

Uploaded Source

Built Distribution

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

risk_weighted_assets-1.1.0-py3-none-any.whl (4.4 MB view details)

Uploaded Python 3

File details

Details for the file risk_weighted_assets-1.1.0.tar.gz.

File metadata

  • Download URL: risk_weighted_assets-1.1.0.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for risk_weighted_assets-1.1.0.tar.gz
Algorithm Hash digest
SHA256 82adfc3b7220296546a3a5bd7052aa04b57cafacc1694ade4b812cd96ad20728
MD5 23b5ea692115763dcd157f98796f861e
BLAKE2b-256 162f4394e1eb143a2076d611ea8ca0038f14a79c42498f1c281776e6f4e6a9c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for risk_weighted_assets-1.1.0.tar.gz:

Publisher: publish.yml on rds0001/risk-weighted-assets-python

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

File details

Details for the file risk_weighted_assets-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for risk_weighted_assets-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44ee2b12f4025ee9e9bb2c01598666289fb91a1a50f044cffea1587d50be9959
MD5 89da0f14ff6605835b2d07ba8b45ac0d
BLAKE2b-256 bbd509d9ac91737292e5a5b939ffd05dee4a17467a9ebeb71f198abfb1eef932

See more details on using hashes here.

Provenance

The following attestation bundles were made for risk_weighted_assets-1.1.0-py3-none-any.whl:

Publisher: publish.yml on rds0001/risk-weighted-assets-python

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

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 files

1.0.0

2 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