You can create preview card(social card) very simple and easily. With Django? Fantastic!
# preview-card
Anyone can obtain data(url, image, title, description, etc) easily from plain text for showing preview card like Twitter, Facebook newsfeed.
# Installing ~~~ pip install preview-card ~~~
# Quick Start ~~~ from preview_card import cardview, MediaSourceType
result = cardview.get_data(plain_Text) ~~~
# Example
## CASE 1 - if article url included
CODE:
~~~ from preview_card import cardview, MediaSourceType
# Any Text you want including URL plain_text = “Hi, I read some article below. How do you think? https://www.nytimes.com/2019/09/17/technology/personaltech/iphone-11-review.html Is it cool or not?”
result = cardview.get_data(plain_Text) ~~~
RESULT:
~~~ ms_type MediaSourceType.ARTICLE url https://www.nytimes.com/2019/09/17/technology/personaltech/iphone-11-review.html image_url https://static01.nyt.com/images/2019/09/17/business/17techfix2/17techfix2-facebookJumbo.jpg title IPhone 11 and 11 Pro Review: Thinking Differently in the Golden Age of Smartphones desc This is not your typical gadget review. That’s because it is time to rethink when to upgrade your iPhone. error ~~~
—
## CASE 2 - if youtube url included
CODE
~~~ from preview_card import cardview, MediaSourceType
# Any Text you want including URL plain_text = “Hi, I watch some video below. How do you think? https://www.youtube.com/watch?v=Jzz4AEIddzY Is it cool or not?”
result = cardview.get_data(plain_Text) ~~~
RESULT
~~~ ms_type MediaSourceType.YOUTUBE url https://www.youtube.com/embed/Jzz4AEIddzY image_url title desc error ~~~
Metadata
Release files for preview-card 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| preview_card-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for preview_card-1.0.0-py3-none-any.whl |
Release files / preview_card-1.0.0-py3-none-any.whl
| Download URL | preview_card-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
17ebe232ee3cb059bffabab1f4c0d5baa46972dccab1e93040ab506d172e5842
|
|
BLAKE2b-256 checksum How to use checksums |
98a663b77f85b60f2d1776df11b709f369a35ae9127a60fd3a6bb24691a0cabc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.0 CPython/3.7.4
|
Security for preview-card 1.0.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.