{ "info": { "author": "Embed.ly, Inc.", "author_email": "support@embed.ly", "bugtrack_url": null, "classifiers": [], "description": "embedly-python\n==============\nPython library for interacting with Embedly's API. To get started sign up for\na key at `embed.ly/signup `_.\n\nInstall\n-------\nInstall with `Pip `_ (recommended)::\n\n pip install embedly\n\nOr easy_install::\n\n easy_install Embedly\n\nOr setuptools::\n\n git clone git://github.com/embedly/embedly-python.git\n python setup.py\n\nSetup requires Setuptools 0.7+ or Distribute 0.6.2+ in order to take advantage\nof the ``2to3`` option. Setup will still run on earlier versions but you'll\nsee a warning and ``2to3`` won't happen. Read more in the Setuptools\n`docs `_\n\nGetting Started\n---------------\nThis library is meant to be a dead simple way to interact with the Embedly API.\nThere are only 2 main objects, the ``Embedly`` client and the ``Url`` response\nmodel. Here is a simple example and then we will go into the objects::\n\n >>> from embedly import Embedly\n >>> client = Embedly(:key)\n >>> obj = client.oembed('http://instagram.com/p/BL7ti/')\n >>> obj['type']\n u'photo'\n >>> obj['url']\n u'http://images.ak.instagram.com/media/2011/01/24/cdd759a319184cb79793506607ff5746_7.jpg'\n\n >>> obj = client.oembed('http://instagram.com/error/error/')\n >>> obj['error']\n True\n\nEmbedly Client\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\nThe Embedly client is a object that takes in a key and optional User Agent\nand timeout parameters then handles all the interactions and HTTP requests\nto Embedly. To initialize the object, you'll need the key that you got when\nyou signed up for Embedly.\n::\n\n >>> from embedly import Embedly\n >>> client = Embedly('key')\n >>> client2 = Embedly('key', 'Mozilla/5.0 (compatible; example-org;)')\n >>> client3 = Embedly('key', 'Mozilla/5.0 (compatible; example-org;)', 30)\n >>> client4 = Embedly('key', timeout=10, user_agent='Mozilla/5.0 (compatible; example-org;)')\n\nThe client object now has a bunch of different methods that you can use.\n\n``oembed``\n Corresponds to the `oEmbed endpoint\n `_. Passes back an object\n that allows you to retrieve a title, thumbnail, description and the embed\n html::\n\n >>> client.oembed('http://vimeo.com/18150336')\n \n\n``extract``\n Corresponds to the `Extract endpoint\n `_. Passes back an\n object that allows you to retrieve a title, description, content, html and a\n list of images.::\n\n >>> client.extract('http://vimeo.com/18150336')\n \n\n``preview``\n Corresponds to the `Preview endpoint\n `_. Passes back a simple object\n that allows you to retrieve a title, description, content, html and a list of\n images.::\n\n >>> client.preview('http://vimeo.com/18150336')\n \n\n``objectify``\n Corresponds to the `Objectify endpoint\n `_. Passes back a simple object\n that allows you to retrieve pretty much everything that Embedly knows about a\n URL.::\n\n >>> client.objectify('http://vimeo.com/18150336')\n \n\nThe above functions all take the same arguements, a URL or a list of URLs and\nkeyword arguments that correspond to Embedly's `query arguments\n`_. Here is an example::\n\n >>> client.oembed(['http://vimeo.com/18150336',\n 'http://www.youtube.com/watch?v=hD7ydlyhvKs'], maxwidth=500, words=20)\n\nThere are some supporting functions that allow you to limit URLs before sending\nthem to Embedly. Embedly can return metadata for any URL, these just allow a\ndeveloper to only pass a subset of Embedly `providers\n`_. Note that URL shorteners like bit.ly or t.co are\nnot supported through these regexes.\n\n``regex``\n If you would like to only send URLs that returns embed HTML via Embedly you\n can match the URL to the regex before making the call. The matching providers\n are listed at `embed.ly/providers `_::\n\n >>> url = 'http://vimeo.com/18150336'\n >>> client.regex.match(url)\n <_sre.SRE_Match at 0x1017ba718>\n\n``is_supported``\n This is a simplified version of ``regex``::\n\n >>> url = 'http://vimeo.com/18150336'\n >>> client.is_supported(url)\n True\n\nUrl Object\n\"\"\"\"\"\"\"\"\"\"\nThe ``Url`` object is basically a response dictionary returned from\none of the Embedly API endpoints.\n::\n\n >>> response = client.oembed('http://vimeo.com/18150336', words=10)\n\nDepending on the method you are using, the response will have different\nattributes. We will go through a few, but you should read the `documentation\n`_ to get the full list of data that is passed back.\n::\n\n >>> response['type']\n u'video'\n >>> response['title']\n u'Wingsuit Basejumping - The Need 4 Speed: The Art of Flight'\n >>> response['provider_name']\n u'Vimeo'\n >>> response['width']\n 1280\n\nAs you can see the ``Url`` object works like a dictionary, but it's slightly\nenhanced. It will always have ``method`` and ``original_url`` attributes,\nwhich represent the Embedly request type and the URL requested.\n::\n\n >>> response.method\n 'oembed'\n >>> response.original_url\n 'http://vimeo.com/18150336'\n\n # useful because the response data itself may not have a URL\n # (or it could have a redirected link, querystring params, etc)\n >>> response['url']\n ...\n KeyError: 'url'\n\nFor the Preview and Objectify endpoints the sub-objects can also be accessed in\nthe same manner.\n::\n\n >>> obj = client.preview('http://vimeo.com/18150336', words=10)\n >>> obj['object']['type']\n u'video'\n >>> obj['images'][0]['url']\n u'http://b.vimeocdn.com/ts/117/311/117311910_1280.jpg'\n\nError Handling\n--------------\nIf there was an error processing the request, the ``Url`` object will contain\nan error. For example if we use an invalid key, we will get a 401 response back\n::\n\n >>> client = Embedly('notakey')\n >>> obj = client.preview('http://vimeo.com/18150336')\n >>> obj['error']\n True\n >>> obj['error_code']\n 401\n\nCopyright\n---------\nCopyright (c) 2013 Embed.ly, Inc. See LICENSE for details.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/embedly/embedly-python", "keywords": null, "license": "Copyright (c) 2011, Embed.ly, Inc.\n All rights reserved. Released under the 3-clause BSD license.", "maintainer": null, "maintainer_email": null, "name": "Embedly", "package_url": "https://pypi.org/project/Embedly/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Embedly/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/embedly/embedly-python" }, "release_url": "https://pypi.org/project/Embedly/0.5.0/", "requires_dist": null, "requires_python": null, "summary": "Python Library for Embedly", "version": "0.5.0" }, "last_serial": 937925, "releases": { "0.4": [ { "comment_text": "", "digests": { "md5": "51114cc113806eeffed45772726aef06", "sha256": "9820afa02643b7f7ac9d062c1fd24134cd85ade1c354da17c3feda9e54d4c955" }, "downloads": -1, "filename": "Embedly-0.4.tar.gz", "has_sig": false, "md5_digest": "51114cc113806eeffed45772726aef06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6320, "upload_time": "2011-11-28T20:21:29", "url": "https://files.pythonhosted.org/packages/74/d2/27199e62571b8dce67b1d186739b6f1364c485f86e9e0af34716f4e511f0/Embedly-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "efa12c2e26747c6d4dc0352c2463c76f", "sha256": "372d5d642425381258012aae864aa659e4927ffdc65dd98f0b0745f67142567e" }, "downloads": -1, "filename": "Embedly-0.4.1.tar.gz", "has_sig": false, "md5_digest": "efa12c2e26747c6d4dc0352c2463c76f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6465, "upload_time": "2011-11-28T20:39:45", "url": "https://files.pythonhosted.org/packages/91/1f/220ecc2b59cca24cf753a45611e3e108166069b1e0907e09fd909faee7d0/Embedly-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "0e89a8f5bd5e389bb6fe02c452ced614", "sha256": "0ee3bd02a808129dcd720cc38cfa28a955f6fdc1041ff2713ad124f2dfb42982" }, "downloads": -1, "filename": "Embedly-0.4.2.tar.gz", "has_sig": false, "md5_digest": "0e89a8f5bd5e389bb6fe02c452ced614", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6540, "upload_time": "2011-11-28T21:06:20", "url": "https://files.pythonhosted.org/packages/6d/8a/623f867c38bda2e74691f74acaae30c3e23a02cd8b5f65a94575639c865b/Embedly-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "f52efc42a67b8180f7c03c06d7f47589", "sha256": "e12e32bf600538e4dc8d0e4ea5c5f8e91b58ac21dc7c14168a16e16db0e7d812" }, "downloads": -1, "filename": "Embedly-0.4.3.tar.gz", "has_sig": false, "md5_digest": "f52efc42a67b8180f7c03c06d7f47589", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6702, "upload_time": "2012-03-15T22:02:33", "url": "https://files.pythonhosted.org/packages/31/aa/c8dd6a72783d7cb41bd5c40d666a517734c6e1e5cb0ff8cfe53a55132388/Embedly-0.4.3.tar.gz" } ], "0.4.4": [ { "comment_text": "", "digests": { "md5": "603a820c1adbccdd37250e322c8194ce", "sha256": "8e06efb01addd3afce62dee4e170b35aaf3f6273f437121a10726e3dec47b40f" }, "downloads": -1, "filename": "Embedly-0.4.4.tar.gz", "has_sig": false, "md5_digest": "603a820c1adbccdd37250e322c8194ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6448, "upload_time": "2013-03-25T20:01:59", "url": "https://files.pythonhosted.org/packages/32/1f/54b6a3b0bc13d80790dc52b668e4fddf1a9946e10d12ce877ccc40c6cad0/Embedly-0.4.4.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "67bfdf6496e219307ffbefef15748702", "sha256": "e10bca4b5e25e8f30e93eb459921f787b08efc4004b6370a68f4c8984f6f16e1" }, "downloads": -1, "filename": "Embedly-0.5.0.tar.gz", "has_sig": false, "md5_digest": "67bfdf6496e219307ffbefef15748702", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7812, "upload_time": "2013-12-06T22:07:51", "url": "https://files.pythonhosted.org/packages/d7/94/2e387186617fe450fd21da3fd08c4ea1c68914c21622e939a892755620bc/Embedly-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "67bfdf6496e219307ffbefef15748702", "sha256": "e10bca4b5e25e8f30e93eb459921f787b08efc4004b6370a68f4c8984f6f16e1" }, "downloads": -1, "filename": "Embedly-0.5.0.tar.gz", "has_sig": false, "md5_digest": "67bfdf6496e219307ffbefef15748702", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7812, "upload_time": "2013-12-06T22:07:51", "url": "https://files.pythonhosted.org/packages/d7/94/2e387186617fe450fd21da3fd08c4ea1c68914c21622e939a892755620bc/Embedly-0.5.0.tar.gz" } ] }