Skip to main content

Parses Open Graph meta tags of web pages and returns a handy JSON-like object. Use this to generate preview of web pages like you see on social media

Project description

opengraph_parse

Ben Jacobson 2020

Parses Open Graph meta tags of web pages. Use this to generate previews of web pages.

The purpose of this is to make it easy to scrape a pages opengraph meta tags. This is helpful if you ever want to create a preview of a web page like you'd see when you post to social media, or post a link on Slack.

Uses Python >=3.6.9

Installation

pip install opengraph_parse

Usage

from opengraph_parse import parse_page

if name== "main": # parse the page parsed_og_tags = parse_page("http://www.facebook.com", ["og:url", "og:image", ])

# result is a python dict containing the opengraph tags, simply print them out, or use a for loop to iterate over these. 
for key, value in parsed_og_tags.items():
    print (f"'{key}' : '{value}'")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opengraph_parse-0.0.4.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opengraph_parse-0.0.4-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file opengraph_parse-0.0.4.tar.gz.

File metadata

  • Download URL: opengraph_parse-0.0.4.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

File hashes

Hashes for opengraph_parse-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6e6065d4c961fafd6541fc96577c5ef431bac0250e4176e40466c18b9fc06a40
MD5 dfd496b3ea30c4121ad620c89901deff
BLAKE2b-256 6c42ca2eb769a2b7c45287d240506ea44db7b0e1d2eb347112834f2a5d5da180

See more details on using hashes here.

File details

Details for the file opengraph_parse-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: opengraph_parse-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

File hashes

Hashes for opengraph_parse-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c49ff9531f89a8ddcc309e0ef1d3cbc485c4a7bba63ae9cc36df3b385fa20917
MD5 4203000dcf4b4430375daa02ab450199
BLAKE2b-256 e07657e8be3e740cd65f500ea1a3e9975987cb20b2e89c585600927044efad70

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page