{"repo":"mattlisiv/newsapi-python","free":true,"listed":false,"github":"https://github.com/mattlisiv/newsapi-python","clone":"git clone https://github.com/mattlisiv/newsapi-python.git","description":"A Python Client for News API","language":"Python","stars":504,"topics":["python","api","newsapi","news","v2","library","newsapi-python","python-client"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"newsapi-python A Python client for the News API. License Provided under MIT License by Matt Lisivick. General This is a Python client library for News API V2. The functions and methods for this library should mirror the endpoints specified by the News API documentation. Installation Installation for the package can be done via pip : Usage After installation, import the client class into your project: Initialize the client with your API key: Endpoints An instance of NewsApiClient has three instance methods corresponding to three News API endpoints. Top Headlines Use .get top headlines() to pull from the /top-headlines endpoint: Everything Use .get everything() to pull from the /everything endpoint: Sources Use .get sources() to pull from the /sources endpoint: For Windows users printing to cmd or powershell You will encounter an error if you attempt to print the .json() object to the command line. This is because the '{', '}' curly braces to be printed to the console. This becomes especially annoying if developers wish to get 'under the hood'. Here is the error: This can be fixed by: - installing 'win-unicode-console' py -mpip install win-unicode-console - then running it while calling your python script... py -mrun myPythonScript.py Another option is hardcoding your console to only print in utf-8. This is a bad idea, as it could ruin many other scripts and/or make errors MUCH more difficult to track. More information. Support Feel free to make suggestions or provide feedback ","default_branch":null,"files":null,"tree":[],"storefront":"/r/mattlisiv","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mattlisiv/newsapi-python/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}