Install & Compatibility
Where this runs
tested against v0.6.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.512s · 31.3MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.3s · import 0.480s · 32MB
30MB installed
● package 30MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
bootstrap_basic
✓ from micawber import bootstrap_basic
The simplest way to get a pre-configured Micawber instance with default providers.
Micawber
✓ from micawber import Micawber
For more granular control over providers and caching.
bootstrap_basic
✓ from micawber.providers import bootstrap_basic
✗ from micawber import bootstrap_basic (not strictly wrong, but the top-level import is more common for convenience)
Direct import from the providers submodule. The top-level 'from micawber import bootstrap_basic' is a convenient alias.
Initialize micawber with default OEmbed providers and an in-memory cache. Then, use `m.request()` to fetch OEmbed data for a specific URL or `m.parse_text()` to automatically find URLs within text and replace them with embedded content.
import micawber
from micawber.cache import Cache
# Configure Micawber with default providers and an in-memory cache
m = micawber.bootstrap_basic(cache=Cache())
# Example URL (using a real OEmbed example, this is usually a video)
youtube_url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
# Request OEmbed data for a URL
try:
response = m.request(youtube_url)
print(f"Title: {response.get('title')}")
print(f"Type: {response.get('type')}")
print(f"HTML: {response.get('html', 'No HTML provided')[:50]}...")
except Exception as e:
print(f"Error requesting OEmbed data: {e}")
# Alternatively, parse text containing URLs and replace them with rich content
text_with_url = f'Check out this video: {youtube_url} and some other stuff.'
html_output = m.parse_text(text_with_url)
print("\n--- Parsed Text HTML Output ---")
print(html_output[:200] + '...') # Print first 200 chars for brevity
Errors
Common errors & fixes
No provider found for URL: http://example.com/some-unsupported-url
The URL provided does not match any of `micawber`'s configured OEmbed providers, or the provider's endpoint has changed since `micawber`'s last update.
fixVerify if the URL's service supports OEmbed. If it does, check the official OEmbed endpoint and consider manually adding a custom provider pattern to your `micawber.Micawber` instance.
KeyError: 'title' (or 'html', 'thumbnail_url', etc.)
The OEmbed response received from the provider was missing the expected key, indicating an incomplete or malformed response, or the content could not be retrieved by the provider.
fixAccess dictionary keys using `.get('key', None)` or `.get('key', 'Default Value')` to prevent `KeyError`. Print the full `response` dictionary to debug what data was actually received. requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
A network issue (e.g., DNS resolution failure, firewall, server unavailability, or client-side connection reset) occurred while `micawber` was attempting to fetch content from an OEmbed provider.
fixVerify your internet connectivity and the status of the OEmbed provider's server. Implement retry logic with exponential backoff for network requests to handle transient connection issues.
Upgrade
Version history
0.6.2latest on PyPI · released Jan 7, 2026
Audit
Dependencies
BeautifulSoup4requiredRequired for parsing HTML content returned by some OEmbed providers.
requestsrequiredRequired for making HTTP requests to OEmbed provider endpoints.