Skip to main content

No project description provided

Project description

B2cNews

PyPI version

B2cNews is an open-source, easy-to-use news crawler that extracts structured information from the Bbc news website for machine learning purposes. It can recursively follow internal hyperlinks and read RSS feeds to fetch the most recent articles in any given field. You only need to provide the desired field ('news', 'innovation', 'business', 'culture') of the news website to crawl it completely.

Extracted information

B2cNews extracts the following attributes from Bbc news articles.

  • Article Headline
  • Article Authors
  • BBC Author
  • Article Body
  • Article Summary
  • Article Publish Date
  • Article Language

Features

  • works out of the box: install with pip, add the desired field of your articles, run :-)
  • run B2cNews conveniently using its CLI mode

Modes and use cases

B2cNews supports two main use cases, which are explained in more detail in the following.

CLI mode

  • stores extracted results in csv files in your own storage
  • simple but extensive configuration (if you want to tweak the results)
  • revisions: crawl articles multiple times and track changes

Library mode

  • crawl and extract information given a list of article URLs
  • to use B2cNews within your own Python code

Getting started

It's super easy.

Installation

$ pip3 install B2cNews

Use within your own code (as a library)

You can access the core functionality of B2cNews, i.e. extraction of semi-structured information from one or more news articles, in your own code by using B2cNews in library mode.

from B2cNews import getArticles

getArticles(field="culture", number=50, dropna=True)

If you want to crawl multiple fields at a time, optionally with a timeout in seconds and number of articles for each field

B2cNews.from_fields([field1, field2, ...], number=10, timeout=6)

Run the crawler (via the CLI)

$ B2cNews-getArticles field [number] [dropna]

B2cNews will then start crawling a few articles and The results are stored by default in CSV file.

License

Copyright 2023-2024 Ahmed Bendrioua

Project details


Release history Release notifications | RSS feed

This version

2.1

Download files

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

Source Distribution

B2cNews-2.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

B2cNews-2.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file B2cNews-2.1.tar.gz.

File metadata

  • Download URL: B2cNews-2.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for B2cNews-2.1.tar.gz
Algorithm Hash digest
SHA256 b8edbb9ad510f59aebef1dda7147e94ba3afd6a2066897307d9e969dc0070570
MD5 06d515bf2cc5b78a5524161799de7f90
BLAKE2b-256 b1c050fb1cbf633ec81f9064f2a2f1240a1cf3f830c8fb43069d4f7ae27f30cb

See more details on using hashes here.

File details

Details for the file B2cNews-2.1-py3-none-any.whl.

File metadata

  • Download URL: B2cNews-2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for B2cNews-2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6dbf45750e97db52cad2e79895a9722832662edefaafb9fb7618e223195f104
MD5 ab4a55e4264148fe12beb4b8d7b862bd
BLAKE2b-256 2b11ee8c6b5faab5bcf5c61c6cf6260b7fc3e8dc618edbcfde5d0202dc2e8385

See more details on using hashes here.

Supported by

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