Skip to main content

araised

Static analysis tool that answers: what exceptions can this function raise?

Analyses explicit raise statements and common stdlib callables (dict[key], open(), json.loads(), etc.) using Pyright for type inference. Propagates through same-module and cross-file call chains with cycle detection.

Installation

pip install araised

To install the latest development version directly from the dev branch:

uv tool install git+https://github.com/amirouche/raises.py@dev

Requires Pyright (pip install pyright), which is pulled in automatically as a dependency.

CLI

araised module.path:callable [module.path:callable ...]

The target is module.path:callable, where callable is a bare function name or ClassName.method_name.

$ araised myapp.db:connect
myapp.db:connect
  builtins.KeyError        [dict.__getitem__, step 1]
  builtins.ValueError      [explicit raise, step 2]
  builtins.OSError         [builtins.open, step 1, via myapp.db:connect → myapp.db:_open_file]

Each line shows the exception, where it comes from, the analysis step, and the call chain (via) if it was propagated from a callee.

Multiple targets can be passed in one invocation:

$ araised myapp.db:connect myapp.db:disconnect

Programmatic API

import araised

entries = araised.analyse('myapp.db:connect')
for e in entries:
    print(e.exception, e.source, e.step, e.via)

analyse returns a list of RaisesEntry namedtuples:

Field Type Description
exception str Fully-qualified exception name, e.g. builtins.KeyError
source str What triggered it, e.g. dict.__getitem__ or explicit raise
step int 1 = inferred from type, 2 = explicit raise statement
via tuple[str, ...] Call chain leading to this exception (empty for direct)

Optional parameters:

araised.analyse(
    'myapp.db:connect',
    max_depth=3,        # max cross-file hops (default 3, 0 = no cross-file)
    max_union_width=3,  # max union members for dynamic dispatch (default 3)
)

Emacs

Load araised.el and call araised-at-point with point inside any Python function or method. It infers the target from the current file and def automatically, then shows results in a *araised* buffer.

(load "/path/to/araised.el")

;; optional keybinding
(add-hook 'python-mode-hook
          (lambda () (local-set-key (kbd "C-c r") #'araised-at-point)))

With point inside a function, M-x araised-at-point (or C-c r) prompts:

araised target: myapp.db:connect

Edit the target if needed, then press RET. Results appear in *araised*.

Metadata

Release files for araised 0.1.5

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

Source distribution (sdist)

Source distribution for araised 0.1.5
File Size Uploaded Provenance
araised-0.1.5.tar.gz 59.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 75.7 kB

Release files / araised-0.1.5.tar.gz

Download URL araised-0.1.5.tar.gz
Size 59.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3d36c737687e9cd32ee0843c49bac137902f030d6db9d9c873449e65aa3e8cee
BLAKE2b-256 checksum
How to use checksums
a21499dc80893c3bb4096a7a742d08aa54912729fc673037de8dcb22cea91e7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / araised-0.1.5-py3-none-any.whl

Download URL araised-0.1.5-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3ca8b2d436068781b0d4a7559484f2f8caa9f2c8646abc21ec2e79ee8529940
BLAKE2b-256 checksum
How to use checksums
7ed26e81ad39d0c1f81186f7791f205f52b9f4dd50717d064f6fae9564e055cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for araised 0.1.5

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files No provenance

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