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.24.0.tar.gz (14.7 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.24.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for urlfinderlib-0.24.0.tar.gz
Algorithm Hash digest
SHA256 ac818bb225316d16d4fd6e49c5139c309d278312dd4d9e2a3610c6b12753a580
MD5 99a5a46ab164a0c5cc790f82d6311a32
BLAKE2b-256 f0626266ca0aa465de4bccb6505983dd09ff2f28988546a2069e5695832e259d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: urlfinderlib-0.24.0-py3-none-any.whl
  • Upload date:
  • Size: 20.6 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.24.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60e03fe396212c3adf25bd33bb0ef2265129b79f80a06dca72280a31c694c1e7
MD5 c6c05be9d0dabd2d4c1eed81c1af6335
BLAKE2b-256 a75f6860fbd9d0e918dbea7b0a39bf8f601c5576bf561f4783362704961b0252

See more details on using hashes here.

Provenance

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

0.25.2

2 files

0.25.1

2 files

0.25.0

2 files

This release

0.24.0 This release

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