Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A module to parse the Open Graph Protocol

Project Description

OpenGraph is a module of python for parsing the Open Graph Protocol, you can read more about the specification at


pip install ogp


  • Use it as a python dict
  • Input and parsing from a specific url
  • Input and parsung from html previous extracted
  • HTML output


From an URL

>>> import ogp
>>> video = ogp.OpenGraph(url="")
>>> video.is_valid()
>>> for x,y in video.items.items():
...     print "%-15s => %s" % (x, y)
site_name       => YouTube
description     => Eric Clapton and Paul McCartney perform George Harrison's "While My Guitar Gently Weeps" at the...
title           => While My Guitar Gently Weeps
url             =>
image           =>
video:type      => application/x-shockwave-flash
video:height    => 224
video           =>
video:width     => 398
type            => video


>>> HTML = """
... <html xmlns:og="">
... <head>
... <title>The Rock (1996)</title>
... <meta property="og:title" content="The Rock" />
... <meta property="og:type" content="movie" />
... <meta property="og:url" content="" />
... <meta property="og:image" content="" />
... </head>
... </html>
... """
>>> movie = ogp.OpenGraph() # or you can instantiate as follows: opengraph.OpenGraph(html=HTML)
>>> movie.parser(HTML)
>>> video.is_valid()

Release History

This version
History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(3.3 kB) Copy SHA256 Hash SHA256
Source None Aug 1, 2012

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting