PyEmbed can easily be embedded into your own projects. Embedding content is just a single call:

>>> from pyembed.core import PyEmbed
>>> html = PyEmbed().embed(url)


PyEmbed can be installed using pip.

pip install pyembed



As shown above, passing a URL to the embed method will return the HTML to embed.

For example, this call:

>>> PyEmbed().embed('')

will result in the following HTML output:

<iframe width="480" height="270" src="" frameborder="0" allowfullscreen></iframe>


You can control the maximum size of the embedded content with the max_height and / or max_width parameters. For example:

>>> pyembed = PyEmbed()
>>> url = ''
>>> pyembed.embed(url, max_width = 300)
>>> pyembed.embed(url, max_width = 300, max_height = 200)