[](https://badge.fury.io/py/embedX)
[](https://www.quantifiedcode.com/app/project/69f2bf7e3b404e6c90015053e48a1cbf)
# 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,
etc.
Embeddable code-generation be simple like this:
>>> from embed_x import OnlineContent
>>> oc = OnlineContent('http://www.youtube.com/embed/_lOT2p_FCvA')
>>> oc.get_embed_code()
"<div class='embedx-yt'><iframe src='http://www.youtube.com/embed/_lOT2p_FCvA' 'frameborder='0' allowfullscreen></iframe></div>"
### Currently, supports
* Youtube video,
* Vimeo video,
* Twitter: single status,
* Github gist,
* Flickr image
### Examples of URLs
#### Valid
* http://youtu.be/_lOT2p_FCvA
* www.youtube.com/watch?v=_lOT2p_FCvA&feature=feedu
* http://www.youtube.com/embed/_lOT2p_FCvA
* https://www.youtube.com/watch?v=rTHlyTphWP0&index=6&list=PLjeDyYvG6-40qawYNR4juzvSOg-ezZ2a6
* youtube.com/watch?v=_lOT2p_FCvA
* https://vimeo.com/groups/animation/videos/150618894/
* https://vimeo.com/150519302
* https://twitter.com/codinghorror/status/686254714938200064
*
#### Invalid:
* youtu.be/watch?v=_lOT2p_FCvA [ because Youtube don't give any url like this ]
* https://twitter.com/gvanrossum/with_replies
*
## Install
### from PyPI
pip install embedx
### Directly from source
pip install git+https://github.com/kmonsoor/embedX.git
## Requirements
This library don't have any external dependencies other than standard Python installation.
## Usage
>>> from embedx import OnlineContent
>>> oc = OnlineContent('http://www.youtube.com/embed/_lOT2p_FCvA')
>>> oc.extract_id()
'_lOT2p_FCvA'
>>> oc.get_embed_code()
"<div class='embed-container'><iframe src='http://www.youtube.com/embed/_lOT2p_FCvA' 'frameborder='0'allowfullscreen></iframe></div>"
>>> oc = OnlineContent('https://vimeo.com/groups/animation/videos/150618894/')
>>> oc.get_embed_code()
"<div class='embed-container'> <iframe src='http://player.vimeo.com/video/150618894' 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](http://conda.pydata.org/docs/index.html)-based installation
* Add more rich-content sites
- [x] Github gists
- [ ] Facebook status
- [ ] Facebook notes
- [ ] Scribd docs
- [ ] Imgur images
## Contributors
* Seed idea : [A StackOverflow answer](http://stackoverflow.com/a/7936523) by [Mikhail Kashkin](http://stackoverflow.com/users/85739/mikhail-kashkin)
* Author : [Khaled Monsoor](http://github.com/kmonsoor)
*
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.
Metadata
Release files for embedX 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| embedx-0.0.7.tar.gz | 6.2 kB | Without provenance | Details for embedx-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| embedx-0.0.7-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for embedx-0.0.7-py2.py3-none-any.whl |
Total release size: 14.1 kB
Release files / embedx-0.0.7.tar.gz
| Download URL | embedx-0.0.7.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e329c0af0fa927ef9b53e7fdb153d621249b0462581c4a46d8faa063be76a2e
|
|
BLAKE2b-256 checksum How to use checksums |
0a0ed29b5c9727c9e5d516a23d771a5c083a78256095195a9db49e6e05613fd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / embedx-0.0.7-py2.py3-none-any.whl
| Download URL | embedx-0.0.7-py2.py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c839247eb29f61b0646f6f8dcdbcd79c305bc775b415be6af796c2e81560336e
|
|
BLAKE2b-256 checksum How to use checksums |
cb43e4e41f23e822c913003b7a0814d3b6514ed19c66eea180220232cab031ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for embedX 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.