Skip to content

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

License

Notifications You must be signed in to change notification settings

meyt/linkable-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linkable-py

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

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages