• Stars
    star
    621
  • Rank 69,408 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created about 12 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a small library for extracting rich content from urls

image

A small library for extracting rich content from urls.

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',
}

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

# 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>

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

# 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>

More Repositories

1

peewee

a small, expressive orm -- supports postgresql, mysql, sqlite and cockroachdb
Python
10,766
star
2

huey

a little task queue for python
Python
4,869
star
3

sqlite-web

Web-based SQLite database browser written in Python
Python
2,867
star
4

walrus

Lightweight Python utilities for working with Redis
Python
1,135
star
5

flask-peewee

flask integration for peewee, including admin, authentication, rest api and more
Python
770
star
6

unqlite-python

Python bindings for the UnQLite embedded NoSQL database
C
387
star
7

django-relationships

Descriptive relationships between auth.users (think facebook friends and twitter followers, plus more)
Python
367
star
8

scout

RESTful search server written in Python, powered by SQLite.
Python
294
star
9

irc

tinkering with a made-from-scratch irc library in python
Python
181
star
10

pysqlite3

SQLite3 DB-API 2.0 driver from Python 3, packaged separately, with improvements
C
159
star
11

django-generic-m2m

relate anything to anything
Python
151
star
12

simpledb

miniature redis-like server implemented in Python
Python
137
star
13

python-lsm-db

Python bindings for the SQLite4 LSM database.
C
129
star
14

vedis-python

Python bindings for the Vedis embedded NoSQL database
C
122
star
15

wtf-peewee

WTForms integration for peewee
Python
110
star
16

sophy

Fast Python bindings to Sophia Database
C
80
star
17

sqlcipher3

Python 3 bindings for SQLCipher
C
75
star
18

django-generic-aggregation

annotate() and aggregate() for generically-related data.
Python
72
star
19

ucache

gametight lightweight caching library for python
Python
65
star
20

beefish

simple file encryption with pycrypto
Python
65
star
21

chrome-extensions

Personal collection of chrome extensions
JavaScript
61
star
22

sqlite-vtfunc

Implement SQLite table-valued functions with Python
Cython
56
star
23

sweepea

Fast, lightweight Python database toolkit for SQLite, built with Cython.
Cython
41
star
24

dot-theme

dotfile templating tools
Python
31
star
25

greendb

server frontend for lmdb
Python
24
star
26

kvkit

dank key/value store high-level APIs
Python
18
star
27

kt

Fast Python client for KyotoTycoon
Python
17
star
28

ukt

Kyoto Tycoon client library for Python.
Python
11
star
29

sqlite3-bloomfilter

Bloomfilter for SQLite3
C
6
star