No project description provided
Project description
Python RSS Reader
Final task for EPAM Python Training 2022.04.29
Installation
To install this package type
$ pip install daily-rss-news
If you do not want to install it , you can source code from gitlab
$ git clone https://gitlab.com/Ilhom_Xusanov/RSS-parser.git
Requirements
This program depends on some third party packages. If you downloaded it from gitlab, first create virtual environment and go to the folder where requirements.txt reside and type
$ pip install -r requirements.txt
This will install all packages to run this program.
#Usage If you installed this packages by pip, you can use it everywhere by typing
$ python -m rss_reader [options]
If you downloaded from gitlab, go to root folder where rss_reader.py is, and you can run python with rss_reader.py module. ####Note if you are in different folder specify full path to rss_reader.py to run with python
$ python rss_reader.py [options]
To see help message type
$ python -m rss_reader -h
or
$ python rss_reader.py -h
output is:
usage: rss-reader [-h] [--version] [--json] [--verbose] [--limit ] source
Pure Python command-line RSS reader
positional arguments:
source RSS URL
optional arguments:
-h, --help show this help message and exit
--version Print version info
--json Print result as JSON in stdout
--verbose Outputs verbose status messages
--limit [] Limit news topics if this parameter provided
If --version option is given, program prints its version to console and exits.
If --verbose option is given, outputs logs in a INFO level, default is WARNING
if --limit(N) option is given, N number of news, else all news is returned
if --json option is provided, program displays news to console in json format
--json output example:
{
"title": "NYT > Top Stories",
"pubDate": "Wed, 06 Apr 2022 10:13:52 +0000",
"link": "https://www.nytimes.com",
"description": null,
"image": {
"title": "NYT > Top Stories",
"link": "https://www.nytimes.com",
"url": "https://static01.nyt.com/images/misc/NYT_logo_rss_250x40.png"
},
"news": [
{
"title": "At Least 200 Feared Dead in Apartments Hit by Russia, Officials Say",
"pubDate": "Tue, 05 Apr 2022 21:46:03 +0000",
"link": "https://www.nytimes.com/2022/04/05/world/asia/ukraine-civilians-russia-borodyanka.html",
"description": "After Russian forces withdrew from Borodyanka, a commuter town near Ukraine\u2019s capital, families are searching the rubble for bodies.",
"image": "No info"
},
{
"title": "Why Tracking Putin\u2019s Wealth Is So Difficult",
"pubDate": "Wed, 06 Apr 2022 07:00:12 +0000",
"link": "https://www.nytimes.com/2022/04/06/world/putin-russia-assets-wealth-sanctions.html",
"description": "Amid speculation that oligarchs are holding cash and luxury assets for the Russian president, many of his extravagances can be traced elsewhere: the Russian state.",
"image": "No info"
}
]
}
Tested Rss links
1.http://feeds.wired.com/wired/index 2.http://feeds.nytimes.com/nyt/rss/Technology 3.http://feeds.nature.com/nature/rss/current 4.http://newsrss.bbc.co.uk/rss/newsonline_world_edition/americas/rss.xml 5.http://feeds.nytimes.com/nyt/rss/HomePage 6.https://news.yahoo.com/rss/ 7.http://www.nba.com/jazz/rss.xml 8.http://feeds1.nytimes.com/nyt/rss/Sports 9.http://rss.cnn.com/rss/edition.rss
Testing
Tested modules
- log.py
- rss_reader.py
- arg_parser.py
Test coverage is 76 %
To run tests go to root folder of program and type:
$ python -m pytest
to run tests in a specific module type:
$ python -m pytest 'folder/modulename'
to check test coverage run :
$ python -m pytest --cov=rss_reader
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for daily_rss_news-1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f534a8a80557972c406ffca25f88dbc8c2f90794e5f466770104ed2f3db43062 |
|
MD5 | fa928e068927d8e43c988ca67d9031bb |
|
BLAKE2b-256 | 8eb8818b2f35f8e2e73379ac9bd5756a68224f0b6f26bb3ec72a3ef5ee209805 |