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.2.tar.gz (16.0 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.2-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: urlfinderlib-0.25.2.tar.gz
  • Upload date:
  • Size: 16.0 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.2.tar.gz
Algorithm Hash digest
SHA256 4f624d4f789f39d05a05f0924de054a840a0dae6ceb55362239117065604cc22
MD5 7c08c4a12e6ac9c97be8222a50c8d1fd
BLAKE2b-256 5dc824e9aae32f215f200f82d3e79c4d931414023bfc1ea0b724463d29d46570

See more details on using hashes here.

Provenance

The following attestation bundles were made for urlfinderlib-0.25.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: urlfinderlib-0.25.2-py3-none-any.whl
  • Upload date:
  • Size: 22.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b2e230426c0232339b654af9f33081739f65e2a4d41e69ac37bda2078c7c7d46
MD5 59980841b62a5dd13bdf7d125f146bcd
BLAKE2b-256 6dda75c2bafb2c4fb37a11152930e5b82161e35ca70133c65d3752a978986ce4

See more details on using hashes here.

Provenance

The following attestation bundles were made for urlfinderlib-0.25.2-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

0.25.3

2 files

This release

0.25.2 This release

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