実践「OSS≒盆栽」
oEmbedPyを使って、ドキュメントに○○○を埋め込もう
- author:
Kazuya Takei / @attakei
- date:
(not yet)
- event:
(PyCon JP 2025)
- hashtags:
Overview
About this prepresentation
This is proposal of PyCon JP 2025 lightning talks. But it is defeated...
So, I don't talk about this anywhere yet.
Who am I ?
Kazuya Takei
attakei (X, GitHub, etc)
OSS Writer
Sphinx extensions
Client library

I talked at Day 1
oEmbed
What is oEmbed ?
oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly.
Many providers!
https://oembed.com/providers.json
Bluesky, CodePen, Dailymotion, Docswell, Facebook, Gyazo, Instagram, SlideShare, SpeakerDeck, YouTube, X, and more
Convenience
I can get embed HTML by API request.
Example: Using PyCon JP TV
Convenience
By manual
Open in browser https://www.youtube.com/watch?v=DnIi4qm_p7w .
Click "share".
Click "embed".
Convenience
By oEmbed
Call https://www.youtube.com/oembed?url={URL}
$ uvx --from=httpie http \
https://www.youtube.com/oembed \
url=='https://www.youtube.com/watch?v=DnIi4qm_p7w' | jq -r '.html'
<iframe
width="200"
height="113"
src="https://www.youtube.com/embed/DnIi4qm_p7w?feature=oembed"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
title="PyCon JP TV #56: PyCon JP 2025の楽しみ方">
</iframe>
oEmbedPy
"Morden" oEmbed Python client
Return dataclass object
Support auto discovery
Integration for document builder
Usage
# /// script
# dependencies = [
# "oembedpy",
# ]
# ///
from oembedpy.application import Oembed
oembed = Oembed()
oembed.init()
content = oembed.fetch("https://www.youtube.com/watch?v=DnIi4qm_p7w")
print(content.html)
Usage
uvx --from='oembedpy[cli]' oembed.py https://www.youtube.com/watch?v=DnIi4qm_p7w
Installed 15 packages in 172ms
type: video
version: 1.0
html: <iframe width="200" height="113" src="https://www.youtube.com/embed/DnIi4qm_p7w?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen title="PyCon JP TV #56: PyCon JP 2025の楽しみ方"></iframe>
width: 200
height: 113
title: PyCon JP TV #56: PyCon JP 2025の楽しみ方
author_name: PyCon JP
author_url: https://www.youtube.com/@PyConJP
provider_name: YouTube
provider_url: https://www.youtube.com/
cache_age: None
thumbnail_url: https://i.ytimg.com/vi/DnIi4qm_p7w/hqdefault.jpg
thumbnail_width: 480
thumbnail_height: 360
Integration for document
Sphinx integration
extensions = [
"oembedpy.adapters.sphinx",
]
Integration for document
Sphinx integration
.. oembed:: https://www.youtube.com/watch?v=DnIi4qm_p7w
:maxwidth: 960
:maxheight: 640
Integration for document
Sphinx integration
.. oembed:: https://x.com/pyconjapan/status/1971471046692807040
次のトークをお知らせします。
— PyCon JP (@pyconjapan) September 26, 2025
16:15~
OSS≒盆栽 〜個人的趣味として無理なくOSS開発をするときに意識したいこと〜
登壇者: Kazuya Takei (attakei)
ルーム: ダリア1https://t.co/bgG3TulWns#PyConJP2025 #pyconjp_2
Integration for document
Sphinx integration
.. oembed:: https://bsky.app/profile/attakei.dev/post/3lzmykxlsmc2s
#pyhack による教育の賜物 ※ラガー、コーヒー味のエール、ヴァイツェン #青空ごはん部
— kAZUYA kAKEI (@attakei.dev) 2025-09-25T03:19:08.199Z
Integration for document
Q: I don't use Sphinx!!!
A: OK, do you use MkDocs?
Integration for document
MkDocs Integration
plugins:
# - oembedpy
- oembedpy:
fallback_type: true
Integration for document
MkDocs Integration
```oembed
https://bsky.app/profile/attakei.dev/post/3lzmykxlsmc2s
```
#pyhack による教育の賜物 ※ラガー、コーヒー味のエール、ヴァイツェン #青空ごはん部
— kAZUYA kAKEI (@attakei.dev) 2025-09-25T03:19:08.199Z
Why did I make it ?
There are already python implementations

Last update is 8 years ago
Classifier is Python 2 only!!
Last update is 5 years ago
Classifier is Python 2 and Python 3.3!!
Last update is 9 years ago
Classifier is Python 2.5, 2.6 and 3.4!!
Any libraries already stopped maintenance!!
What do you do if there is not lib matched for you ?
We can make it !!
Thank you
attakei/oEmbedPy