Skip to main content

The news client written in Python that fetches and curates the world news across the web.

Project description

Newspy

The news client written in Python that fetches and curates the world news across the web.

Table of contents

Requirements

  • Python 3.10+
  • Poetry 1.4.0+ (for dependency management)
  • yarn (for the semantic-release versioning)
  • API Key from the New API Organisation: https://newsapi.org/

News Sources

Basic usage

Create virtual environment

python -m venv .venv

# Activate virtual environment
.venv/bin/activate # Linux or MacOS
.venv/Script/activate # Windows


# Install
pip install newspy

Get the news from Newsorg API

from newspy import client
from newspy import newsorg, NewsorgEndpoint

newsorg_api_key = "YOUR_NEWSORG_KEY"

client.configure(newsorg_api_key=newsorg_api_key)
newsorg_articles = newsorg.get_articles(
    endpoint=NewsorgEndpoint.TOP_HEADLINES,
    search_text="bitcoin",
)

print(newsorg_articles)

Get the news from RSS Feeds

from newspy import rss

rss_articles = rss.get_articles()

print(rss_articles)

Contributing

Want to contribute? Read our contribution guideline.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newspy-2.0.1.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

newspy-2.0.1-py3-none-any.whl (11.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page