Skip to main content

Generate responsive, embeddable HTML/JS code from URL of online content

Project description

[![PyPI version](](
[![Code Issues](](

# embedX

Generate embeddable HTML or JavaScript code for a online content from its URL in a single step.

The content can be anything like

* Youtube or Vimeo video,
* Twitter status,
* Github Gist,

Embeddable code-generation be simple like this:

>>> from embed_x import OnlineContent
>>> oc = OnlineContent('')
>>> oc.get_embed_code()
"<div class='embedx-yt'><iframe src='' 'frameborder='0' allowfullscreen></iframe></div>"

### Currently, supports

* Youtube video,
* Vimeo video,
* Twitter: single status,
* Github gist,
* Flickr image

### Examples of URLs

#### Valid


#### Invalid:

* [ because Youtube don't give any url like this ]

## Install

### from PyPI

pip install embedx

### Directly from source

pip install git+

## Requirements

This library don't have any external dependencies other than standard Python installation.

## Usage

>>> from embedx import OnlineContent
>>> oc = OnlineContent('')
>>> oc.extract_id()

>>> oc.get_embed_code()
"<div class='embed-container'><iframe src='' 'frameborder='0'allowfullscreen></iframe></div>"

>>> oc = OnlineContent('')
>>> oc.get_embed_code()
"<div class='embed-container'> <iframe src='' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>"

## To-do

* Create test cases for automated testing
* Provision Travis-CI for automatic building & testing
* Add support for [conda]( installation
* Add more rich-content sites

- [x] Github gists
- [ ] Facebook status
- [ ] Facebook notes
- [ ] Scribd docs
- [ ] Imgur images

## Contributors

* Seed idea : [A StackOverflow answer]( by [Mikhail Kashkin](
* Author : [Khaled Monsoor](

Please try to contribute by submitting more content-sites with their different link formats and embed-codes. You can submit through pull-requests or by creating issue.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

embedx-0.0.7.tar.gz (6.2 kB view hashes)

Uploaded source

Built Distribution

embedx-0.0.7-py2.py3-none-any.whl (8.0 kB view hashes)

Uploaded 2 7

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page