Preview Link
You may have seen a preview of a link with a title, image, domain, and description when you share a link on social media. This preview has a significant impact on the user's decision to click on or not click on that link.
previewlink will help you to get the preview of a link.
How it works?
previewlink looks for the following tags in the page source
- Open graph protocol
- Twitter cards
- HTML tags (title, p, img, h1, h2)
Installation
Run the following to install
pip install previewlink
Usage
>>> from previewlink import preview_link
>>> # Generate link preview
>>> preview_link("https://github.com/sreehari1997")
{
'title': 'sreehari1997 - Overview',
'description': 'Developer. sreehari1997 has 69 repositories available. Follow their code on GitHub.',
'domain': 'github.com',
'image': 'https://avatars.githubusercontent.com/u/22663556?v=4?s=400'
}
Developing previewlink
To install previewlink, along with the tools you need to develop and run tests, run the following in your virtual env
$ pip install -e .[dev]
Metadata
Release files for previewlink 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| previewlink-0.0.1.tar.gz | 6.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| previewlink-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.6 kB
Release files / previewlink-0.0.1.tar.gz
| Download URL | previewlink-0.0.1.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4374daf1b865503297c042c4659cacaf11631e517295466948281be6512d06a6
|
|
BLAKE2b-256 checksum How to use checksums |
91c8365a1c77b18f0e6d522db5f6786b48a602a848e8bfecff8d4b2d1f47c91d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
|
Release files / previewlink-0.0.1-py3-none-any.whl
| Download URL | previewlink-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d46e8bb7c07fb01591ec5a8b0261320f3f348bfe555bdc9fd8dfb17e9c152202
|
|
BLAKE2b-256 checksum How to use checksums |
09974162ebbe08ec21d494d08309a9ef5009795ed45086a988f36cb2d91bd78d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
|