--- id: urlextract version: "1.9.0" license: MIT license_treatment: permissive maintenance: dormant --- # urlextract — Collects and extracts URLs from given text. License: permissive · Maintenance: dormant · Downloads: 1.2M/mo ## What it is and what it does URLExtract is a Python library that finds URLs embedded in plain text by scanning for valid top-level domains (TLDs) and expanding outward to locate word boundaries. It works by locating any TLD occurrence in the input text, then searching left and right from that position until it hits a stop character like whitespace or punctuation. The library maintains an up-to-date TLD list downloaded from iana.org and can optionally validate extracted domains via DNS checks using uritools and idna for proper domain name handling. The package provides three main extraction modes: `find_urls()` returns a list of all URLs found, `gen_urls()` yields URLs as a generator for memory efficiency, and `has_urls()` performs a quick boolean check. You can also manually update the TLD cache or set it to auto-update after a specified number of days. The library is aware of a known limitation: since some TLDs are also valid English words, it may produce false positives in contexts like CSS class selectors (e.g., detecting 'p.bold.name' as a domain). Use it for: - Extract clickable links from user-generated text, chat messages, or social media posts for processing or display - Scan HTML or text documents to identify and collect all URLs for link validation or archival purposes - Pre-process raw text data before feeding it to NLP or machine learning pipelines that need URL detection - Build web scrapers or crawlers that need to identify target URLs within fetched page content - Validate or sanitize user input by detecting whether a text block contains any URLs ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extracts URLs from text by locating TLDs and expanding boundaries to find complete domain names, with optional DNS validation. Yes, if you need straightforward URL extraction from unstructured text. The package is stable (Production/Stable status), has no known security vulnerabilities, and carries a permissive MIT license. Install friction is low. However, the last release was 897 days ago and maintenance is dormant—if you need active support or expect frequent TLD updates, verify that the cached list meets your requirements or plan to fork/maintain it yourself. ## Install pip install urlextract uv add urlextract poetry add urlextract ## Installing urlextract Before you install: Low friction install with four lightweight runtime dependencies. Last release was 897 days ago; repository is not archived but marked dormant, indicating the package is stable but receives infrequent updates. License in practice: MIT license is permissive—you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions. Quickstart: pip install urlextract from urlextract import URLExtract extractor = URLExtract() urls = extractor.find_urls("Text with URLs. Let's have URL janlipovsky.cz as an example.") print(urls) # prints: ['janlipovsky.cz'] Verify before relying: - Whether DNS validation via dnspython is included in the base install or requires separate setup - Current accuracy of TLD list and how often it is refreshed from iana.org - Performance characteristics on very large texts or high-volume extraction scenarios ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 1.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags extract urls from text, find links in text, url detection, tld-based url extraction, parse urls from strings, collect urls from content, url finder, url-extraction, text-processing, tld-parsing [View on SkillFed](https://skillfed.io/packages/urlextract) · [View on PyPI](https://pypi.org/project/urlextract/)