Skip to main content

Detect URL, Email, Hashtag and Mention from plain-text and convert into HTML hyperlink.

Project description

linkable-py

https://travis-ci.org/meyt/linkable-py.svg?branch=master https://coveralls.io/repos/github/meyt/linkable-py/badge.svg?branch=master https://img.shields.io/pypi/pyversions/linkable.svg

Detect URL, Email, Hashtag and Mention from plain-text and convert into HTML hyperlink.

Install

$ pip install linkable

Usage

Basic:

from linkable import Linkable

text = 'This is test with a #hashtag from @linkable on github.com'
print(Linkable(text))

Output:

This is test with <a href="/hashtag/#hashtag">#hashtag</a> from <a href="/@linkable">@linkable</a> on <a href="http://github.com">github.com</a>

Links list:

from linkable import LinkableList

text = 'This is test with a #hashtag from @linkable on github.com'
print(LinkableList(text).links)

Output:

['#hashtag', '@linkable', 'github.com']

Project details


Download files

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

Files for linkable, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size linkable-0.2.2-py3-none-any.whl (12.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size linkable-0.2.2.tar.gz (12.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page