A python package to get news from BBC.
Project description
BBCNews
A python package to get news from BBC.
Installation
pip3 install BBCHeadlines
Usage
Print headlines:
# Import BBCHeadlines
from BBCHeadlines import articles
# Print the title of article #article_num five times. article_num increases by one every time the loop is increased, starting at zero.
for article_num in range (5):
print(articles.title()[article_num])
Print info on first article:
# Import library
from BBCHeadlines import articles
# We'll get info on the first article
article_num = 0
# Print article title
print('Title: ' + articles.title()[article_num])
# Print article description
print('Description: ' + articles.description()[article_num])
# Print article link
print('Link: ' + articles.link()[article_num])
We can put this into a loop to get headlines with info on the articles:
# Import library
from BBCHeadlines import articles
# Print info on article #article_num five times. article_num increases by one every time the loop is increased, starting at zero.
for article_num in range (5):
# Print article title
print('Title: ' + articles.title()[article_num])
# Print article description
print('Description: ' + articles.description()[article_num])
# Print article link
print('Link: ' + articles.link()[article_num])
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
BBCHeadlines-1.tar.gz
(1.7 kB
view details)
Built Distribution
File details
Details for the file BBCHeadlines-1.tar.gz
.
File metadata
- Download URL: BBCHeadlines-1.tar.gz
- Upload date:
- Size: 1.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa5103e434b6e16fdf5c04030c67e4a36b53d1f7839c8c2aecb29b181084da6f |
|
MD5 | e132c582aaf386337759b9203acfd821 |
|
BLAKE2b-256 | d700be22d5e69afae25f35b4e5efc4d3484e34b264716c84ae7453311cdd0f64 |
File details
Details for the file BBCHeadlines-1-py3-none-any.whl
.
File metadata
- Download URL: BBCHeadlines-1-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 294026d65b8b05bdd049bc8702dc7d887335f26ff3f6aa20a6e6d8377b50090a |
|
MD5 | 7372becc8a79e73629587af605c64b7d |
|
BLAKE2b-256 | 80ee3af9fc075b2e649267e529ef650dac20ffeeff451b741f95e8ee25a02357 |