Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
974 commits
Select commit Hold shift + click to select a range
df851f4
import abstractmethod into the ipathfile module
Jun 27, 2022
180037a
import ABC into the ipathfile module
Jun 27, 2022
21de7e2
add a docstring to the create_file abstract method
Jun 27, 2022
64fe870
add a docstring to the ICreateFile
Jun 27, 2022
a4b9a66
add a dockstring to the ipathfile module
Jun 27, 2022
5b5af9c
create PathFile class
Jun 27, 2022
7835c07
create create_file method
Jun 27, 2022
5af2663
implement the process of creating a file in function create_file
Jun 27, 2022
882f274
import ICreateFile into the pathfile module
Jun 27, 2022
5bd0247
import Path into the pathfile module
Jun 27, 2022
84b65d8
add a dockstring to the create_file method
Jun 27, 2022
dabb256
add a dockstring to the PathFile class
Jun 27, 2022
57bc993
add a docstring to the pathfile module
Jun 27, 2022
f7a8467
import ICreateFile into the ireader_files module
Jun 27, 2022
b463263
import IReadFile into the read_files module
Jun 27, 2022
0ec6b2b
create read_csv_file method in the ReaderFiles class
Jun 27, 2022
2b8db68
declare local_storage variable
Jun 27, 2022
5197817
read csv file
Jun 27, 2022
1dca61d
catch the EmptyDataError error
Jun 27, 2022
b2f5ad3
catch the FileNotFoundError error
Jun 27, 2022
b222a8f
return read data
Jun 27, 2022
3acba23
import ICreateFile into the reader_files module
Jun 27, 2022
273730e
import Optional into the reader_files module
Jun 27, 2022
b84702e
import DataFrame into the reader_files module
Jun 27, 2022
779cf73
import read_csv into the reader_files module
Jun 27, 2022
882bf28
import EmptyDataError into the reader_files module
Jun 27, 2022
c1cb01f
import Logger into the reader_files module
Jun 27, 2022
359c8bf
get program logger
Jun 27, 2022
694efc1
log file not found
Jun 27, 2022
228abaa
add a docstring to the read_csv_file from the ReaderFiles
Jun 27, 2022
5f4c454
add a dockstring to the ReaderFiles class
Jun 27, 2022
24dc909
add a dockstring to the reader_files module
Jun 27, 2022
dafcaf7
import ReaderFiles to the saver module
Jun 27, 2022
d84353b
import ReaderFiles to the saver module
Jun 27, 2022
dd0c5eb
replace CreaterFiles with PathFile
Jun 27, 2022
73befd7
create idateconverter package
Jun 27, 2022
e12d24b
add a docstring to the idateconverter package
Jun 27, 2022
e1e9e86
create iadteconverter module
Jun 27, 2022
87edbbd
create IDateConverter class
Jun 27, 2022
33707db
create date_conver method
Jun 27, 2022
5251585
add a docstring to the date_convert method
Jun 27, 2022
d14875d
add a docstring to the adateconverter module
Jun 27, 2022
a10f552
import ABC into the idateconverter module
Jun 27, 2022
8fea640
import abstractmethod into the idateconverter module
Jun 27, 2022
47650bf
create date_converter package
Jun 27, 2022
741466c
create date_converter module
Jun 27, 2022
479f1cc
create DateConverter class
Jun 27, 2022
30f9180
import IDateConverter into the date_converter module
Jun 27, 2022
a82569d
create date_convert method
Jun 27, 2022
98982ba
return the date as a string
Jun 27, 2022
e606ad7
import datetime
Jun 27, 2022
ee7aa37
add a docstring to the date_convert
Jun 27, 2022
bcdfb72
fix. Replace docstring header
Jun 27, 2022
e94692e
add a docstring to the DateConverter class
Jun 27, 2022
654f10d
add a docstring to the date_converter module
Jun 27, 2022
d2ee4e0
create decorators module
Jun 27, 2022
63c824c
create IComponent class
Jun 27, 2022
ed4641a
add a dockstring to the IComponent class
Jun 27, 2022
e1b0629
import ABC, abstractmethod to the decorators module
Jun 27, 2022
3277eee
import DateFrame to the decorators module
Jun 27, 2022
105932d
create BaseComponent class
Jun 27, 2022
5999365
add a docstring to the BaseComponent
Jun 27, 2022
1f02daf
create Decorator class
Jun 27, 2022
b382b29
initialize the Decorator class
Jun 27, 2022
dc663f0
create component property
Jun 27, 2022
dc9afe7
override operation method in the Decorator class
Jun 27, 2022
04df1e3
add a dockstring o the Decorator class
Jun 27, 2022
b938a42
create LimitRecords class
Jun 27, 2022
9020bf2
initialize the LimitRecords class
Jun 27, 2022
cda2f6d
add a dockstring to the __init__ in the LimitRecords
Jun 27, 2022
94107a0
create operation method in the LimitRecords
Jun 27, 2022
f41886f
add a docstring to the LimitRecords class
Jun 27, 2022
50a46a7
create SortByEqual class
Jun 27, 2022
dd7974a
initialize the __init__ function in the SortByEqual class
Jun 27, 2022
ae5ac02
create operation method in the SortByEqual class
Jun 27, 2022
3833b6f
add a dockstring to the operation method
Jun 27, 2022
c870683
create reader module in th loader package
Jun 28, 2022
6a55dea
create ReaderCSVFile class
Jun 28, 2022
ebf6287
create read method
Jun 28, 2022
fa545ea
implement function read
Jun 28, 2022
089dd3d
load modules
Jun 28, 2022
c3c2905
create exceptions module in load package
Jun 28, 2022
6bce325
create EmptyURLError class
Jun 28, 2022
4d8b5b4
create DataEmptyError class
Jun 28, 2022
54471fa
create DataFileEmptyError class
Jun 28, 2022
2b7d847
create DataFileNotFoundError class
Jun 28, 2022
b512f5b
import EmptyDataError
Jun 28, 2022
58a5186
create iread_files module in iloader package
Jun 28, 2022
3195f42
create IReadFile class
Jun 28, 2022
18be309
import modules
Jun 28, 2022
39ef70c
import modules
Jun 28, 2022
59a5b7b
create AbstractLoaderHandler class
Jun 28, 2022
7726a25
create FromLocalSTorageHandler class
Jun 28, 2022
27affef
override get_data method in the class FromLocalSTorageHandler class
Jun 28, 2022
cd81437
create _convert_to_dict method
Jun 28, 2022
6eaf753
create ILoadHandler class
Jun 28, 2022
5c706b9
import annotations to the iloader module
Jun 28, 2022
2f2b64c
import modules to the loader module
Jun 28, 2022
7951b36
add a default value to the source argument
Jun 28, 2022
d13ad16
remove error trapping in __main__
Jun 28, 2022
59f6702
return the value of the data_concat variable
Jun 28, 2022
143dc50
change attribute type to List[dict]
Jun 28, 2022
7fd632b
remove the data argument
Jun 28, 2022
ca6f3aa
set the return type
Jun 28, 2022
ec14bdc
load data from file
Jun 28, 2022
628185e
create a loader object
Jun 28, 2022
542def9
change the show method to show the new data structure
Jun 28, 2022
c4e118f
add comments to the sequence of actions in the get_data method
Jun 28, 2022
b270b1d
add a dockstring to the __init__
Jun 28, 2022
5f4f6dc
remove "channel > link"
Jun 28, 2022
8471587
del _channel_linik
Jun 28, 2022
47463bd
replace IHandler with AbstractLoaderHandler
Jun 28, 2022
c67ff00
add a dockstring to the FromWebHandler
Jun 28, 2022
7cef685
add a dockstring to the get_data
Jun 28, 2022
d7952d8
add a dockstring to the _convert_to_dict
Jun 28, 2022
459c559
add a dockstring to the FromLocalSTorageHandler
Jun 28, 2022
5ad0e46
add a docstring to the AbstractLoaderHandler
Jun 28, 2022
f8e807d
change dict to List[dict]
Jun 28, 2022
df69ac4
fix status
Jun 29, 2022
47efbb4
add a dockstring to the StandartViewHandler
Jun 29, 2022
6cfa405
fix. replace status with self._get_content(r)
Jun 29, 2022
a33bbe9
replace log.exception with log.error
Jun 29, 2022
666df5c
add a check for the existence of the list
Jun 29, 2022
27ddf59
add local storage
Jun 29, 2022
54d5f93
create a folder for local storage
Jun 29, 2022
8786860
create home method
Jun 29, 2022
1d93e8a
break the DataConverter class into methods
Jun 29, 2022
3219cec
add a dockstring to the DataConverter class
Jun 29, 2022
da159d4
add methods to the IDataConverter class
Jun 29, 2022
d56adc4
Break a method into multiple submethods
Jun 29, 2022
f995661
add local storage path
Jun 29, 2022
3245d71
add a dockstrint to the decorators module
Jun 29, 2022
9a0dbe8
add a docstring to the ILoadHandler class
Jun 29, 2022
1dbe811
add a dockstring to the SortByEqual class
Jun 29, 2022
300344c
add an addition to the docstring
Jun 29, 2022
beeaaf4
add a docstrings to the reader module
Jun 29, 2022
fc1c62f
fix. remove redundant arguments
Jun 29, 2022
9c06c72
convert the test structure to the new function
Jun 29, 2022
ac580f2
put the dictionary in the list
Jun 29, 2022
5d2aaa0
remove comments
Jun 29, 2022
db4a901
fix. delet print
Jun 29, 2022
b2e79c6
create display_information.rst
Jun 29, 2022
b6ad861
create local_storage.rst
Jun 29, 2022
4dcf51b
add display_information and local_storage to the toctree
Jun 29, 2022
1223aed
delete the Information display section
Jun 29, 2022
8283115
add date_parametr.jpg
Jun 29, 2022
d596cff
add local_storage.jpg
Jun 29, 2022
24015fe
comment out the error trapping block
Jun 29, 2022
a8eee10
add log to the StandartViewHandler
Jun 29, 2022
aa0eba6
delet comment
Jun 29, 2022
974b817
catch the EmptyURLError in the __nmain__ mdule
Jun 29, 2022
f632dca
add pandas to required install
Jun 29, 2022
1b82474
change assembly version to 0.0.3
Jun 29, 2022
6f9dc58
catch the DataFileNotFoundError in the __main__ module
Jun 29, 2022
9861520
catch the DataEmptyError in the __main__ module
Jun 29, 2022
0fce209
move the display of the error message to one function
Jun 29, 2022
3a007b9
add --to-html argument to an argparse
Jun 30, 2022
b5e387e
create to_html package
Jun 30, 2022
c591f1b
create to_html module
Jun 30, 2022
e6a8467
import AbstractSaveHandler into the to_html module
Jun 30, 2022
f21ea92
create HTMLSaveHandler class
Jun 30, 2022
ba6128f
create save mrthod in the HTMLSaveHandler class
Jun 30, 2022
169a024
import List into the to_html module
Jun 30, 2022
c6c46c4
override __init__ method in the HTMLSaveHandler class
Jun 30, 2022
8009569
import Dict to the to_html module
Jun 30, 2022
7194da7
create main.html file
Jun 30, 2022
2d1de13
create a basic html template
Jun 30, 2022
4d3b3f5
fix. call the save method instead of show
Jun 30, 2022
f88f14b
fix. remove file argument
Jun 30, 2022
5ec16f6
create a news display template in html
Jun 30, 2022
4e7e24e
add exists_file method
Jun 30, 2022
7e218c4
create strategies module
Jun 30, 2022
67bc426
create istrategies module
Jun 30, 2022
de66204
add a docstring to the istrategies module
Jun 30, 2022
ff034f3
create StrategySaveHTML class
Jun 30, 2022
e4c5083
import ABC to the istrategies module
Jun 30, 2022
a175208
import List into the istrategies module
Jun 30, 2022
6aaad71
add a dockstring to the StrategySaveHTML class
Jun 30, 2022
bd35969
add a docjstring to the prepare_html in the StrategySaveHTML
Jun 30, 2022
f4edff1
import StrategySaveHTML into the strategies module
Jun 30, 2022
6ff2b51
import List into strategies module
Jun 30, 2022
7ca0ff1
import packages pathlib, jinja2
Jun 30, 2022
6a0ca3c
add a dockstring to the SuperStrategySaveHTML
Jun 30, 2022
3dbc085
add a dockstring to the prepare_html in the SuperStrategySaveHTML
Jun 30, 2022
7e3231c
add a dockstring to the strategies module
Jun 30, 2022
f1238af
override save method in the HTMLSaveHandler class
Jun 30, 2022
4eef86c
add a dockstring to the HTMLSaveHandler
Jun 30, 2022
a0fc624
add a dockstring to the to_html module
Jun 30, 2022
a903afb
add an HTML save handler to the file
Jun 30, 2022
73b20ea
fix. remove the file argument from the save method
Jun 30, 2022
6ddeb37
add a dockstring to the AbstractSaveHandler class
Jun 30, 2022
0c368ca
add a docstring to the saver module
Jun 30, 2022
8ae23a5
change h3 tag to h2
Jun 30, 2022
2df5ce5
catch the FileExistsError in the main function
Jun 30, 2022
32bf58d
create to_html_mode.rst
Jun 30, 2022
7f2808b
add documentation on --to-html mode
Jun 30, 2022
15968c2
add a to_html_mode.rst to the index.rst
Jun 30, 2022
0b27568
install jinja
Jun 30, 2022
e83d093
create to_pdf package
Jun 30, 2022
dc3d19d
create a to_pdf module
Jun 30, 2022
100189c
import AbstractSaveHandler into the to_pdf module
Jun 30, 2022
b1d2705
create PDFSaveHandler class
Jun 30, 2022
c051b1c
create save method in the PDFSaveHandler
Jun 30, 2022
8ea3d90
import List
Jun 30, 2022
6b7f41d
add a --to-pdfargument to the argparse
Jun 30, 2022
a9fe41e
create a PDFSaveHandler object
Jun 30, 2022
08696ec
include html_saver in the chain
Jun 30, 2022
c2fdc76
create unlink method
Jun 30, 2022
7bdfa75
add file argument to PDFSaveHandler
Jun 30, 2022
be0f0f2
import Dict
Jun 30, 2022
0dac30e
override __init__ method
Jun 30, 2022
8923721
get file to save
Jun 30, 2022
10deb8e
if there is a request, then process it
Jun 30, 2022
217a6cd
import fpdf
Jun 30, 2022
c119e61
import PIL Image
Jun 30, 2022
8a150e5
import requests
Jun 30, 2022
acb95cd
import BytesIO
Jun 30, 2022
6ca3b32
create FPDF object
Jun 30, 2022
da17996
set font
Jun 30, 2022
0ed5d34
loop through all elements
Jun 30, 2022
cd0b636
add new page
Jun 30, 2022
2ac3e62
set title_web_resource
Jun 30, 2022
fc49426
set link
Jun 30, 2022
8923d09
sort through all the news
Jun 30, 2022
ca16060
get news title
Jun 30, 2022
ffc164a
convert to latin1 encoding
Jun 30, 2022
571aa79
write down the title of the news
Jun 30, 2022
2347bda
write down the link of the news
Jun 30, 2022
3d07b39
write down the pubdate of the news
Jun 30, 2022
7ffe910
write down the source of the news
Jun 30, 2022
bf65792
get image by url.
Jun 30, 2022
73b483a
save image
Jun 30, 2022
e71b491
import PathFile
Jun 30, 2022
1b40d81
write down the picture
Jun 30, 2022
168b564
write pdf
Jun 30, 2022
c521833
del all images
Jun 30, 2022
7e01ac9
save to file
Jun 30, 2022
b9a9d88
add data conversion to latin1.
Jun 30, 2022
2000657
add a dockstring to the save method
Jun 30, 2022
f148a23
add a dockstring to the convert_to_latin1
Jun 30, 2022
0e0541e
add a dockstring to the __init__
Jun 30, 2022
d03f9f1
add a docstring to the PDFSaveHandler
Jun 30, 2022
8365401
add a dockstring to the to_pdf module
Jun 30, 2022
ab79d8e
create to_pdf_mode.rst
Jun 30, 2022
ff5915a
add to_pdf_mode.rst to the index.rst
Jun 30, 2022
ff44708
change the program version to 0.0.4
Jun 30, 2022
5f366aa
add dependent packages
Jun 30, 2022
e6116d2
create MANIFEST.IN
Jun 30, 2022
f57a81e
add main.html
Jul 1, 2022
17dfd41
version 0.0.4
Jul 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.vscode
.idea
.coverage
__pycache__
build/
source/_templates
source/_static
docs/build
rss_reader.egg-info/
dist/
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include rss_reader/saver/to_html/templates/main.html
38 changes: 16 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
# How to create a PR with a homework task

1. Create fork from the following repo: https://github.com/E-P-T/Homework. (Docs: https://docs.github.com/en/get-started/quickstart/fork-a-repo )
2. Clone your forked repo in your local folder.
3. Create separate branches for each session.Example(`session_2`, `session_3` and so on)
4. Create folder with you First and Last name in you forked repo in the created session.
5. Add your task into created folder
6. Push finished session task in the appropriate branch in accordance with written above.
You should get the structure that looks something like that
# rss-reader

## rss-reader is a command line utility that allows you to view RSS feeds

## Usage

```
> python -m rss-reader https://news.yahoo.com/rss/
```
Branch: Session_2
DzmitryKolb
|___Task1.py
|___Task2.py
Branch: Session_3
DzmitryKolb
|___Task1.py
|___Task2.py
or:
```
> rss-reader https://news.yahoo.com/rss/
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

7. When you finish your work on task you should create Pull request to the appropriate branch of the main repo https://github.com/E-P-T/Homework (Docs: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).
Please use the following instructions to prepare good description of the pull request:
- Pull request header should be: `Session <Number of the session> - <FirstName> <LastName>`.
Example: `Session 2 - Dzmitry Kolb`
- Pull request body: You should write here what tasks were implemented.
Example: `Finished: Task 1.2, Task 1.3, Task 1.6`
Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
58 changes: 58 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))


# -- Project information -----------------------------------------------------

project = 'rss-reader'
copyright = '2022, Andrey Ozerets'
author = 'Andrey Ozerets'

# The full version, including alpha/beta/rc tags
release = '0.0.1'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
115 changes: 115 additions & 0 deletions docs/source/display_information.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
Display of information.
=======================

This part of the documentation describes how rss-reader displays information.
-----------------------------------------------------------------------------

Information display:
--------------------
Normally.
~~~~~~~~~~~
* When all data is available.

.. figure:: /images/output.jpg

* When there is missing data.

.. figure:: /images/output-empty.jpg

* When the date parameter is used and the result contains different news sources.

.. figure:: /images/date_parametr.jpg


With the given \-\-json parameter:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* When all data is available.

.. code-block:: JSON

[
{
"title_web_resource": "Yahoo News - Latest News & Headlines",
"link": "https://news.yahoo.com/rss/",
"items":
[
{
"title": "1955 warrant family seeks",
"link": "https://news.yahoo.com/1955-war79.html",
"pubDate": "2022-06-29T19:41:30Z",
"source": "Associated Press",
"content": {
"url": "https://s.yimg.com/uu/api/res/1.2/z8bf83",
"title": null
}
}
]
}
]

* When there is missing data.

.. code-block:: JSON

[
{
"title_web_resource": "Yahoo News - Latest News Headlines",
"link": "https://news.yahoo.com/rss/",
"items":
[
{
"title": "Biden takes",
"link": "",
"pubDate": "2022-06-18T14:37:24Z",
"source": "",
"content": {
"url": "",
"title": null
}
}
]
}
]


With the given \-\-date and \-\-json parameter:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: JSON

[
{
"title_web_resource": "Yahoo News - Latest News & Headlines",
"link": "https://news.yahoo.com/rss/",
"items":
[
{
"title": "Hong Kongs",
"link": "https://news.yahoo.com/hong.html",
"pubDate": "2022-06-01",
"source": "Associated Press",
"content": {
"url": "https://s.yimg.com/uu/api/reen/ap.org/0c",
"title": null
}
}
]
},
{
"title_web_resource": "Новости ООН - Здравоохранение",
"link": "https://news.un.org/feed/rss.xml",
"items":
[
{
"title": "ВОЗ: необходимы антибиотики нового поколения",
"link": "https://news.un.org/08.html",
"pubDate": "2022-06-01",
"source": "Associated Press",
"content": {
"url": "https://s.yimg.com/uu/api-rg/0725fc",
"title": null
}
}
]
}
]
Binary file added docs/source/images/date_parametr.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/local_storage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/output-empty.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. rss-reader documentation master file, created by
sphinx-quickstart on Sun Jun 26 12:48:42 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to rss-reader's documentation!
======================================

.. toctree::
:maxdepth: 2
:caption: Contents:

start_program.rst
display_information.rst
local_storage.rst
to_html_mode.rst
to_pdf_mode.rst
tests.rst



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
11 changes: 11 additions & 0 deletions docs/source/local_storage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Local storage.
=======================

This part of the documentation describes how rss-reader stores local information.
---------------------------------------------------------------------------------

All information is stored in 'home directory'/.rss-reader/local_storage.csv

Representation of the local storage file.

.. figure:: /images/local_storage.jpg
17 changes: 17 additions & 0 deletions docs/source/start_program.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Program launch
==============

This part of the documentation describes how to run rss-reader.
---------------------------------------------------------------

To start rss-reader, just run this simple command in the terminal of your choice::

$ python -m rss_reader

The program supports the following keys:
* source - RSS URL. Required argument.
* \-\-verbose - Outputs verbose status messages.a
* \-\-json - Print result as JSON in stdout.
* \-\-limit - Limit news topics if this parameter provided.
* \-\-version - Print version info.
* \-\-date - Search for news on a specified date. Date in the format Y-m-d (for example: 20191206).
14 changes: 14 additions & 0 deletions docs/source/tests.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Program testing.
================

This part of the documentation describes how to test the rss-reader.
--------------------------------------------------------------------

To start testing just run the following code::

$ python -m pytest

For reference:

* Each package contains its own tests.
* Integration tests are collected in the rss_reader\tests package.
14 changes: 14 additions & 0 deletions docs/source/to_html_mode.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Mode for saving work results to an HTML file.
=============================================

This part of the documentation describes how to save the results of your work in a HTML file.
---------------------------------------------------------------------------------------------

You can start this mode::

$ rss_reader https://rss.nytimes.com/services/xml/rss/nyt/World.xml --to-html D:\

The file will be saved as news.html.

The save handler in the html file is called through the chain pattern, and the specific way
the file is generated is determined through the strategy pattern.
14 changes: 14 additions & 0 deletions docs/source/to_pdf_mode.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Mode for saving work results to an PDF file.
=============================================

This part of the documentation describes how to save the results of your work in a PDF file.
---------------------------------------------------------------------------------------------

You can start this mode::

$ rss_reader https://rss.nytimes.com/services/xml/rss/nyt/World.xml --to-pdf D:\

The file will be saved as news.pdf.

The save handler in the PDF file is called by the chain template.
Temporary files are stored in the user's directory and are deleted after saving the PDF file.
Loading