micawber 0.3.3

a small library for extracting rich content from urls

A small library for extracting rich content from urls. [Live demo](http://micawberdemo.appspot.com/).

what does it do?

micawber supplies a few methods for retrieving rich metadata about a variety of links, such as links to youtube videos. micawber also provides functions for parsing blocks of text and html and replacing links to videos with rich embedded content.

examples

here is a quick example:

import micawber

# load up rules for some default providers, such as youtube and flickr
providers = micawber.bootstrap_basic()

providers.request('http://www.youtube.com/watch?v=54XHDUOHuzU')

# returns the following dictionary:
{
    'author_name': 'pascalbrax',
    'author_url': u'http://www.youtube.com/user/pascalbrax'
    'height': 344,
    'html': u'<iframe width="459" height="344" src="http://www.youtube.com/embed/54XHDUOHuzU?fs=1&feature=oembed" frameborder="0" allowfullscreen></iframe>',
    'provider_name': 'YouTube',
    'provider_url': 'http://www.youtube.com/',
    'title': 'Future Crew - Second Reality demo - HD',
    'type': u'video',
    'thumbnail_height': 360,
    'thumbnail_url': u'http://i2.ytimg.com/vi/54XHDUOHuzU/hqdefault.jpg',
    'thumbnail_width': 480,
    'url': 'http://www.youtube.com/watch?v=54XHDUOHuzU',
    'width': 459,
    'version': '1.0',
}

micawber.parse_text('this is a test:\nhttp://www.youtube.com/watch?v=54XHDUOHuzU', providers)

# returns the following string:
this is a test:
<iframe width="459" height="344" src="http://www.youtube.com/embed/54XHDUOHuzU?fs=1&feature=oembed" frameborder="0" allowfullscreen></iframe>

micawber.parse_html('<p>http://www.youtube.com/watch?v=54XHDUOHuzU</p>', providers)

# returns the following html:
<p><iframe width="459" height="344" src="http://www.youtube.com/embed/54XHDUOHuzU?fs=1&amp;feature=oembed" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>

Author

Charles Leifer

Pip

micawber==0.3.3

Classifiers

  • Environment :: Web Environment
  • Framework :: Django
  • Intended Audience :: Developers
  • License :: OSI Approved :: MIT License
  • Operating System :: OS Independent
  • Programming Language :: Python
  • Programming Language :: Python :: 2.6
  • Programming Language :: Python :: 2.7
  • Programming Language :: Python :: 3.2
  • Programming Language :: Python :: 3.3
  • Development Status :: 4 - Beta
File Type Python Version Uploaded On Downloads
micawber-0.3.3.tar.gz Source July 16, 2015 4,560
Version Release Date
0.3.3 July 16, 2015
0.3.2 March 29, 2015
0.3.1 Sept. 4, 2014
0.3.0 June 12, 2013
0.2.6 March 18, 2013
0.2.5 Oct. 8, 2012
0.2.4 July 25, 2012
0.2.3 May 7, 2012
0.2.2 April 18, 2012
0.2.1 April 18, 2012
0.2.0 April 17, 2012
0.1.0 March 28, 2012
Date Package Version Action
Aug. 24, 2015, 11:43 p.m. micawber 0.1.0 Release Created
Aug. 24, 2015, 11:43 p.m. micawber 0.2.0 Release Created
Aug. 24, 2015, 11:43 p.m. micawber 0.2.1 Release Created
Aug. 24, 2015, 11:43 p.m. micawber 0.2.2 Release Created
Aug. 24, 2015, 11:43 p.m. micawber 0.2.3 Release Created
Aug. 24, 2015, 11:43 p.m. micawber 0.2.4 Release Created
Aug. 24, 2015, 11:43 p.m. micawber 0.2.5 Release Created
Aug. 24, 2015, 11:43 p.m. micawber 0.2.6 Release Created
Aug. 24, 2015, 11:43 p.m. micawber 0.3.1 Release Created
Aug. 24, 2015, 11:43 p.m. micawber 0.3.0 Release Created
Aug. 24, 2015, 11:43 p.m. micawber 0.3.3 Release Created
Aug. 24, 2015, 11:43 p.m. micawber 0.3.2 Release Created
Aug. 24, 2015, 11:43 p.m. micawber Package Created