Skip to main content

kachi

Make a protected link unsafe.

Requirements

  • Python 3.10+

Installation

pip install kachi

Usage

from kachi import unsafe_link

result = unsafe_link("https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fexample.com")
print(result)  # https://example.com

Bundled Rules

Rule Service
azure_email Azure Email Safe Links
barracuda Barracuda Link Protect
esvalabs EsvaLabs URL Sandbox
fireeye FireEye URL Defense
o365_safelinks Microsoft 365 Safe Links
proofpoint_v1 Proofpoint URL Defense v1
proofpoint_v2 Proofpoint URL Defense v2
ses_awstrack AWS SES Click Tracking
sophos Sophos Email Protection
trendmicro Trend Micro Email Security
urldefense_v3 Proofpoint URL Defense v3
whatsapp WhatsApp Link Redirect

Rule Schema

Each rule is a YAML file with the following structure:

name: example_rule
filter:
  hostname: example.com # exact match, or /regex/
  path: /redirect # optional, exact match or /regex/
pre_extract: # optional, transforms applied to URL before extraction
  - html_unescape
  - url_decode
extract:
  from: query_param # query_param, path_regex, or url_regex
  keys: [url, u] # for query_param: parameter names to try in order
  pattern: "/L0/(http[^/?#]+)" # for path_regex/url_regex: regex with capture group
  select: first # for query_param: first (default) or last
post_extract: # optional, transforms applied to extracted value
  - url_decode

Filter

  • hostname (required): string or list of strings. Exact match or /regex/.
  • path (optional): string or list of strings. Exact match or /regex/.

Extract Sources

Source Description
query_param Extract from URL query parameters. Requires keys.
path_regex Match regex against URL path. Requires pattern with a capture group.
url_regex Match regex against full URL. Requires pattern with a capture group.

Transforms

Name Description
html_unescape Decode HTML entities (& -> &)
url_decode Percent-decode (%2F -> /)
base64_decode Base64 decode
prepend Prepend a string (requires a value, e.g. {prepend: "http://"})
proofpoint_v2_decode Decode Proofpoint v2 URL encoding

Metadata

Release files for kachi 0.1.0

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

Source distribution (sdist)

Source distribution for kachi 0.1.0
File Size Uploaded
kachi-0.1.0.tar.gz 29.5 kB Details

Built distribution (wheel)

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

Total release size: 39.6 kB

Release files / kachi-0.1.0.tar.gz

Download URL kachi-0.1.0.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ed8bea0df699ee093436151e0ffcfcad7cc181d35e853f4a4a0402a24f80dcf7
BLAKE2b-256 checksum
How to use checksums
e5eb113b1f82bc4f81816b8c28fea102bb186ef7f2d45fd630b4ac668a751998
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 8, 2026.

Transparency log

Release files / kachi-0.1.0-py3-none-any.whl

Download URL kachi-0.1.0-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92321e01be78bacbab915b12c06ce77ffbe4738019071346665a62335249f6e7
BLAKE2b-256 checksum
How to use checksums
59afeb61b371cb27d9aa930fbf950c251a6eafac91f97aa5ee8dcade02607b3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

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