{"id":48394357,"url":"https://github.com/gri38/hyperlink_preview","last_synced_at":"2026-04-06T01:17:08.163Z","repository":{"id":39486953,"uuid":"451166122","full_name":"gri38/hyperlink_preview","owner":"gri38","description":"Small visual preview and brief description of a http link: this library gets the data.","archived":false,"fork":false,"pushed_at":"2022-06-24T10:10:36.000Z","size":43,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-25T14:17:03.792Z","etag":null,"topics":["hyperlink","og-parser","ogp","ogp-image","ogp-meta","opengraph","opengraph-data","opengraph-parser","opengraph-tags","preview"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gri38.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-23T16:41:26.000Z","updated_at":"2025-06-01T01:09:03.000Z","dependencies_parsed_at":"2022-09-22T04:11:53.165Z","dependency_job_id":null,"html_url":"https://github.com/gri38/hyperlink_preview","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gri38/hyperlink_preview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gri38%2Fhyperlink_preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gri38%2Fhyperlink_preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gri38%2Fhyperlink_preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gri38%2Fhyperlink_preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gri38","download_url":"https://codeload.github.com/gri38/hyperlink_preview/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gri38%2Fhyperlink_preview/sbom","scorecard":{"id":445434,"data":{"date":"2025-08-11","repo":{"name":"github.com/gri38/hyperlink_preview","commit":"1ad0aa4fe7edf52c26674b28c1ae35c4170776c4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/package.yml:1","Warn: no topLevel permission defined: .github/workflows/python-workflow.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/gri38/hyperlink_preview/package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/gri38/hyperlink_preview/package.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/package.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/gri38/hyperlink_preview/package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-workflow.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/gri38/hyperlink_preview/python-workflow.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-workflow.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/gri38/hyperlink_preview/python-workflow.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-workflow.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/gri38/hyperlink_preview/python-workflow.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/package.yml:27","Warn: pipCommand not pinned by hash: .github/workflows/package.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/package.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/package.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/python-workflow.yml:27","Warn: pipCommand not pinned by hash: .github/workflows/python-workflow.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/python-workflow.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/python-workflow.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/python-workflow.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/python-workflow.yml:32","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of  10 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T06:37:25.847Z","repository_id":39486953,"created_at":"2025-08-19T06:37:25.847Z","updated_at":"2025-08-19T06:37:25.847Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31455643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hyperlink","og-parser","ogp","ogp-image","ogp-meta","opengraph","opengraph-data","opengraph-parser","opengraph-tags","preview"],"created_at":"2026-04-06T01:17:07.371Z","updated_at":"2026-04-06T01:17:08.155Z","avatar_url":"https://github.com/gri38.png","language":"Python","readme":"[![HitCount](https://hits.dwyl.com/gri38/hyperlink_preview.svg?style=flat-square\u0026show=unique)](http://hits.dwyl.com/gri38/hyperlink_preview) ![badge workflow](https://github.com/gri38/hyperlink_preview/actions/workflows/python-workflow.yml/badge.svg) ![badge covergae](https://codecov.io/gh/gri38/hyperlink_preview/branch/main/graph/badge.svg) \n# hyperlink_preview\n\n## Purpose\n\nHyperlink_preview allows getting data needed to display a small visual preview of a http link.  \nIt searches deeper than only `\u003cmeta property=\"og:` tags. It also parses other tags in \\\u003chead\\\u003e or the html \\\u003cbody\\\u003e if needed to have all data needed for the preview.  \nIt also have an \"asynchronous\" data getter to avoid having to wait for the full analysis of the images (see below).\n\n## Demo\nA small demo is provided.  \nCreate an venv, install the package, and test (above code is for windows):\n```\npy -3 -m venv venv\nvenv\\Scripts\\activate.bat\npip install hyperlink_preview\npython -m hyperlink_preview.demo_html https://en.wikipedia.org/wiki/Your_Name\n```\nIt will:\n- get the data to build the preview:\n```\nData for preview:\n    title: Your Name - Wikipedia\n    type: website\n    image: https://upload.wikimedia.org/wikipedia/en/0/0b/Your_Name_poster.png\n    url: https://en.wikipedia.org/wiki/Your_Name\n    description: Your Name (Japanese: 君の名は。,...\n    site_name: en.wikipedia\n    domain: en.wikipedia.org\n```\n- and open your web browser with an exemple of a preview:\n\n\n![image](https://user-images.githubusercontent.com/26554495/151885801-10da1770-6b4a-4633-8541-3be7a275c755.png)\n\n## Install\n\n```\npip install hyperlink_preview\n```\n\n## Usage\n\n```python\nimport hyperlink_preview as HLP\n\nhlp = HLP.HyperLinkPreview(url=\"https://en.wikipedia.org/wiki/Your_Name\")\nif hlp.is_valid:\n    preview_data = hlp.get_data()\n    # Return a dict with keys: ['title', 'type', 'image', 'url', 'description', 'site_name']\n    # Values are None or the value for building a preview.\n```\n\n## Details\n\nHyperLinkPreview searches for [og tags](https://ogp.me/).  \nIf the target link does not provide them (or not all), HyperLinkPreview searches deeper to find suitable data.  \n\n### About images and performance\n\nIf no image is provided, we search for all img tags in the html. Today `GIF, PNG and JPG image formats are handled`.  \nWe take the sizes of all those images, and we give preference to the largest, and whose ratio is \u003c3 and whose sides are \u003e 50px.  \nFor the sake of efficiency:\n  - **read only bytes necessary** to know the dimensions of the images (not the whole image)\n  - **parallelized requests** to all the images\n\nHowever, if the target link contains a lot of pictures, it can take a while (one to several seconds) to do all the requests. A hyperlink preview may need to be displayed quickly (for instance: on mouse hover). In that case:\n\n### Get all data except image first, then image\n```python\nimport hyperlink_preview as HLP\n\nhlp = HLP.HyperLinkPreview(url=\"https://en.wikipedia.org/wiki/Your_Name\")\nif hlp.is_valid:\n    preview_data = hlp.get_data(wait_for_imgs=False)\n    # returns as soon as the data are fetched, but don't wait to \"parse\" all images tags if needed.\n    # it allows you to display a spinner as link preview image (or anything else to keep your user waiting).\n    \n\n# ... later you can get the remaining image data if needed:\nif preview_data[\"image\"] is None:\n    preview_data = hlp.get_data(wait_for_imgs=True)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgri38%2Fhyperlink_preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgri38%2Fhyperlink_preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgri38%2Fhyperlink_preview/lists"}