Skip to main content

Newscraping

PyPI PyPI

This package makes webscraping of financial headlines easy.

Suported sources:

  • reuters.com/finance/markets
  • ft.com/markets

Installation

Newscraping can be installed from PyPI using pip or your package manager of choice:

pip install newscraping

Usage

CLI

You can use newscraping as a CLI tool using the newscraping command.
The package will get the latest headline from reuters and print is in the terminal.
This is mainly for testing purposes.

Python script

You can import the newscraping package in your python project using:

from newscraping import news

And then use it as:

df = news(newspaper="reuters", n_articles=-1, early_date="2020-01-01", verbose=0)
  • With the default parameters (see above), only the last headline from reuters will be returned
  • newspaper argument must be in ["reuters", "financial times"]
  • n_articles argument is the number of articles to return, starting with the most recent ones
  • early_date argument is the publication date of the earliest article to return
  • If both n_articles and early_date are provided, the script will stop scraping when the any condition is met
  • Pass verbose=1 to print in the progress of websraping (current page and publication date)

List of available sources

You can get the list of available sources this package is configured for calling:

from newscraping import newspapers
available_sources = newspapers()

Metadata

Release files for newscraping 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for newscraping 0.1.2
File Size Uploaded Provenance
newscraping-0.1.2.tar.gz 4.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for newscraping 0.1.2
File Interpreter ABI Platform
newscraping-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / newscraping-0.1.2.tar.gz

Download URL newscraping-0.1.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9cd259f01b46ed853b2d933c04acbebd6c3357e410e1943f4295a77192a03798
BLAKE2b-256 checksum
How to use checksums
b43c09af1120c9d81974c40519e4ead0e10900bc8eeba3abbc8002b8a84e6ae6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.3 CPython/3.8.5 Linux/4.19.128-microsoft-standard

Release files / newscraping-0.1.2-py3-none-any.whl

Download URL newscraping-0.1.2-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb6f469d2e39dc149006782178b9a2dc65570df8aebc2cc9b62c12468658db83
BLAKE2b-256 checksum
How to use checksums
ef8bb8f0724c450f672efabf56d7e6173967aaa8b9db6cdcf6fafe949e20304f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.3 CPython/3.8.5 Linux/4.19.128-microsoft-standard

Security for newscraping 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page