{ "info": { "author": "Israel Tsadok", "author_email": "itsadok@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "webhose.io client for Python\n============================\n\nA simple way to access the `webhose.io `_ API from your Python code\n\n.. code-block:: python\n\n import webhose\n\n webhose.config(token=YOUR_API_KEY)\n for post in webhose.search(\"github\"):\n print(post.title)\n\n\nAPI Key\n-------\n\nTo make use of the webhose.io API, you need to obtain a token that would be\nused on every request. To obtain an API key, create an account at\nhttps://webhose.io/auth/signup, and then go into\nhttps://webhose.io/dashboard to see your token.\n\nInstalling\n----------\nYou can install from source:\n\n.. code-block:: bash\n\n $ git clone https://github.com/Buzzilla/webhose-python\n $ cd webhose-python\n $ python setup.py install\n\nUse the API\n-----------\n\nTo get started, you need to import the library, and set your access token.\n(Replace YOUR_API_KEY with your actual API key).\n\n.. code-block:: python\n\n >>> import webhose\n >>> webhose.config(token=YOUR_API_KEY)\n\nNow you can make a request and inspect the results:\n\n.. code-block:: python\n\n >>> r = webhose.search(\"foobar\")\n >>> r.total\n 62\n >>> len(r.posts)\n 62\n >>> r.posts[0].language\n 'english'\n >>> r.posts[0].title\n 'Putting quotes around dictionary keys in JS'\n\nFor your convenience, the Response object is iterable, so you can loop over it\nand get all the results. The iterator will create additional API requests to\nfetch additional pages.\n\n.. code-block:: python\n\n >>> total_words = 0\n >>> for post in r:\n ... total_words += len(post.text.split(\" \"))\n ...\n >>> print(total_words)\n 56006\n\n**Warning**: This method can use up your credits if your search has lots of\nresults.\n\nFull documentation\n------------------\n\n* config(token)\n\n * token - your API key\n\n* search(query, token=None)\n\n * query - the search query, either as a search string, or as a Query object\n * token - you can provide the API key directly to the search function if you want\n\nQuery objects\n^^^^^^^^^^^^^\n\nQuery object correspond to the advanced search options that appear on https://webhose.io/use\n\nQuery object have the following members:\n\n* ``all_terms`` - a list of strings, all of which must appear in the results\n* ``some_terms`` - a list of strings, some of which must appear in the results\n* ``phrase`` - a phrase that must appear verbatim in the results\n* ``exclude`` - terms that should not appear in the results\n* ``site_type`` - one or more of ``discussions``, ``news``, ``blogs``\n* ``language`` - one or more of language names, in lowercase english\n* ``site`` - one or more of site names, top level only (i.e., yahoo.com and not news.yahoo.com)\n* ``title`` - terms that must appear in the title\n* ``body_text`` - term that must appear in the body text\n\nQuery objects implement the ``__str__()`` method, which shows the resulting search string.\n\nResponse objects\n^^^^^^^^^^^^^^^^\n\nResponse objects have the following members:\n\n* ``total`` - the total number of posts which match this search\n* ``more`` - the number of posts not included in this response\n* ``posts`` - a list os Post objects\n* ``next`` - a URL for the next results page for this search\n* ``response`` - the original ``requests`` response\n* ``get_next()`` - a method to fetch the next page of results. Returns a new Response object\n\nResponse objects implement the ``__iter__()`` method, which can be used to loop\nover all posts matching the query. (Automatic page fetching)\n\nPost and Thread objects\n^^^^^^^^^^^^^^^^^^^^^^^\n\nPost and Thread object contain the actual data returned from the API.\nConsult https://webhose.io/documentation to find out about their structure.\n\nPolling\n-------\n\nIf you want to make repeated searches, performing an action whenever there are\nnew results, use code like this:\n\n.. code-block:: python\n\n r = webhose.search(\"skyrim\")\n while True:\n for post in r:\n perform_action(post)\n time.sleep(300)\n r = r.get_next()", "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/Buzzilla/webhose-python", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "webhose", "package_url": "https://pypi.org/project/webhose/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/webhose/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Buzzilla/webhose-python" }, "release_url": "https://pypi.org/project/webhose/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "Simple client library for the webhose.io REST API", "version": "0.1.5" }, "last_serial": 2363831, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "096e403c3e27ee9f7f74fb740ed8d31f", "sha256": "104146ef1782f031501f60efdf26f376fe7663137af68f9e2229f334b5a1e6db" }, "downloads": -1, "filename": "webhose-0.1.0.tar.gz", "has_sig": false, "md5_digest": "096e403c3e27ee9f7f74fb740ed8d31f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3663, "upload_time": "2015-01-20T17:03:17", "url": "https://files.pythonhosted.org/packages/9e/8a/05d2716e0c16406a9ca45a9ba901a077a8484434de2d7652c0dc660d8031/webhose-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "253b64593ef643dcd806d7f361b4eb68", "sha256": "e67b8cf56d35af15ae5f212a01259d86e88b316eaad92f3337638265baeb4222" }, "downloads": -1, "filename": "webhose-0.1.1.tar.gz", "has_sig": false, "md5_digest": "253b64593ef643dcd806d7f361b4eb68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4733, "upload_time": "2015-01-21T10:05:30", "url": "https://files.pythonhosted.org/packages/f8/d7/c65654ab8081d638b9786ce83bb9d6f58af4a64d264214cd6a0516b83619/webhose-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "9a3f9612dd1d46e090ac22e3efff3d54", "sha256": "a155e0764ea6035722b6172177ce950ad66fc963f85f2e0c4bae58c7a474c52c" }, "downloads": -1, "filename": "webhose-0.1.2.tar.gz", "has_sig": false, "md5_digest": "9a3f9612dd1d46e090ac22e3efff3d54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5207, "upload_time": "2015-02-18T09:52:40", "url": "https://files.pythonhosted.org/packages/c1/5e/692b24be2f115f3fd7c418dd1ba8a384b6e6824347f327f6a84d179ca2ae/webhose-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "650b5b4c30aebb17fb8e214f8544c5a2", "sha256": "8ccd73b3a48824bd0934842b4824298e13d7e78b72cb44797d009510ec947914" }, "downloads": -1, "filename": "webhose-0.1.3.tar.gz", "has_sig": false, "md5_digest": "650b5b4c30aebb17fb8e214f8544c5a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5302, "upload_time": "2015-02-26T10:51:55", "url": "https://files.pythonhosted.org/packages/80/51/54a0cddb78081f8fb01c3fa329d5f19ca65088753c787e9c45de266c5dbd/webhose-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "d2b013522ab8f931c078410b721d5ca3", "sha256": "ac4dbd4b773e80f90f234861aa1b785c085ec26bc655d1722245a64290848670" }, "downloads": -1, "filename": "webhose-0.1.4.tar.gz", "has_sig": false, "md5_digest": "d2b013522ab8f931c078410b721d5ca3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5390, "upload_time": "2015-07-03T10:47:53", "url": "https://files.pythonhosted.org/packages/a1/27/6f60974dad8c1339c191522821b81ffcf944f5535107705e9f644228b9b9/webhose-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "c19e2309336b06298f19db94e9282177", "sha256": "3d96bda569e7a36da2884ecff03c26a5f3b9267176114ec18aa9f9d3cbddf238" }, "downloads": -1, "filename": "webhose-0.1.5.tar.gz", "has_sig": false, "md5_digest": "c19e2309336b06298f19db94e9282177", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5525, "upload_time": "2016-09-26T11:31:05", "url": "https://files.pythonhosted.org/packages/ed/5b/6226f7cdf021ad1faf9967dc58247161233e09aa36ba71a6e4dab75fd7f2/webhose-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c19e2309336b06298f19db94e9282177", "sha256": "3d96bda569e7a36da2884ecff03c26a5f3b9267176114ec18aa9f9d3cbddf238" }, "downloads": -1, "filename": "webhose-0.1.5.tar.gz", "has_sig": false, "md5_digest": "c19e2309336b06298f19db94e9282177", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5525, "upload_time": "2016-09-26T11:31:05", "url": "https://files.pythonhosted.org/packages/ed/5b/6226f7cdf021ad1faf9967dc58247161233e09aa36ba71a6e4dab75fd7f2/webhose-0.1.5.tar.gz" } ] }