{ "info": { "author": "Ed Kohlwey", "author_email": "neverna-ptitsa@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\n# yanytapi\n\n`yanytapi` is a Python wrapper for the [New York Times Article Search API][1]. Based on the excellent [`requests`][12] package, it provides full support for all of the API's search parameters, and also allows access to the request object itself for debugging purposes.\n\n\n## Installation\n\nWith pip:\n\n $ pip install yanytapi\n\n\n## Dependencies\n\nyanytapi requires the [`requests`][2] package.\n\n\n## Usage\n\nSimply import and initialize the API with your developer key:\n\n```python\n>>> from yanytapi import SearchAPI\n>>> api = SearchAPI(\"YourAPIKey\")\n```\n\nThen call the `search` function with your desired search parameters/values:\n\n```python\n>>> articles = api.search(\"Obama\", \n fq={\"headline\": \"Obama\", \n \"source\": [\"Reuters\", \n \"AP\", \n \"The New York Times\"]}, \n begin_date=\"20161001\", # this can also be an int\n facet_field=[\"source\", \"day_of_week\"], \n facet_filter=True)\n```\n\nThe search function returns an iterator of `Doc`'s with the following fields:\n```json\n[\n \"_id\",\n \"blog\",\n \"byline\",\n \"document_type\",\n \"headline\",\n \"keywords\",\n \"lead_paragraph\",\n \"meta\",\n \"multimedia\",\n \"news_desk\",\n \"pub_date\",\n \"score\",\n \"section_name\",\n \"snippet\",\n \"source\",\n \"subsectoinName\",\n \"type_of_material\",\n \"uri\",\n \"web_url\",\n \"word_count\"\n]\n```\n\nYou can specify multiple filters by using a dictionary::\n\n```python\n>>> fq = {\"headline\": \"Obama\", \"source\": [\"Reuters\", \"AP\", \"The New York Times\"]}\n>>> articles = api.search(\"Obama\", fq=fq)\n```\n\nAnd multiple values by using a list::\n\n```python\n>>> facet_field = [\"source\", \"day_of_week\"]\n>>> articles = api.search(\"Obama\", facet_field=facet_field)\n```\n\nMore examples:\n\n```python\n# simple search\n>>> articles = api.search(\"Obama\")\n# search between specific dates\n>>> articles = api.search(\"Obama\", begin_date=\"20161001\", end_date=\"20161020\", page=2)\n# access most recent request object\n>>> headers = api.req.headers\n```\n\nFor a complete overview of the available search parameters, please refer to the [NYTimes Article Search API Documentation][4].\n\n\n## History\n\nThis package was originally written by [Evan Sherlock][5] as [`nytimesarticle`][6]. It was subsequently forked and updated by [Matt Morrison][7], and subsequently released as [`NYTimesArticleAPI`][8], with contributions from [Gerald Spencer][9] and [Andrew Han][10]. `yanytapi` is a third iteration of forking focused mainly on packaging improvements, now maintained by Ed Kohlwey.\n\n\n## License\n\nThis is free software. It is licensed under the [MIT License][11]. Feel free to use this in your own work. However, if you modify and/or redistribute it, please attribute me in some way, and distribute your work under this or a similar license. A shout-out or a beer would be appreciated.\n\n\n\n [1]: https://developer.nytimes.com/article_search_v2.json\n [2]: https://pypi.python.org/pypi/requests\n [3]: https://pypi.python.org/pypi/setuptools\n [4]: http://developer.nytimes.com/docs/read/article_SearchAPI_v2\n [5]: https://github.com/evansherlock\n [6]: https://github.com/evansherlock/nytimesarticle\n [7]: https://github.com/MattDMo\n [8]: https://pypi.python.org/pypi/yanytapi\n [9]: https://github.com/Geethree\n [10]: https://github.com/handrew\n [11]: http://opensource.org/licenses/MIT\n [12]: http://docs.python-requests.org\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/neverna-ptitsa/yanytapi", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "yanytapi", "package_url": "https://pypi.org/project/yanytapi/", "platform": "", "project_url": "https://pypi.org/project/yanytapi/", "project_urls": { "Homepage": "https://github.com/neverna-ptitsa/yanytapi" }, "release_url": "https://pypi.org/project/yanytapi/2.0.0/", "requires_dist": [ "requests (>=2.7.0)" ], "requires_python": ">=3.6.0", "summary": "Python wrapper for the New York Times Article Search API", "version": "2.0.0" }, "last_serial": 4979521, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "e0af1b177d40523a30c4c6c99aa4da66", "sha256": "944bd66a85a0cc2f80f723313386a6f37914e52652c39eb39e5d0d042b8eae79" }, "downloads": -1, "filename": "yanytapi-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e0af1b177d40523a30c4c6c99aa4da66", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 4760, "upload_time": "2019-03-19T03:47:04", "url": "https://files.pythonhosted.org/packages/18/72/b17feb9df7f893a67fe380e5fb61f97f4d5daa387f96614432468af3fecb/yanytapi-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "914d8d8579a019645a4c3f4f3660bbf5", "sha256": "1127c82806c653ddbf958d054398f94c24a0bdde46619665fd4e300a29e93d18" }, "downloads": -1, "filename": "yanytapi-1.0.3.tar.gz", "has_sig": false, "md5_digest": "914d8d8579a019645a4c3f4f3660bbf5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 5589, "upload_time": "2019-03-19T03:47:06", "url": "https://files.pythonhosted.org/packages/dc/6f/d1a2d236864e78bc55a3428fa4fb356492036e21aed11ebea7ade849251f/yanytapi-1.0.3.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "f7a910d8f7dfd8bf7ddf37524399c5d1", "sha256": "e1857fb3e2bba070323d84867e8d8420fb3e556b5572bc24cbda0cb631339b3b" }, "downloads": -1, "filename": "yanytapi-2.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f7a910d8f7dfd8bf7ddf37524399c5d1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 6680, "upload_time": "2019-03-24T18:45:27", "url": "https://files.pythonhosted.org/packages/fe/d3/4e4c59fd9b896571f2bd9564b78e79e8aef8f6c33c8b116ef88b12598c93/yanytapi-2.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ea340a42f8312b4b55a62840fe4c5a5d", "sha256": "12b013c43a2966aeef6405646280134f9b5a1c7fe2872c60bc1db11f9d5886bb" }, "downloads": -1, "filename": "yanytapi-2.0.0.tar.gz", "has_sig": false, "md5_digest": "ea340a42f8312b4b55a62840fe4c5a5d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 7141, "upload_time": "2019-03-24T18:45:28", "url": "https://files.pythonhosted.org/packages/3b/94/4cf88de1eda4de642531d40db0ac283415956d5de7277abd5c7a3251c83d/yanytapi-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f7a910d8f7dfd8bf7ddf37524399c5d1", "sha256": "e1857fb3e2bba070323d84867e8d8420fb3e556b5572bc24cbda0cb631339b3b" }, "downloads": -1, "filename": "yanytapi-2.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f7a910d8f7dfd8bf7ddf37524399c5d1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 6680, "upload_time": "2019-03-24T18:45:27", "url": "https://files.pythonhosted.org/packages/fe/d3/4e4c59fd9b896571f2bd9564b78e79e8aef8f6c33c8b116ef88b12598c93/yanytapi-2.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ea340a42f8312b4b55a62840fe4c5a5d", "sha256": "12b013c43a2966aeef6405646280134f9b5a1c7fe2872c60bc1db11f9d5886bb" }, "downloads": -1, "filename": "yanytapi-2.0.0.tar.gz", "has_sig": false, "md5_digest": "ea340a42f8312b4b55a62840fe4c5a5d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 7141, "upload_time": "2019-03-24T18:45:28", "url": "https://files.pythonhosted.org/packages/3b/94/4cf88de1eda4de642531d40db0ac283415956d5de7277abd5c7a3251c83d/yanytapi-2.0.0.tar.gz" } ] }