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-2.tar.gz
(1.7 kB
view details)
Built Distribution
File details
Details for the file BBCHeadlines-2.tar.gz
.
File metadata
- Download URL: BBCHeadlines-2.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.49.0 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6facd3f9c05328ce21e36a53b17838e6878f0c3771da96b68f8aac3079e144dd |
|
MD5 | 1bd07d439858cbaba9ee869c8f401ba7 |
|
BLAKE2b-256 | fc57af5ea033a7b6278111ae6674d467656d14e785e4eca02d9afb1983b89130 |
File details
Details for the file BBCHeadlines-2-py3-none-any.whl
.
File metadata
- Download URL: BBCHeadlines-2-py3-none-any.whl
- Upload date:
- Size: 2.9 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.49.0 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0962d18ef3f471c93db76a44e2dfd08ee2a1808d85b920e17724233c2d341de4 |
|
MD5 | 41a9170250b49360ce3fc150744336af |
|
BLAKE2b-256 | 15632502ec05c09e1644d8fc57067f28fef6694ea67e6589ba6c0956adaea73d |