/oEmbedPy

oEmbed client for Python

Primary LanguagePythonApache License 2.0Apache-2.0

oEmbedPy

Note

This is yet experimental product. It will be implemeted needy features incrementaly.

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 --foramt 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