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('https://www.youtube.com/watch?v=54XHDUOHuzU', maxwidth=640)
# returns the following dictionary:
{
'author_name': 'Pascal Brax',
'author_url': 'https://www.youtube.com/@PascalBrax',
'height': 480,
'html': '<iframe width="640" height="480" src="https://www.youtube.com/embed/54XHDUOHuzU?feature=oembed" ...></iframe>',
'provider_name': 'YouTube',
'provider_url': 'https://www.youtube.com/',
'thumbnail_height': 360,
'thumbnail_url': 'https://i.ytimg.com/vi/54XHDUOHuzU/hqdefault.jpg',
'thumbnail_width': 480,
'title': 'Future Crew - Second Reality demo - HD',
'type': 'video',
'url': 'https://www.youtube.com/watch?v=54XHDUOHuzU',
'version': '1.0',
'width': 640,
}
providers.parse_text('this is a test:\nhttps://www.youtube.com/watch?v=54XHDUOHuzU')
# returns the following string:
this is a test:
<iframe width="200" height="150" src="https://www.youtube.com/embed/54XHDUOHuzU?feature=oembed" ...></iframe>
providers.parse_html('<p>https://www.youtube.com/watch?v=54XHDUOHuzU</p>')
# returns the following html:
<p><iframe width="200" height="150" src="https://www.youtube.com/embed/54XHDUOHuzU?feature=oembed" ...></iframe></p>
Release files for micawber 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| micawber-0.8.0.tar.gz | 38.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| micawber-0.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.4 kB
Release files / micawber-0.8.0.tar.gz
| Download URL | micawber-0.8.0.tar.gz |
|---|---|
| Size | 38.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
deedaa9117c56c7d80030ac5566fdc5b52b3eb6a9faf2baa69408896d9090d28
|
|
BLAKE2b-256 checksum How to use checksums |
92946c4e22f7337d0abdd092e0804fa189925dfca06911eab426f4654a2c67c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / micawber-0.8.0-py3-none-any.whl
| Download URL | micawber-0.8.0-py3-none-any.whl |
|---|---|
| Size | 41.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3acc181c2baa6c01c811bd4cdbbfcaf2b0ee3552d7ecd81613fe3f6b79412286
|
|
BLAKE2b-256 checksum How to use checksums |
516d390a1e44476b67e14478c1a3415210983ee57731ee2dd1561ee0a7325960
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|