Skip to main content

urlfinderlib

This is a Python (3.10+) library for finding URLs in documents and checking their validity.

Supported Documents

Extracts URLs from the following types of documents:

  • Binary files (finds URLs within strings)
  • CSV files
  • HTML files
  • iCalendar/vCalendar files
  • PDF files
  • Text files (ASCII or UTF-8)
  • XML files

Every extracted URL is validated such that it contains a domain with a valid TLD (or a valid IP address) and does not contain any invalid characters.

URL Permutations

This was originally written to accommodate finding both valid and obfuscated or slightly malformed URLs used by malicious actors and using them as indicators of compromise (IOCs). As such, the extracted URLs will also include the following permutations:

  • URL with any Unicode characters in its domain
  • URL with any Unicode characters converted to its IDNA equivalent

For both domain variations, the following permutations are also returned:

  • URL with its path %-encoded
  • URL with its path %-decoded
  • URL with encoded HTML entities in its path
  • URL with decoded HTML entities in its path
  • URL with its path %-decoded and HTML entities decoded

Child URLs

This library also attempts to extract or decode child URLs found in the paths of URLs. The following formats are supported:

  • Barracuda protected URLs
  • Base64-encoded URLs found within the URL's path
  • Google redirect URLs
  • Mandrill/Mailchimp redirect URLs
  • Outlook Safe Links URLs
  • Proofpoint protected URLs
  • URLs found in the URL's path query parameters

Basic usage

from urlfinderlib import find_urls

with open('/path/to/file', 'rb') as f:
    print(find_urls(f.read())

base_url Parameter

If you are trying to find URLs inside of an HTML file, the paths in the URLs are often relative to their location on the server hosting the HTML. You can use the base_url parameter in this case to extract these "relative" URLs.

from urlfinderlib import find_urls

with open('/path/to/file', 'rb') as f:
    print(find_urls(f.read(), base_url='http://example.com')

Download files

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

Source Distribution

urlfinderlib-0.25.3.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

urlfinderlib-0.25.3-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file urlfinderlib-0.25.3.tar.gz.

File metadata

  • Download URL: urlfinderlib-0.25.3.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for urlfinderlib-0.25.3.tar.gz
Algorithm Hash digest
SHA256 e149159f64641494e24f0bb0b6f556925152411f6f4cd25137d0bff0b3a1b992
MD5 611a5eda6e05d3e9e25054fdbde73c6b
BLAKE2b-256 3d26ddb3fc9bad25068abb53ddecdca9379b4e5329b262f07bb7f806f71e8127

See more details on using hashes here.

Provenance

The following attestation bundles were made for urlfinderlib-0.25.3.tar.gz:

Publisher: pypi.yml on ACE-Collective/urlfinderlib

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

File details

Details for the file urlfinderlib-0.25.3-py3-none-any.whl.

File metadata

  • Download URL: urlfinderlib-0.25.3-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for urlfinderlib-0.25.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3c7b5ca558bd7ef920783da906567c81bcbc4789c21078e291c74894c01bb5dd
MD5 ebc6b7157de037cf369cfb81c85d244b
BLAKE2b-256 cc8a484f9ecb392bba40da953d255e32a7bb206122f6b6463b3516e2975add1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for urlfinderlib-0.25.3-py3-none-any.whl:

Publisher: pypi.yml on ACE-Collective/urlfinderlib

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

0.25.3 This release

2 files

0.25.2

2 files

0.25.1

2 files

0.25.0

2 files

0.24.0

2 files

0.23.0

2 files

0.22.0

2 files

0.21.0

2 files

0.20.1

2 files

0.19.0

2 files

0.18.6

2 files

0.18.5

2 files

0.18.4

2 files

0.18.3

2 files

0.18.2

2 files

0.18.0

1 file

0.17.8

1 file

0.17.7

1 file

0.17.6

1 file

0.17.5

1 file

0.17.4

1 file

0.17.3

1 file

0.17.2

1 file

0.17.1

1 file

0.17.0

1 file

0.16.1

1 file

0.16.0

1 file

0.15.6

1 file

0.15.5

1 file

0.15.4

1 file

0.15.3

1 file

0.15.2

1 file

0.15.1

1 file

0.15.0

1 file

0.14.4

1 file

0.14.3

1 file

0.14.2

1 file

0.14.1

1 file

0.14.0

1 file

0.13.3

1 file

0.13.2

1 file

0.13.1

1 file

0.13.0

1 file

0.12.5

1 file

0.12.4

1 file

0.12.3

1 file

0.12.2

1 file

0.12.1

1 file

0.12.0

1 file

0.11.12

2 files

0.11.11

2 files

0.11.10

2 files

0.11.9

2 files

0.11.8

2 files

0.11.7

2 files

0.11.6

2 files

0.11.5

2 files

0.11.4

2 files

0.11.3

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.1

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

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