Skip to main content

Collects and extracts URLs from given text.

Project description

URLExtract
----------

URLExtract is python class for collecting (extracting) URLs from given
text.

.. image:: https://img.shields.io/travis/lipoja/URLExtract/master.svg
:target: https://travis-ci.org/lipoja/URLExtract
:alt: Build Status
.. image:: https://img.shields.io/github/tag/lipoja/URLExtract.svg
:target: https://github.com/lipoja/URLExtract/tags
:alt: Git tag
.. image:: https://img.shields.io/pypi/pyversions/urlextract.svg
:target: https://pypi-hypernode.com/pypi/urlextract
:alt: Python Version Compatibility


How does it work
~~~~~~~~~~~~~~~~

It tries to find any occurrence of TLD in given text. If TLD is found it
starts from that position to expand boundaries to both sides searching
for "stop character" (usually whitespace, comma, single or double
quote).

NOTE: List of TLDs is downloaded from iana.org to keep you up to date with new TLDs.

Installation
~~~~~~~~~~~~

Package is available on PyPI - you can install it via pip.

.. image:: https://img.shields.io/pypi/v/urlextract.svg
:target: https://pypi-hypernode.com/pypi/urlextract
.. image:: https://img.shields.io/pypi/status/urlextract.svg
:target: https://pypi-hypernode.com/pypi/urlextract
::

pip install urlextract

Documentation
~~~~~~~~~~~~~

Online documentation is published at http://urlextract.readthedocs.io/


Requirements
~~~~~~~~~~~~

- IDNA for converting links to IDNA format
- uritools for domain name validation

::

pip install idna
pip install uritools

Example
~~~~~~~

You can look at command line program *bin/urlextract*.
But everything you need to know is this:

.. code:: python

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']

License
~~~~~~~

This piece of code is licensed under The MIT License.

Project details


Download files

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

Source Distribution

urlextract-0.3.1.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file urlextract-0.3.1.tar.gz.

File metadata

  • Download URL: urlextract-0.3.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for urlextract-0.3.1.tar.gz
Algorithm Hash digest
SHA256 2bc98629b27a2ad0392beae148f3da6f3d71a228e95cd7d276d77412ec3c4548
MD5 b64d46d1762ba7149d482dfe31f5e06c
BLAKE2b-256 d7d79f1638b2c78681d758369a94c1a3fbaa58f6e6c3d912076bb02226aca99b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page