Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

newsapi-python-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

newsapi-python-client

A Python client to interact with News API from NewApi.org

  • 0.2.4
  • PyPI
  • Socket score

Maintainers
1

Based on the updated structure of your library, here's a revised README:

NewsAPI Python Client

Description

This project provides a Python client for accessing the NewsAPI. It simplifies the process of integrating news search capabilities into your applications. Whether you're building a news aggregation service, a stock trading platform that needs financial news, or a social media app that wants to display relevant news to users, this library is here to assist.

Features

  • Intuitive Python interface for NewsAPI.
  • Leverages the requests library for HTTP requests.
  • Employs an object-oriented model for both requests and responses.
  • Supports all parameters of the NewsAPI, including advanced search queries and filtering.
  • Designed for flexibility and extensibility, allowing for customization as needed.

Installation

pip install newsapi-python-client

Usage

First, you need to initialize the NewsAPIService with your NewsAPI key.

import os
from newsApi.service import NewsAPIService  

news_api_service = NewsAPIService(os.environ.get('NEWS_API_KEY'))

Then you can use the service to make requests. Here is an example for retrieving news about finance:

from newsApi.models.request import EverythingRequestModel

request_model = EverythingRequestModel(
    q='finance',
)

response = news_api_service.everything(request_model)

for article in response.articles:
    print(f"Title: {article.title}")
    print(f"URL: {article.url}")
    print("---")

Note: Remember to replace placeholder values in the EverythingRequestModel with actual values.

Requirements

  • Python 3.6 or later
  • requests package

Future Plans

  • Enhance error handling and validation.
  • Include more examples and use cases.
  • Develop comprehensive documentation.

Contributing

Contributions from the community are welcome. Please refer to the CONTRIBUTING.md file for more details.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc