{ "info": { "author": "Adrian Sampson", "author_email": "adrian@radbox.org", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Programming Language :: Python :: 2", "Topic :: Internet :: WWW/HTTP :: Indexing/Search" ], "description": "python-blekko\n=============\n\nThis module provides simple bindings to the `Blekko`_ API. To use the API,\n`contact Blekko for an API key`_.\n\nThis module currently only supports **search queries** and **page statistics**.\nThe API also provides tools for manipulating slashtags, but this library doesn't\nsupport that yet.\n\nThe library is internally rate-limited to one query per second in accordance\nwith Blekko's guidelines.\n\n.. _Blekko: https://blekko.com/\n.. _contact Blekko for an API key: http://help.blekko.com/index.php/tag/api/\n\nSearching\n---------\n\nTo use the API, first create a ``Blekko`` object using your \"source\" or \"auth\"\nAPI key::\n\n import blekko\n api = blekko.Blekko(source='my_api_key')\n\nThen, to perform searches, use the ``query`` method. Its arguments are the\nsearch terms (as a string) and, optionally, the page number::\n\n results = api.query('peach cobbler')\n\nThe returned object is a sequence containing ``Result`` objects, which\nthemselves have a number of useful fields::\n\n for result in results:\n print result.url_title\n print result.url\n print result.snippet\n\nErrors in communicating with the server are raised as ``BlekkoError``\nexceptions, so you'll want to handle these exceptions when making calls to the\nAPI.\n\nAn Example\n''''''''''\n\nPutting it all together, here's a short script that gets a single link for\nsearch terms on the command line::\n\n import blekko\n import sys\n\n _api = blekko.Blekko(source='my_api_key')\n\n def get_link(terms):\n try:\n res = _api.query(terms + ' /ps=1')\n except blekko.BlekkoError as exc:\n print >>sys.stderr, str(exc)\n return None\n if len(res):\n return res[0].url\n\n if __name__ == '__main__':\n link = get_link(' '.join(sys.argv[1:]))\n if link:\n print(link)\n else:\n sys.exit(1)\n\nPage Statistics\n---------------\n\nBlekko provides an API for getting SEO-related statistics for a URL. Use the\n``pagestats`` method, which takes a URL as its only parameter, to get a\ndictionary containing information about a page::\n\n >>> api.pagestats('http://python.org/')\n {u'cached': True, u'ip': u'82.94.164.162', u'host_rank': 3835.107267,\n u'host_inlinks': 467267, u'adsense': None, u'dup': True,\n u'rss': u'http://www.python.org/channews.rdf'}\n\nCredits\n-------\n\nThese bindings were written by `Adrian Sampson`_ and modeled after the `Perl\nbindings`_ by Greg Lindahl. The source is made available under the `MIT\nlicense`_.\n\n.. _Adrian Sampson: https://github.com/sampsyo/\n.. _Perl bindings: http://search.cpan.org/~wumpus/WebService-Blekko-1.00_07/\n.. _MIT license: http://www.opensource.org/licenses/MIT", "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/sampsyo/python-blekko", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "blekko", "package_url": "https://pypi.org/project/blekko/", "platform": "ALL", "project_url": "https://pypi.org/project/blekko/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sampsyo/python-blekko" }, "release_url": "https://pypi.org/project/blekko/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "bindings for the Blekko search engine API", "version": "0.1.1" }, "last_serial": 660163, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "593fce5fb661f4f6c5af48802319d485", "sha256": "9e88c865f7f33affa1c51be5152ae03a4679d6133bf97d7acbaca6f86fa5fde3" }, "downloads": -1, "filename": "blekko-0.1.tar.gz", "has_sig": false, "md5_digest": "593fce5fb661f4f6c5af48802319d485", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3479, "upload_time": "2012-04-29T05:51:18", "url": "https://files.pythonhosted.org/packages/93/0c/243676a43bef3a6c2b9530b341c3cbbf3c37e1ce403cb52c64bb06acb2ef/blekko-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "636714bcfb247f5ab49835a972b1a474", "sha256": "1b1225de81d0e61a2063ba8ad0053b91e38d0c74985fec7eee8ef2c58b2890a5" }, "downloads": -1, "filename": "blekko-0.1.1.tar.gz", "has_sig": false, "md5_digest": "636714bcfb247f5ab49835a972b1a474", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3733, "upload_time": "2012-05-25T03:59:59", "url": "https://files.pythonhosted.org/packages/10/d2/fe234bf6000c644b90d00c1b549200c9febc8a24e80a7c5361bc558395b6/blekko-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "636714bcfb247f5ab49835a972b1a474", "sha256": "1b1225de81d0e61a2063ba8ad0053b91e38d0c74985fec7eee8ef2c58b2890a5" }, "downloads": -1, "filename": "blekko-0.1.1.tar.gz", "has_sig": false, "md5_digest": "636714bcfb247f5ab49835a972b1a474", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3733, "upload_time": "2012-05-25T03:59:59", "url": "https://files.pythonhosted.org/packages/10/d2/fe234bf6000c644b90d00c1b549200c9febc8a24e80a7c5361bc558395b6/blekko-0.1.1.tar.gz" } ] }