Skip to content

attakei/oEmbedPy

Repository files navigation

oEmbedPy

Note

This is yet experimental product. It will be implemented needy features incrementally.

Overview

This is oEmbed client for Python.

Features

  • Simple usage
  • Python 3.x native
  • Multiple endpoint discovery

Installation

This is uploaded on PyPI.

pip install oEmbedPy

Usage

Library

>>> from oembedpy.application import Oembed

>>> oembed = Oembed()
>>> content = oembed.fetch("https://twitter.com/attakei")
>>> print(content.type)
rich

Commandline

Note

It needs Click for using CLI. Run extra install 'cli'.

Simple usage for author's video (omitted some output).

$ oEmbed.py 'https://www.youtube.com/watch?v=Oyh8nuaLASA'
title:            Yoshi ( ...
author_name:      attakei
thumbnail_height: 360
thumbnail_width:  400

If you want JSON, use --format option.

$ oEmbed.py --format=json 'https://www.youtube.com/watch?v=Oyh8nuaLASA'
{"title":"Yoshi (NES - Nint ..."}

Others

This has extension for easy-using. Please see documentation.

License

Apache License 2.0