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>
Metadata
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 | Provenance | |
|---|---|---|---|---|
| micawber-0.8.0.tar.gz | 38.2 kB | Without provenance | 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
|
Security for micawber 0.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.