link_Preview
A python module that gathers elements required for linkPreview.
Overview
link_preview is now a fashionable way of sharing links in social media. The contents of what the preview is made up are:-
1. og.title:-
Title of the preview.
In HTML: <meta property="og.title" content="XYZ">
Value: XYZ
2. og.description:-
Description of the preview.
In HTML: <meta property="og.description" content="XYZ">
Value: XYZ
3. og.image:-
Image of the preview.
In HTML: <meta property="og.image" content="XYZ">
Value: XYZ
4. title:-
if 'og:title' is not found, this becomes the Title.
In HTML: <title>XYZ</title>
Value: XYZ
5. meta description:-
if 'og:description' is not found, this becomes the Description.
In HTML: <meta name="description" content="XYZ">
Value: XYZ
6. favicon:-
if 'og:image' is not found, this becomes the Image.
In HTML: <link rel="shortcut icon" href="XYZ" type="image/x-icon">
Value: XYZ
7. website:-
Host website for the link.
Reference:- richpreview (from where I learned)
This module fetches all these data and combines those into a dictionary.
A sample WhatsApp link_preview:-
####################################### # I # Title # # M # Description # # A # # # G # website # # E # # #######################################
Usage:-
from link_preview import link_preview dict_elem = link_preview.generate_dict(url) # this is a dict() # Access values title = dict_elem['title'] description = dict_elem['description'] image = dict_elem['image'] website = dict_elem['website']
Insatallation
To install from pip, use the following command
pip install link_preview
to update, use
pip install -U link_preview
License
MIT
Metadata
Release files for link_preview 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| link_preview-1.0.zip | 4.5 kB | Without provenance | Details |
Release files / link_preview-1.0.zip
| Download URL | link_preview-1.0.zip |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d08c1c16d4f127f0f31ba0b5f8fd47581b01c178429181931af806398a9e8034
|
|
BLAKE2b-256 checksum How to use checksums |
fb100e71c62b1cf3d9f4983bd5d2defc269571e354ed2d5d1c67de58665390eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for link_preview 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.