Skip to main content

A module of parsing the open graph protocol and extracing the summary of the web page.

Project description

ExtendedOpenGraphParser is a python module for parsing the Open Graph Protocol.

Open Graph Protocol spec: http://ogp.me/

Installation

pip install ExtendedOpenGraph

Features

  • Based on opengraph.

  • If not exist Open Graph properties in meta tag, it is able to parse basic Metadata.

  • Input URL and HTML.

  • Output python dictionary.

  • Like Facebook.

Usage

input : url

>>> import ExtendedOpenGraph
>>> data = ExtendedOpenGraph.parse(url="http://www.twitter.com")
>>> for key, value in data.items():
...     print "%-15s => %s" % (key, value)
...
url             => http://www.twitter.com
image           => https://abs.twimg.com/a/1373572090/t1/img/front_page/jp-mountain@2x.jpg
type            => website
title           => 트위터

input : html

>>> ex_html="<html><head><title>ExtendOpenGraph</title></head><body><img src='logo.png'/></body></html>"
>>> data = ExtendedOpenGraph.parse(html=ex_html)
>>> for key, value in data.items():
...     print "%-15s => %s" % (key, value)
...
url             => None
image           => logo.png
type            => website
title           => ExtendOpenGraph

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

ExtendedOpenGraph-0.3.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file ExtendedOpenGraph-0.3.tar.gz.

File metadata

File hashes

Hashes for ExtendedOpenGraph-0.3.tar.gz
Algorithm Hash digest
SHA256 7bfb1650a29db154832dc59f816e2404131a9586360a5b0ec18366048ff06b2b
MD5 3207cd3e232731820e76d2ea6877d1ec
BLAKE2b-256 ed449ada67a91d79be491f39996b2a9365e4ff2e863b33ae8046750155734b1a

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