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')
Release files for urlfinderlib 0.25.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| urlfinderlib-0.25.4.tar.gz | 16.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| urlfinderlib-0.25.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.1 kB
Release files / urlfinderlib-0.25.4.tar.gz
| Download URL | urlfinderlib-0.25.4.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1e3e18e881092d7fdb1b27e6ccbf522348c13cd3fb8887c3bdb0b287a472493
|
|
BLAKE2b-256 checksum How to use checksums |
b02d323fe19a7e1f46010e825608721f0fdf65890eec671847512c509052c008
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / urlfinderlib-0.25.4-py3-none-any.whl
| Download URL | urlfinderlib-0.25.4-py3-none-any.whl |
|---|---|
| Size | 22.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1d1968c65d6831fa36d5286415725eb04c4f11531f126aa11112f3c5a7cbd0e
|
|
BLAKE2b-256 checksum How to use checksums |
1ea454673f08bd77e5a084b4614a6ef947b7cfae8fe78cfdda8b22acf740d45d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency log