From 4b9b870ce61fc33b34140a297ebeef2fb0930d4f Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Tue, 25 Oct 2022 21:54:00 +0300 Subject: [PATCH 01/15] Init new hw --- homeworks/DDYunin/6/my_hw_6/README.md | 0 homeworks/DDYunin/6/my_hw_6/hw_6/__init__.py | 0 homeworks/DDYunin/6/my_hw_6/pyproject.toml | 15 +++++++++++++++ homeworks/DDYunin/6/my_hw_6/tests/__init__.py | 0 4 files changed, 15 insertions(+) create mode 100644 homeworks/DDYunin/6/my_hw_6/README.md create mode 100644 homeworks/DDYunin/6/my_hw_6/hw_6/__init__.py create mode 100644 homeworks/DDYunin/6/my_hw_6/pyproject.toml create mode 100644 homeworks/DDYunin/6/my_hw_6/tests/__init__.py diff --git a/homeworks/DDYunin/6/my_hw_6/README.md b/homeworks/DDYunin/6/my_hw_6/README.md new file mode 100644 index 0000000..e69de29 diff --git a/homeworks/DDYunin/6/my_hw_6/hw_6/__init__.py b/homeworks/DDYunin/6/my_hw_6/hw_6/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/homeworks/DDYunin/6/my_hw_6/pyproject.toml b/homeworks/DDYunin/6/my_hw_6/pyproject.toml new file mode 100644 index 0000000..0bf42d4 --- /dev/null +++ b/homeworks/DDYunin/6/my_hw_6/pyproject.toml @@ -0,0 +1,15 @@ +[tool.poetry] +name = "my-hw-6" +version = "0.1.0" +description = "" +authors = ["Dan Yunin "] +readme = "README.md" +packages = [{include = "hw_6"}] + +[tool.poetry.dependencies] +python = "^3.10" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/homeworks/DDYunin/6/my_hw_6/tests/__init__.py b/homeworks/DDYunin/6/my_hw_6/tests/__init__.py new file mode 100644 index 0000000..e69de29 From 7caa690282f8c7bf99363114ddeea4b5f123f1a7 Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Tue, 25 Oct 2022 21:56:35 +0300 Subject: [PATCH 02/15] Update init of hw --- homeworks/DDYunin/6/{my_hw_6 => }/README.md | 0 homeworks/DDYunin/6/{my_hw_6 => }/hw_6/__init__.py | 0 homeworks/DDYunin/6/poetry.lock | 8 ++++++++ homeworks/DDYunin/6/{my_hw_6 => }/pyproject.toml | 0 homeworks/DDYunin/6/{my_hw_6 => }/tests/__init__.py | 0 setup.cfg | 2 ++ 6 files changed, 10 insertions(+) rename homeworks/DDYunin/6/{my_hw_6 => }/README.md (100%) rename homeworks/DDYunin/6/{my_hw_6 => }/hw_6/__init__.py (100%) create mode 100644 homeworks/DDYunin/6/poetry.lock rename homeworks/DDYunin/6/{my_hw_6 => }/pyproject.toml (100%) rename homeworks/DDYunin/6/{my_hw_6 => }/tests/__init__.py (100%) create mode 100644 setup.cfg diff --git a/homeworks/DDYunin/6/my_hw_6/README.md b/homeworks/DDYunin/6/README.md similarity index 100% rename from homeworks/DDYunin/6/my_hw_6/README.md rename to homeworks/DDYunin/6/README.md diff --git a/homeworks/DDYunin/6/my_hw_6/hw_6/__init__.py b/homeworks/DDYunin/6/hw_6/__init__.py similarity index 100% rename from homeworks/DDYunin/6/my_hw_6/hw_6/__init__.py rename to homeworks/DDYunin/6/hw_6/__init__.py diff --git a/homeworks/DDYunin/6/poetry.lock b/homeworks/DDYunin/6/poetry.lock new file mode 100644 index 0000000..2ddd539 --- /dev/null +++ b/homeworks/DDYunin/6/poetry.lock @@ -0,0 +1,8 @@ +package = [] + +[metadata] +lock-version = "1.1" +python-versions = "^3.10" +content-hash = "53f2eabc9c26446fbcc00d348c47878e118afc2054778c3c803a0a8028af27d9" + +[metadata.files] diff --git a/homeworks/DDYunin/6/my_hw_6/pyproject.toml b/homeworks/DDYunin/6/pyproject.toml similarity index 100% rename from homeworks/DDYunin/6/my_hw_6/pyproject.toml rename to homeworks/DDYunin/6/pyproject.toml diff --git a/homeworks/DDYunin/6/my_hw_6/tests/__init__.py b/homeworks/DDYunin/6/tests/__init__.py similarity index 100% rename from homeworks/DDYunin/6/my_hw_6/tests/__init__.py rename to homeworks/DDYunin/6/tests/__init__.py diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..46c4e01 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +ignore = D100, D101, D102, D103, D104, D105, D107 # Missing docstring somewhere \ No newline at end of file From 176b393f2387a64c43ea30e9cfba34092a5cff77 Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Tue, 25 Oct 2022 21:58:38 +0300 Subject: [PATCH 03/15] Add loguru and requests in project --- homeworks/DDYunin/6/poetry.lock | 126 ++++++++++++++++++++++++++++- homeworks/DDYunin/6/pyproject.toml | 2 + 2 files changed, 126 insertions(+), 2 deletions(-) diff --git a/homeworks/DDYunin/6/poetry.lock b/homeworks/DDYunin/6/poetry.lock index 2ddd539..adf2b39 100644 --- a/homeworks/DDYunin/6/poetry.lock +++ b/homeworks/DDYunin/6/poetry.lock @@ -1,8 +1,130 @@ -package = [] +[[package]] +name = "certifi" +version = "2022.9.24" +description = "Python package for providing Mozilla's CA Bundle." +category = "main" +optional = false +python-versions = ">=3.6" + +[[package]] +name = "charset-normalizer" +version = "2.1.1" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "main" +optional = false +python-versions = ">=3.6.0" + +[package.extras] +unicode-backport = ["unicodedata2"] + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +category = "main" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" + +[[package]] +name = "idna" +version = "3.4" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" +optional = false +python-versions = ">=3.5" + +[[package]] +name = "loguru" +version = "0.6.0" +description = "Python logging made (stupidly) simple" +category = "main" +optional = false +python-versions = ">=3.5" + +[package.dependencies] +colorama = {version = ">=0.3.4", markers = "sys_platform == \"win32\""} +win32-setctime = {version = ">=1.0.0", markers = "sys_platform == \"win32\""} + +[package.extras] +dev = ["Sphinx (>=4.1.1)", "black (>=19.10b0)", "colorama (>=0.3.4)", "docutils (==0.16)", "flake8 (>=3.7.7)", "isort (>=5.1.1)", "pytest (>=4.6.2)", "pytest-cov (>=2.7.1)", "sphinx-autobuild (>=0.7.1)", "sphinx-rtd-theme (>=0.4.3)", "tox (>=3.9.0)"] + +[[package]] +name = "requests" +version = "2.28.1" +description = "Python HTTP for Humans." +category = "main" +optional = false +python-versions = ">=3.7, <4" + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<3" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<1.27" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + +[[package]] +name = "urllib3" +version = "1.26.12" +description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4" + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] +secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] + +[[package]] +name = "win32-setctime" +version = "1.1.0" +description = "A small Python utility to set file creation time on Windows" +category = "main" +optional = false +python-versions = ">=3.5" + +[package.extras] +dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "1.1" python-versions = "^3.10" -content-hash = "53f2eabc9c26446fbcc00d348c47878e118afc2054778c3c803a0a8028af27d9" +content-hash = "3625efc97bdd21ad01334e6c91dd7db106499103c4de5fbad81f33390a9f06cd" [metadata.files] +certifi = [ + {file = "certifi-2022.9.24-py3-none-any.whl", hash = "sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382"}, + {file = "certifi-2022.9.24.tar.gz", hash = "sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14"}, +] +charset-normalizer = [ + {file = "charset-normalizer-2.1.1.tar.gz", hash = "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"}, + {file = "charset_normalizer-2.1.1-py3-none-any.whl", hash = "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"}, +] +colorama = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] +idna = [ + {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, + {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, +] +loguru = [ + {file = "loguru-0.6.0-py3-none-any.whl", hash = "sha256:4e2414d534a2ab57573365b3e6d0234dfb1d84b68b7f3b948e6fb743860a77c3"}, + {file = "loguru-0.6.0.tar.gz", hash = "sha256:066bd06758d0a513e9836fd9c6b5a75bfb3fd36841f4b996bc60b547a309d41c"}, +] +requests = [ + {file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"}, + {file = "requests-2.28.1.tar.gz", hash = "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"}, +] +urllib3 = [ + {file = "urllib3-1.26.12-py2.py3-none-any.whl", hash = "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997"}, + {file = "urllib3-1.26.12.tar.gz", hash = "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"}, +] +win32-setctime = [ + {file = "win32_setctime-1.1.0-py3-none-any.whl", hash = "sha256:231db239e959c2fe7eb1d7dc129f11172354f98361c4fa2d6d2d7e278baa8aad"}, + {file = "win32_setctime-1.1.0.tar.gz", hash = "sha256:15cf5750465118d6929ae4de4eb46e8edae9a5634350c01ba582df868e932cb2"}, +] diff --git a/homeworks/DDYunin/6/pyproject.toml b/homeworks/DDYunin/6/pyproject.toml index 0bf42d4..a78b472 100644 --- a/homeworks/DDYunin/6/pyproject.toml +++ b/homeworks/DDYunin/6/pyproject.toml @@ -8,6 +8,8 @@ packages = [{include = "hw_6"}] [tool.poetry.dependencies] python = "^3.10" +loguru = "^0.6.0" +requests = "^2.28.1" [build-system] From 6f5e846942b9928b78430341fe8ffdac263215ec Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Tue, 25 Oct 2022 22:51:12 +0300 Subject: [PATCH 04/15] Add emails.csv, parser.py and update __main__.py --- homeworks/DDYunin/6/hw_6/__main__.py | 7 +++++++ homeworks/DDYunin/6/hw_6/emails.csv | 1 + homeworks/DDYunin/6/hw_6/parser.py | 17 +++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 homeworks/DDYunin/6/hw_6/__main__.py create mode 100644 homeworks/DDYunin/6/hw_6/emails.csv create mode 100644 homeworks/DDYunin/6/hw_6/parser.py diff --git a/homeworks/DDYunin/6/hw_6/__main__.py b/homeworks/DDYunin/6/hw_6/__main__.py new file mode 100644 index 0000000..1417de2 --- /dev/null +++ b/homeworks/DDYunin/6/hw_6/__main__.py @@ -0,0 +1,7 @@ +from hw_6.parser import start_parsing + +def main(): + start_parsing() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/homeworks/DDYunin/6/hw_6/emails.csv b/homeworks/DDYunin/6/hw_6/emails.csv new file mode 100644 index 0000000..0719baf --- /dev/null +++ b/homeworks/DDYunin/6/hw_6/emails.csv @@ -0,0 +1 @@ +"Sincere@april.biz","Shanna@melissa.tv","Nathan@yesenia.net","Julianne.OConner@kory.org","Lucio_Hettinger@annie.ca","Karley_Dach@jasper.info","Telly.Hoeger@billy.biz","Sherwood@rosamond.me","Chaim_McDermott@dana.io","Rey.Padberg@karina.biz" \ No newline at end of file diff --git a/homeworks/DDYunin/6/hw_6/parser.py b/homeworks/DDYunin/6/hw_6/parser.py new file mode 100644 index 0000000..cba1744 --- /dev/null +++ b/homeworks/DDYunin/6/hw_6/parser.py @@ -0,0 +1,17 @@ +import csv + +def start_parsing(): + all_emails_not_flatten = parse_emails_from_csv_file() + # Вытягиваю list of lists в простой list + emails = flatten(all_emails_not_flatten) + +def parse_emails_from_csv_file(): + emails = [] + with open('hw_6/emails.csv') as f: + reader = csv.reader(f) + # Можно ли возвращать значение прямо из контекстного менеджера, не будет ли это плохо? + emails = list(reader) + return emails + +def flatten(list_of_emails): + return [item for sublist in list_of_emails for item in sublist] \ No newline at end of file From e89f76beee1e81e5d6b58b809f7879f769e3e311 Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Wed, 26 Oct 2022 15:07:41 +0300 Subject: [PATCH 05/15] Ready task, but without logs --- homeworks/DDYunin/6/hw_6/parser.py | 91 ++++++++++++++++++++++++++++-- homeworks/DDYunin/6/poetry.lock | 88 ++++++++++++++++++++++++++++- homeworks/DDYunin/6/pyproject.toml | 1 + 3 files changed, 175 insertions(+), 5 deletions(-) diff --git a/homeworks/DDYunin/6/hw_6/parser.py b/homeworks/DDYunin/6/hw_6/parser.py index cba1744..edfa972 100644 --- a/homeworks/DDYunin/6/hw_6/parser.py +++ b/homeworks/DDYunin/6/hw_6/parser.py @@ -1,17 +1,100 @@ import csv +import requests +from lxml import etree as et, objectify + +# Можно ли возвращать значение прямо из контекстного менеджера, не будет ли это плохо? +# В файлах json в тексте содержатся спец симовл \n, в следствии чего текст переносится на новые строки, это надо исправлять или нет? def start_parsing(): all_emails_not_flatten = parse_emails_from_csv_file() - # Вытягиваю list of lists в простой list - emails = flatten(all_emails_not_flatten) + # Вытягиваю list of lists в простой list и преобразую его в dict + emails_ids = dict.fromkeys(flatten(all_emails_not_flatten)) + people_data = get_data_json() + emails_ids = get_ready_dict_with_emails_and_ids(people_data, emails_ids) + print(emails_ids) + write_data_xml(emails_ids) + def parse_emails_from_csv_file(): emails = [] with open('hw_6/emails.csv') as f: reader = csv.reader(f) - # Можно ли возвращать значение прямо из контекстного менеджера, не будет ли это плохо? emails = list(reader) return emails def flatten(list_of_emails): - return [item for sublist in list_of_emails for item in sublist] \ No newline at end of file + return [item for sublist in list_of_emails for item in sublist] + +def get_data_json(): + url = 'https://jsonplaceholder.typicode.com/users/' + response = requests.get(url) + return response.json() + +def get_ready_dict_with_emails_and_ids(people_data, emails_ids): + for item in people_data: + emails_ids[item['email']] = item["id"] + return emails_ids + +def write_data_xml(dict_emails_and_ids): + for email in dict_emails_and_ids: + xml_struct = create_struct_xml_file(email, dict_emails_and_ids) + xml_struct = add_posts_in_xml_file(xml_struct, email, dict_emails_and_ids) + xml_struct = add_albums_in_xml_file(xml_struct, email, dict_emails_and_ids) + xml_struct = add_todos_in_xml_file(xml_struct, email, dict_emails_and_ids) + save_ready_xml_file(xml_struct, email, dict_emails_and_ids) + +def create_struct_xml_file(user_email, all_data): + struct = et.Element('user') + id_element = et.SubElement(struct, 'id') + id_element.text = '{0}'.format(all_data[user_email]) + email_element = et.SubElement(struct, 'email') + email_element.text = '{0}'.format(user_email) + return struct + +def add_posts_in_xml_file(xml_struct, user_email, all_data): + data_posts = get_user_data_posts(all_data[user_email]) + posts_element = et.SubElement(xml_struct, 'posts') + for post in data_posts: + post_element = et.SubElement(posts_element, 'post') + et.SubElement(post_element, 'id').text = '{0}'.format(post['id']) + et.SubElement(post_element, 'title').text = '{0}'.format(post['title']) + et.SubElement(post_element, 'body').text = '{0}'.format(post['body']).replace('\n', ' ') + return xml_struct + +def add_albums_in_xml_file(xml_struct, user_email, all_data): + data_albums = get_user_data_albums(all_data[user_email]) + albums_element = et.SubElement(xml_struct, 'albums') + for album in data_albums: + album_element = et.SubElement(albums_element, 'album') + et.SubElement(album_element, 'id').text = '{0}'.format(album['id']) + et.SubElement(album_element, 'title').text = '{0}'.format(album['title']) + return xml_struct + +def add_todos_in_xml_file(xml_struct, user_email, all_data): + data_todos = get_user_data_todos(all_data[user_email]) + todos_element = et.SubElement(xml_struct, 'todos') + for todo in data_todos: + todo_element = et.SubElement(todos_element, 'todo') + et.SubElement(todo_element, 'id').text = '{0}'.format(todo['id']) + et.SubElement(todo_element, 'title').text = '{0}'.format(todo['title']) + et.SubElement(todo_element, 'completed').text = '{0}'.format(todo['completed']) + return xml_struct + +def save_ready_xml_file(xml_struct, user_email, all_data): + xml_file = et.ElementTree(xml_struct) + xml_file.write('hw_6/users/{0}.xml'.format(all_data[user_email]), encoding="UTF-8", pretty_print=True, xml_declaration = True) + +def get_user_data_posts(user_id): + url = 'https://jsonplaceholder.typicode.com/users/{0}/posts'.format(user_id) + response = requests.get(url) + return response.json() + +def get_user_data_albums(user_id): + url = 'https://jsonplaceholder.typicode.com/users/{0}/albums'.format(user_id) + response = requests.get(url) + return response.json() + +def get_user_data_todos(user_id): + url = 'https://jsonplaceholder.typicode.com/users/{0}/todos'.format(user_id) + response = requests.get(url) + return response.json() diff --git a/homeworks/DDYunin/6/poetry.lock b/homeworks/DDYunin/6/poetry.lock index adf2b39..5daa4b0 100644 --- a/homeworks/DDYunin/6/poetry.lock +++ b/homeworks/DDYunin/6/poetry.lock @@ -48,6 +48,20 @@ win32-setctime = {version = ">=1.0.0", markers = "sys_platform == \"win32\""} [package.extras] dev = ["Sphinx (>=4.1.1)", "black (>=19.10b0)", "colorama (>=0.3.4)", "docutils (==0.16)", "flake8 (>=3.7.7)", "isort (>=5.1.1)", "pytest (>=4.6.2)", "pytest-cov (>=2.7.1)", "sphinx-autobuild (>=0.7.1)", "sphinx-rtd-theme (>=0.4.3)", "tox (>=3.9.0)"] +[[package]] +name = "lxml" +version = "4.9.1" +description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*" + +[package.extras] +cssselect = ["cssselect (>=0.7)"] +html5 = ["html5lib"] +htmlsoup = ["BeautifulSoup4"] +source = ["Cython (>=0.29.7)"] + [[package]] name = "requests" version = "2.28.1" @@ -93,7 +107,7 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "1.1" python-versions = "^3.10" -content-hash = "3625efc97bdd21ad01334e6c91dd7db106499103c4de5fbad81f33390a9f06cd" +content-hash = "23d1213d8dfaa705892116ee5ed3506a1e2f20bce65b4ce8d413639e1210fcf8" [metadata.files] certifi = [ @@ -116,6 +130,78 @@ loguru = [ {file = "loguru-0.6.0-py3-none-any.whl", hash = "sha256:4e2414d534a2ab57573365b3e6d0234dfb1d84b68b7f3b948e6fb743860a77c3"}, {file = "loguru-0.6.0.tar.gz", hash = "sha256:066bd06758d0a513e9836fd9c6b5a75bfb3fd36841f4b996bc60b547a309d41c"}, ] +lxml = [ + {file = "lxml-4.9.1-cp27-cp27m-macosx_10_15_x86_64.whl", hash = "sha256:98cafc618614d72b02185ac583c6f7796202062c41d2eeecdf07820bad3295ed"}, + {file = "lxml-4.9.1-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c62e8dd9754b7debda0c5ba59d34509c4688f853588d75b53c3791983faa96fc"}, + {file = "lxml-4.9.1-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:21fb3d24ab430fc538a96e9fbb9b150029914805d551deeac7d7822f64631dfc"}, + {file = "lxml-4.9.1-cp27-cp27m-win32.whl", hash = "sha256:86e92728ef3fc842c50a5cb1d5ba2bc66db7da08a7af53fb3da79e202d1b2cd3"}, + {file = "lxml-4.9.1-cp27-cp27m-win_amd64.whl", hash = "sha256:4cfbe42c686f33944e12f45a27d25a492cc0e43e1dc1da5d6a87cbcaf2e95627"}, + {file = "lxml-4.9.1-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:dad7b164905d3e534883281c050180afcf1e230c3d4a54e8038aa5cfcf312b84"}, + {file = "lxml-4.9.1-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a614e4afed58c14254e67862456d212c4dcceebab2eaa44d627c2ca04bf86837"}, + {file = "lxml-4.9.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:f9ced82717c7ec65a67667bb05865ffe38af0e835cdd78728f1209c8fffe0cad"}, + {file = "lxml-4.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:d9fc0bf3ff86c17348dfc5d322f627d78273eba545db865c3cd14b3f19e57fa5"}, + {file = "lxml-4.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:e5f66bdf0976ec667fc4594d2812a00b07ed14d1b44259d19a41ae3fff99f2b8"}, + {file = "lxml-4.9.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:fe17d10b97fdf58155f858606bddb4e037b805a60ae023c009f760d8361a4eb8"}, + {file = "lxml-4.9.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8caf4d16b31961e964c62194ea3e26a0e9561cdf72eecb1781458b67ec83423d"}, + {file = "lxml-4.9.1-cp310-cp310-win32.whl", hash = "sha256:4780677767dd52b99f0af1f123bc2c22873d30b474aa0e2fc3fe5e02217687c7"}, + {file = "lxml-4.9.1-cp310-cp310-win_amd64.whl", hash = "sha256:b122a188cd292c4d2fcd78d04f863b789ef43aa129b233d7c9004de08693728b"}, + {file = "lxml-4.9.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:be9eb06489bc975c38706902cbc6888f39e946b81383abc2838d186f0e8b6a9d"}, + {file = "lxml-4.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:f1be258c4d3dc609e654a1dc59d37b17d7fef05df912c01fc2e15eb43a9735f3"}, + {file = "lxml-4.9.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:927a9dd016d6033bc12e0bf5dee1dde140235fc8d0d51099353c76081c03dc29"}, + {file = "lxml-4.9.1-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9232b09f5efee6a495a99ae6824881940d6447debe272ea400c02e3b68aad85d"}, + {file = "lxml-4.9.1-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:04da965dfebb5dac2619cb90fcf93efdb35b3c6994fea58a157a834f2f94b318"}, + {file = "lxml-4.9.1-cp35-cp35m-win32.whl", hash = "sha256:4d5bae0a37af799207140652a700f21a85946f107a199bcb06720b13a4f1f0b7"}, + {file = "lxml-4.9.1-cp35-cp35m-win_amd64.whl", hash = "sha256:4878e667ebabe9b65e785ac8da4d48886fe81193a84bbe49f12acff8f7a383a4"}, + {file = "lxml-4.9.1-cp36-cp36m-macosx_10_15_x86_64.whl", hash = "sha256:1355755b62c28950f9ce123c7a41460ed9743c699905cbe664a5bcc5c9c7c7fb"}, + {file = "lxml-4.9.1-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:bcaa1c495ce623966d9fc8a187da80082334236a2a1c7e141763ffaf7a405067"}, + {file = "lxml-4.9.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6eafc048ea3f1b3c136c71a86db393be36b5b3d9c87b1c25204e7d397cee9536"}, + {file = "lxml-4.9.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:13c90064b224e10c14dcdf8086688d3f0e612db53766e7478d7754703295c7c8"}, + {file = "lxml-4.9.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:206a51077773c6c5d2ce1991327cda719063a47adc02bd703c56a662cdb6c58b"}, + {file = "lxml-4.9.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:e8f0c9d65da595cfe91713bc1222af9ecabd37971762cb830dea2fc3b3bb2acf"}, + {file = "lxml-4.9.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:8f0a4d179c9a941eb80c3a63cdb495e539e064f8054230844dcf2fcb812b71d3"}, + {file = "lxml-4.9.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:830c88747dce8a3e7525defa68afd742b4580df6aa2fdd6f0855481e3994d391"}, + {file = "lxml-4.9.1-cp36-cp36m-win32.whl", hash = "sha256:1e1cf47774373777936c5aabad489fef7b1c087dcd1f426b621fda9dcc12994e"}, + {file = "lxml-4.9.1-cp36-cp36m-win_amd64.whl", hash = "sha256:5974895115737a74a00b321e339b9c3f45c20275d226398ae79ac008d908bff7"}, + {file = "lxml-4.9.1-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:1423631e3d51008871299525b541413c9b6c6423593e89f9c4cfbe8460afc0a2"}, + {file = "lxml-4.9.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:2aaf6a0a6465d39b5ca69688fce82d20088c1838534982996ec46633dc7ad6cc"}, + {file = "lxml-4.9.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:9f36de4cd0c262dd9927886cc2305aa3f2210db437aa4fed3fb4940b8bf4592c"}, + {file = "lxml-4.9.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:ae06c1e4bc60ee076292e582a7512f304abdf6c70db59b56745cca1684f875a4"}, + {file = "lxml-4.9.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:57e4d637258703d14171b54203fd6822fda218c6c2658a7d30816b10995f29f3"}, + {file = "lxml-4.9.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6d279033bf614953c3fc4a0aa9ac33a21e8044ca72d4fa8b9273fe75359d5cca"}, + {file = "lxml-4.9.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:a60f90bba4c37962cbf210f0188ecca87daafdf60271f4c6948606e4dabf8785"}, + {file = "lxml-4.9.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:6ca2264f341dd81e41f3fffecec6e446aa2121e0b8d026fb5130e02de1402785"}, + {file = "lxml-4.9.1-cp37-cp37m-win32.whl", hash = "sha256:27e590352c76156f50f538dbcebd1925317a0f70540f7dc8c97d2931c595783a"}, + {file = "lxml-4.9.1-cp37-cp37m-win_amd64.whl", hash = "sha256:eea5d6443b093e1545ad0210e6cf27f920482bfcf5c77cdc8596aec73523bb7e"}, + {file = "lxml-4.9.1-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:f05251bbc2145349b8d0b77c0d4e5f3b228418807b1ee27cefb11f69ed3d233b"}, + {file = "lxml-4.9.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:487c8e61d7acc50b8be82bda8c8d21d20e133c3cbf41bd8ad7eb1aaeb3f07c97"}, + {file = "lxml-4.9.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:8d1a92d8e90b286d491e5626af53afef2ba04da33e82e30744795c71880eaa21"}, + {file = "lxml-4.9.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:b570da8cd0012f4af9fa76a5635cd31f707473e65a5a335b186069d5c7121ff2"}, + {file = "lxml-4.9.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5ef87fca280fb15342726bd5f980f6faf8b84a5287fcc2d4962ea8af88b35130"}, + {file = "lxml-4.9.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:93e414e3206779ef41e5ff2448067213febf260ba747fc65389a3ddaa3fb8715"}, + {file = "lxml-4.9.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6653071f4f9bac46fbc30f3c7838b0e9063ee335908c5d61fb7a4a86c8fd2036"}, + {file = "lxml-4.9.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:32a73c53783becdb7eaf75a2a1525ea8e49379fb7248c3eeefb9412123536387"}, + {file = "lxml-4.9.1-cp38-cp38-win32.whl", hash = "sha256:1a7c59c6ffd6ef5db362b798f350e24ab2cfa5700d53ac6681918f314a4d3b94"}, + {file = "lxml-4.9.1-cp38-cp38-win_amd64.whl", hash = "sha256:1436cf0063bba7888e43f1ba8d58824f085410ea2025befe81150aceb123e345"}, + {file = "lxml-4.9.1-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:4beea0f31491bc086991b97517b9683e5cfb369205dac0148ef685ac12a20a67"}, + {file = "lxml-4.9.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:41fb58868b816c202e8881fd0f179a4644ce6e7cbbb248ef0283a34b73ec73bb"}, + {file = "lxml-4.9.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:bd34f6d1810d9354dc7e35158aa6cc33456be7706df4420819af6ed966e85448"}, + {file = "lxml-4.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:edffbe3c510d8f4bf8640e02ca019e48a9b72357318383ca60e3330c23aaffc7"}, + {file = "lxml-4.9.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6d949f53ad4fc7cf02c44d6678e7ff05ec5f5552b235b9e136bd52e9bf730b91"}, + {file = "lxml-4.9.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:079b68f197c796e42aa80b1f739f058dcee796dc725cc9a1be0cdb08fc45b000"}, + {file = "lxml-4.9.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9c3a88d20e4fe4a2a4a84bf439a5ac9c9aba400b85244c63a1ab7088f85d9d25"}, + {file = "lxml-4.9.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4e285b5f2bf321fc0857b491b5028c5f276ec0c873b985d58d7748ece1d770dd"}, + {file = "lxml-4.9.1-cp39-cp39-win32.whl", hash = "sha256:ef72013e20dd5ba86a8ae1aed7f56f31d3374189aa8b433e7b12ad182c0d2dfb"}, + {file = "lxml-4.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:10d2017f9150248563bb579cd0d07c61c58da85c922b780060dcc9a3aa9f432d"}, + {file = "lxml-4.9.1-pp37-pypy37_pp73-macosx_10_15_x86_64.whl", hash = "sha256:0538747a9d7827ce3e16a8fdd201a99e661c7dee3c96c885d8ecba3c35d1032c"}, + {file = "lxml-4.9.1-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:0645e934e940107e2fdbe7c5b6fb8ec6232444260752598bc4d09511bd056c0b"}, + {file = "lxml-4.9.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:6daa662aba22ef3258934105be2dd9afa5bb45748f4f702a3b39a5bf53a1f4dc"}, + {file = "lxml-4.9.1-pp38-pypy38_pp73-macosx_10_15_x86_64.whl", hash = "sha256:603a464c2e67d8a546ddaa206d98e3246e5db05594b97db844c2f0a1af37cf5b"}, + {file = "lxml-4.9.1-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:c4b2e0559b68455c085fb0f6178e9752c4be3bba104d6e881eb5573b399d1eb2"}, + {file = "lxml-4.9.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:0f3f0059891d3254c7b5fb935330d6db38d6519ecd238ca4fce93c234b4a0f73"}, + {file = "lxml-4.9.1-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:c852b1530083a620cb0de5f3cd6826f19862bafeaf77586f1aef326e49d95f0c"}, + {file = "lxml-4.9.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:287605bede6bd36e930577c5925fcea17cb30453d96a7b4c63c14a257118dbb9"}, + {file = "lxml-4.9.1.tar.gz", hash = "sha256:fe749b052bb7233fe5d072fcb549221a8cb1a16725c47c37e42b0b9cb3ff2c3f"}, +] requests = [ {file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"}, {file = "requests-2.28.1.tar.gz", hash = "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"}, diff --git a/homeworks/DDYunin/6/pyproject.toml b/homeworks/DDYunin/6/pyproject.toml index a78b472..d6da07c 100644 --- a/homeworks/DDYunin/6/pyproject.toml +++ b/homeworks/DDYunin/6/pyproject.toml @@ -10,6 +10,7 @@ packages = [{include = "hw_6"}] python = "^3.10" loguru = "^0.6.0" requests = "^2.28.1" +lxml = "^4.9.1" [build-system] From 225572ed6cda64fecba8f3e7b11def1b2409c1f3 Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Wed, 26 Oct 2022 18:04:21 +0300 Subject: [PATCH 06/15] Add ToDo list --- homeworks/DDYunin/6/hw_6/parser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeworks/DDYunin/6/hw_6/parser.py b/homeworks/DDYunin/6/hw_6/parser.py index edfa972..2983b73 100644 --- a/homeworks/DDYunin/6/hw_6/parser.py +++ b/homeworks/DDYunin/6/hw_6/parser.py @@ -5,6 +5,10 @@ # Можно ли возвращать значение прямо из контекстного менеджера, не будет ли это плохо? # В файлах json в тексте содержатся спец симовл \n, в следствии чего текст переносится на новые строки, это надо исправлять или нет? +# TODO +# Добавить логи +# Раскидать содержимое модуля на разные модули, ибо слишком много и сложно! + def start_parsing(): all_emails_not_flatten = parse_emails_from_csv_file() # Вытягиваю list of lists в простой list и преобразую его в dict From 3fef0e1ad74a2d62e8e210aa1f85e42ac856e643 Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Fri, 28 Oct 2022 16:24:23 +0300 Subject: [PATCH 07/15] Test commit --- homeworks/DDYunin/6/hw_6/emails.csv | 1 - homeworks/DDYunin/6/hw_6/emails_file.csv | 1 + homeworks/DDYunin/6/hw_6/parser.py | 8 +++++++- 3 files changed, 8 insertions(+), 2 deletions(-) delete mode 100644 homeworks/DDYunin/6/hw_6/emails.csv create mode 100644 homeworks/DDYunin/6/hw_6/emails_file.csv diff --git a/homeworks/DDYunin/6/hw_6/emails.csv b/homeworks/DDYunin/6/hw_6/emails.csv deleted file mode 100644 index 0719baf..0000000 --- a/homeworks/DDYunin/6/hw_6/emails.csv +++ /dev/null @@ -1 +0,0 @@ -"Sincere@april.biz","Shanna@melissa.tv","Nathan@yesenia.net","Julianne.OConner@kory.org","Lucio_Hettinger@annie.ca","Karley_Dach@jasper.info","Telly.Hoeger@billy.biz","Sherwood@rosamond.me","Chaim_McDermott@dana.io","Rey.Padberg@karina.biz" \ No newline at end of file diff --git a/homeworks/DDYunin/6/hw_6/emails_file.csv b/homeworks/DDYunin/6/hw_6/emails_file.csv new file mode 100644 index 0000000..a963658 --- /dev/null +++ b/homeworks/DDYunin/6/hw_6/emails_file.csv @@ -0,0 +1 @@ +"Sincere@april.biz","Shanna@melissa.tv","anastasia.net" \ No newline at end of file diff --git a/homeworks/DDYunin/6/hw_6/parser.py b/homeworks/DDYunin/6/hw_6/parser.py index 2983b73..b4852cb 100644 --- a/homeworks/DDYunin/6/hw_6/parser.py +++ b/homeworks/DDYunin/6/hw_6/parser.py @@ -1,6 +1,7 @@ import csv import requests from lxml import etree as et, objectify +import os # Можно ли возвращать значение прямо из контекстного менеджера, не будет ли это плохо? # В файлах json в тексте содержатся спец симовл \n, в следствии чего текст переносится на новые строки, это надо исправлять или нет? @@ -21,7 +22,7 @@ def start_parsing(): def parse_emails_from_csv_file(): emails = [] - with open('hw_6/emails.csv') as f: + with open('hw_6/emails_file.csv') as f: reader = csv.reader(f) emails = list(reader) return emails @@ -40,6 +41,7 @@ def get_ready_dict_with_emails_and_ids(people_data, emails_ids): return emails_ids def write_data_xml(dict_emails_and_ids): + create_catalog_users() for email in dict_emails_and_ids: xml_struct = create_struct_xml_file(email, dict_emails_and_ids) xml_struct = add_posts_in_xml_file(xml_struct, email, dict_emails_and_ids) @@ -88,6 +90,10 @@ def save_ready_xml_file(xml_struct, user_email, all_data): xml_file = et.ElementTree(xml_struct) xml_file.write('hw_6/users/{0}.xml'.format(all_data[user_email]), encoding="UTF-8", pretty_print=True, xml_declaration = True) +def create_catalog_users(): + if not os.path.exists("hw_6/users"): + os.mkdir("hw_6/users") + def get_user_data_posts(user_id): url = 'https://jsonplaceholder.typicode.com/users/{0}/posts'.format(user_id) response = requests.get(url) From 25448d0058bdf93de101b0e6c189a50f6544ce3b Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Fri, 28 Oct 2022 17:22:10 +0300 Subject: [PATCH 08/15] Add logs in code --- homeworks/DDYunin/6/hw_6/emails_file.csv | 2 +- homeworks/DDYunin/6/hw_6/parser.py | 43 ++++++++++++++++++++---- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/homeworks/DDYunin/6/hw_6/emails_file.csv b/homeworks/DDYunin/6/hw_6/emails_file.csv index a963658..a230c04 100644 --- a/homeworks/DDYunin/6/hw_6/emails_file.csv +++ b/homeworks/DDYunin/6/hw_6/emails_file.csv @@ -1 +1 @@ -"Sincere@april.biz","Shanna@melissa.tv","anastasia.net" \ No newline at end of file +"Sincere@april.biz","anastasia.net","Shanna@melissa.tv" \ No newline at end of file diff --git a/homeworks/DDYunin/6/hw_6/parser.py b/homeworks/DDYunin/6/hw_6/parser.py index b4852cb..1f54835 100644 --- a/homeworks/DDYunin/6/hw_6/parser.py +++ b/homeworks/DDYunin/6/hw_6/parser.py @@ -1,7 +1,10 @@ import csv import requests +from loguru import logger +from datetime import datetime from lxml import etree as et, objectify import os +import shutil # Можно ли возвращать значение прямо из контекстного менеджера, не будет ли это плохо? # В файлах json в тексте содержатся спец симовл \n, в следствии чего текст переносится на новые строки, это надо исправлять или нет? @@ -14,16 +17,19 @@ def start_parsing(): all_emails_not_flatten = parse_emails_from_csv_file() # Вытягиваю list of lists в простой list и преобразую его в dict emails_ids = dict.fromkeys(flatten(all_emails_not_flatten)) + logger.info('This program work with {0} users'.format(len(emails_ids))) people_data = get_data_json() emails_ids = get_ready_dict_with_emails_and_ids(people_data, emails_ids) - print(emails_ids) write_data_xml(emails_ids) def parse_emails_from_csv_file(): emails = [] + start_time = datetime.now() with open('hw_6/emails_file.csv') as f: reader = csv.reader(f) + end_time = datetime.now() + logger.info('The request lasted {0} seconds'.format(end_time - start_time)) emails = list(reader) return emails @@ -32,17 +38,22 @@ def flatten(list_of_emails): def get_data_json(): url = 'https://jsonplaceholder.typicode.com/users/' + start_time = datetime.now() response = requests.get(url) + end_time = datetime.now() + logger.info('The request lasted {0} seconds'.format(end_time - start_time)) return response.json() def get_ready_dict_with_emails_and_ids(people_data, emails_ids): for item in people_data: - emails_ids[item['email']] = item["id"] + if item['email'] in emails_ids: + emails_ids[item['email']] = item["id"] return emails_ids def write_data_xml(dict_emails_and_ids): create_catalog_users() for email in dict_emails_and_ids: + logger.info('Starts parsing for {0}'.format(email)) xml_struct = create_struct_xml_file(email, dict_emails_and_ids) xml_struct = add_posts_in_xml_file(xml_struct, email, dict_emails_and_ids) xml_struct = add_albums_in_xml_file(xml_struct, email, dict_emails_and_ids) @@ -58,8 +69,10 @@ def create_struct_xml_file(user_email, all_data): return struct def add_posts_in_xml_file(xml_struct, user_email, all_data): - data_posts = get_user_data_posts(all_data[user_email]) + data_posts = get_user_data_posts(all_data[user_email]) posts_element = et.SubElement(xml_struct, 'posts') + if not data_posts: + posts_element.text = '' for post in data_posts: post_element = et.SubElement(posts_element, 'post') et.SubElement(post_element, 'id').text = '{0}'.format(post['id']) @@ -70,6 +83,8 @@ def add_posts_in_xml_file(xml_struct, user_email, all_data): def add_albums_in_xml_file(xml_struct, user_email, all_data): data_albums = get_user_data_albums(all_data[user_email]) albums_element = et.SubElement(xml_struct, 'albums') + if not data_albums: + albums_element.text = '' for album in data_albums: album_element = et.SubElement(albums_element, 'album') et.SubElement(album_element, 'id').text = '{0}'.format(album['id']) @@ -79,6 +94,8 @@ def add_albums_in_xml_file(xml_struct, user_email, all_data): def add_todos_in_xml_file(xml_struct, user_email, all_data): data_todos = get_user_data_todos(all_data[user_email]) todos_element = et.SubElement(xml_struct, 'todos') + if not data_todos: + todos_element.text = '' for todo in data_todos: todo_element = et.SubElement(todos_element, 'todo') et.SubElement(todo_element, 'id').text = '{0}'.format(todo['id']) @@ -88,23 +105,37 @@ def add_todos_in_xml_file(xml_struct, user_email, all_data): def save_ready_xml_file(xml_struct, user_email, all_data): xml_file = et.ElementTree(xml_struct) - xml_file.write('hw_6/users/{0}.xml'.format(all_data[user_email]), encoding="UTF-8", pretty_print=True, xml_declaration = True) + start_time = datetime.now() + with open('hw_6/users/{0}.xml'.format(all_data[user_email]), 'wb') as file: + xml_file.write(file, encoding="UTF-8", pretty_print=True, xml_declaration = True) + end_time = datetime.now() + logger.info('The request lasted {0} seconds'.format(end_time - start_time)) def create_catalog_users(): - if not os.path.exists("hw_6/users"): - os.mkdir("hw_6/users") + if os.path.exists("hw_6/users"): + shutil.rmtree("hw_6/users") + os.mkdir("hw_6/users") def get_user_data_posts(user_id): url = 'https://jsonplaceholder.typicode.com/users/{0}/posts'.format(user_id) + start_time = datetime.now() response = requests.get(url) + end_time = datetime.now() + logger.info('The request lasted {0} seconds'.format(end_time - start_time)) return response.json() def get_user_data_albums(user_id): url = 'https://jsonplaceholder.typicode.com/users/{0}/albums'.format(user_id) + start_time = datetime.now() response = requests.get(url) + end_time = datetime.now() + logger.info('The request lasted {0} seconds'.format(end_time - start_time)) return response.json() def get_user_data_todos(user_id): url = 'https://jsonplaceholder.typicode.com/users/{0}/todos'.format(user_id) + start_time = datetime.now() response = requests.get(url) + end_time = datetime.now() + logger.info('The request lasted {0} seconds'.format(end_time - start_time)) return response.json() From 96312afaa47fc1b961e31f59467c7858e25cb531 Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Mon, 31 Oct 2022 18:47:43 +0300 Subject: [PATCH 09/15] Final version with flake8 --- homeworks/DDYunin/6/hw_6/__main__.py | 5 +- homeworks/DDYunin/6/hw_6/get_data.py | 31 ++ homeworks/DDYunin/6/hw_6/parser.py | 119 +---- homeworks/DDYunin/6/hw_6/users/1.xml | 201 ++++++++ homeworks/DDYunin/6/hw_6/users/2.xml | 201 ++++++++ homeworks/DDYunin/6/hw_6/users/None.xml | 8 + homeworks/DDYunin/6/hw_6/write_data.py | 83 ++++ homeworks/DDYunin/6/poetry.lock | 611 +++++++++++++++++++++++- homeworks/DDYunin/6/pyproject.toml | 2 + homeworks/DDYunin/6/setup.cfg | 5 + 10 files changed, 1157 insertions(+), 109 deletions(-) create mode 100644 homeworks/DDYunin/6/hw_6/get_data.py create mode 100644 homeworks/DDYunin/6/hw_6/users/1.xml create mode 100644 homeworks/DDYunin/6/hw_6/users/2.xml create mode 100644 homeworks/DDYunin/6/hw_6/users/None.xml create mode 100644 homeworks/DDYunin/6/hw_6/write_data.py create mode 100644 homeworks/DDYunin/6/setup.cfg diff --git a/homeworks/DDYunin/6/hw_6/__main__.py b/homeworks/DDYunin/6/hw_6/__main__.py index 1417de2..75b7614 100644 --- a/homeworks/DDYunin/6/hw_6/__main__.py +++ b/homeworks/DDYunin/6/hw_6/__main__.py @@ -1,7 +1,4 @@ from hw_6.parser import start_parsing -def main(): - start_parsing() - if __name__ == '__main__': - main() \ No newline at end of file + start_parsing() diff --git a/homeworks/DDYunin/6/hw_6/get_data.py b/homeworks/DDYunin/6/hw_6/get_data.py new file mode 100644 index 0000000..7aa7852 --- /dev/null +++ b/homeworks/DDYunin/6/hw_6/get_data.py @@ -0,0 +1,31 @@ +from datetime import datetime + +import requests +from loguru import logger + + +def get_user_data_posts(usr_id): + url = 'https://jsonplaceholder.typicode.com/users/{0}/posts'.format(usr_id) + start_time = datetime.now() + response = requests.get(url) + end_time = datetime.now() + logger.info('The request lasted {0} seconds'.format(end_time - start_time)) + return response.json() + + +def get_user_data_albums(usr_id): + url = 'https://jsonplaceholder.typicode.com/users/{0}/albums'.format(usr_id) + start_time = datetime.now() + response = requests.get(url) + end_time = datetime.now() + logger.info('The request lasted {0} seconds'.format(end_time - start_time)) + return response.json() + + +def get_user_data_todos(usr_id): + url = 'https://jsonplaceholder.typicode.com/users/{0}/todos'.format(usr_id) + start_time = datetime.now() + response = requests.get(url) + end_time = datetime.now() + logger.info('The request lasted {0} seconds'.format(end_time - start_time)) + return response.json() diff --git a/homeworks/DDYunin/6/hw_6/parser.py b/homeworks/DDYunin/6/hw_6/parser.py index 1f54835..4a87c1c 100644 --- a/homeworks/DDYunin/6/hw_6/parser.py +++ b/homeworks/DDYunin/6/hw_6/parser.py @@ -1,18 +1,16 @@ import csv +from datetime import datetime + import requests from loguru import logger -from datetime import datetime -from lxml import etree as et, objectify -import os -import shutil -# Можно ли возвращать значение прямо из контекстного менеджера, не будет ли это плохо? -# В файлах json в тексте содержатся спец симовл \n, в следствии чего текст переносится на новые строки, это надо исправлять или нет? +from hw_6.write_data import write_data_xml # TODO # Добавить логи # Раскидать содержимое модуля на разные модули, ибо слишком много и сложно! + def start_parsing(): all_emails_not_flatten = parse_emails_from_csv_file() # Вытягиваю list of lists в простой list и преобразую его в dict @@ -26,15 +24,17 @@ def start_parsing(): def parse_emails_from_csv_file(): emails = [] start_time = datetime.now() - with open('hw_6/emails_file.csv') as f: - reader = csv.reader(f) + with open('hw_6/emails_file.csv') as csv_file: + reader = csv.reader(csv_file) end_time = datetime.now() - logger.info('The request lasted {0} seconds'.format(end_time - start_time)) + logger.info('Request lasted {0} seconds'.format(end_time - start_time)) emails = list(reader) return emails -def flatten(list_of_emails): - return [item for sublist in list_of_emails for item in sublist] + +def flatten(lst_emails): + return [lst_element for sublist in lst_emails for lst_element in sublist] + def get_data_json(): url = 'https://jsonplaceholder.typicode.com/users/' @@ -44,98 +44,9 @@ def get_data_json(): logger.info('The request lasted {0} seconds'.format(end_time - start_time)) return response.json() + def get_ready_dict_with_emails_and_ids(people_data, emails_ids): - for item in people_data: - if item['email'] in emails_ids: - emails_ids[item['email']] = item["id"] + for person_data in people_data: + if person_data['email'] in emails_ids: + emails_ids[person_data.get('email')] = person_data['id'] return emails_ids - -def write_data_xml(dict_emails_and_ids): - create_catalog_users() - for email in dict_emails_and_ids: - logger.info('Starts parsing for {0}'.format(email)) - xml_struct = create_struct_xml_file(email, dict_emails_and_ids) - xml_struct = add_posts_in_xml_file(xml_struct, email, dict_emails_and_ids) - xml_struct = add_albums_in_xml_file(xml_struct, email, dict_emails_and_ids) - xml_struct = add_todos_in_xml_file(xml_struct, email, dict_emails_and_ids) - save_ready_xml_file(xml_struct, email, dict_emails_and_ids) - -def create_struct_xml_file(user_email, all_data): - struct = et.Element('user') - id_element = et.SubElement(struct, 'id') - id_element.text = '{0}'.format(all_data[user_email]) - email_element = et.SubElement(struct, 'email') - email_element.text = '{0}'.format(user_email) - return struct - -def add_posts_in_xml_file(xml_struct, user_email, all_data): - data_posts = get_user_data_posts(all_data[user_email]) - posts_element = et.SubElement(xml_struct, 'posts') - if not data_posts: - posts_element.text = '' - for post in data_posts: - post_element = et.SubElement(posts_element, 'post') - et.SubElement(post_element, 'id').text = '{0}'.format(post['id']) - et.SubElement(post_element, 'title').text = '{0}'.format(post['title']) - et.SubElement(post_element, 'body').text = '{0}'.format(post['body']).replace('\n', ' ') - return xml_struct - -def add_albums_in_xml_file(xml_struct, user_email, all_data): - data_albums = get_user_data_albums(all_data[user_email]) - albums_element = et.SubElement(xml_struct, 'albums') - if not data_albums: - albums_element.text = '' - for album in data_albums: - album_element = et.SubElement(albums_element, 'album') - et.SubElement(album_element, 'id').text = '{0}'.format(album['id']) - et.SubElement(album_element, 'title').text = '{0}'.format(album['title']) - return xml_struct - -def add_todos_in_xml_file(xml_struct, user_email, all_data): - data_todos = get_user_data_todos(all_data[user_email]) - todos_element = et.SubElement(xml_struct, 'todos') - if not data_todos: - todos_element.text = '' - for todo in data_todos: - todo_element = et.SubElement(todos_element, 'todo') - et.SubElement(todo_element, 'id').text = '{0}'.format(todo['id']) - et.SubElement(todo_element, 'title').text = '{0}'.format(todo['title']) - et.SubElement(todo_element, 'completed').text = '{0}'.format(todo['completed']) - return xml_struct - -def save_ready_xml_file(xml_struct, user_email, all_data): - xml_file = et.ElementTree(xml_struct) - start_time = datetime.now() - with open('hw_6/users/{0}.xml'.format(all_data[user_email]), 'wb') as file: - xml_file.write(file, encoding="UTF-8", pretty_print=True, xml_declaration = True) - end_time = datetime.now() - logger.info('The request lasted {0} seconds'.format(end_time - start_time)) - -def create_catalog_users(): - if os.path.exists("hw_6/users"): - shutil.rmtree("hw_6/users") - os.mkdir("hw_6/users") - -def get_user_data_posts(user_id): - url = 'https://jsonplaceholder.typicode.com/users/{0}/posts'.format(user_id) - start_time = datetime.now() - response = requests.get(url) - end_time = datetime.now() - logger.info('The request lasted {0} seconds'.format(end_time - start_time)) - return response.json() - -def get_user_data_albums(user_id): - url = 'https://jsonplaceholder.typicode.com/users/{0}/albums'.format(user_id) - start_time = datetime.now() - response = requests.get(url) - end_time = datetime.now() - logger.info('The request lasted {0} seconds'.format(end_time - start_time)) - return response.json() - -def get_user_data_todos(user_id): - url = 'https://jsonplaceholder.typicode.com/users/{0}/todos'.format(user_id) - start_time = datetime.now() - response = requests.get(url) - end_time = datetime.now() - logger.info('The request lasted {0} seconds'.format(end_time - start_time)) - return response.json() diff --git a/homeworks/DDYunin/6/hw_6/users/1.xml b/homeworks/DDYunin/6/hw_6/users/1.xml new file mode 100644 index 0000000..a4eecd1 --- /dev/null +++ b/homeworks/DDYunin/6/hw_6/users/1.xml @@ -0,0 +1,201 @@ + + + 1 + Sincere@april.biz + + + 1 + sunt aut facere repellat provident occaecati excepturi optio reprehenderit + quia et suscipit suscipit recusandae consequuntur expedita et cum reprehenderit molestiae ut ut quas totam nostrum rerum est autem sunt rem eveniet architecto + + + 2 + qui est esse + est rerum tempore vitae sequi sint nihil reprehenderit dolor beatae ea dolores neque fugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis qui aperiam non debitis possimus qui neque nisi nulla + + + 3 + ea molestias quasi exercitationem repellat qui ipsa sit aut + et iusto sed quo iure voluptatem occaecati omnis eligendi aut ad voluptatem doloribus vel accusantium quis pariatur molestiae porro eius odio et labore et velit aut + + + 4 + eum et est occaecati + ullam et saepe reiciendis voluptatem adipisci sit amet autem assumenda provident rerum culpa quis hic commodi nesciunt rem tenetur doloremque ipsam iure quis sunt voluptatem rerum illo velit + + + 5 + nesciunt quas odio + repudiandae veniam quaerat sunt sed alias aut fugiat sit autem sed est voluptatem omnis possimus esse voluptatibus quis est aut tenetur dolor neque + + + 6 + dolorem eum magni eos aperiam quia + ut aspernatur corporis harum nihil quis provident sequi mollitia nobis aliquid molestiae perspiciatis et ea nemo ab reprehenderit accusantium quas voluptate dolores velit et doloremque molestiae + + + 7 + magnam facilis autem + dolore placeat quibusdam ea quo vitae magni quis enim qui quis quo nemo aut saepe quidem repellat excepturi ut quia sunt ut sequi eos ea sed quas + + + 8 + dolorem dolore est ipsam + dignissimos aperiam dolorem qui eum facilis quibusdam animi sint suscipit qui sint possimus cum quaerat magni maiores excepturi ipsam ut commodi dolor voluptatum modi aut vitae + + + 9 + nesciunt iure omnis dolorem tempora et accusantium + consectetur animi nesciunt iure dolore enim quia ad veniam autem ut quam aut nobis et est aut quod aut provident voluptas autem voluptas + + + 10 + optio molestias id quia eum + quo et expedita modi cum officia vel magni doloribus qui repudiandae vero nisi sit quos veniam quod sed accusamus veritatis error + + + + + 1 + quidem molestiae enim + + + 2 + sunt qui excepturi placeat culpa + + + 3 + omnis laborum odio + + + 4 + non esse culpa molestiae omnis sed optio + + + 5 + eaque aut omnis a + + + 6 + natus impedit quibusdam illo est + + + 7 + quibusdam autem aliquid et et quia + + + 8 + qui fuga est a eum + + + 9 + saepe unde necessitatibus rem + + + 10 + distinctio laborum qui + + + + + 1 + delectus aut autem + False + + + 2 + quis ut nam facilis et officia qui + False + + + 3 + fugiat veniam minus + False + + + 4 + et porro tempora + True + + + 5 + laboriosam mollitia et enim quasi adipisci quia provident illum + False + + + 6 + qui ullam ratione quibusdam voluptatem quia omnis + False + + + 7 + illo expedita consequatur quia in + False + + + 8 + quo adipisci enim quam ut ab + True + + + 9 + molestiae perspiciatis ipsa + False + + + 10 + illo est ratione doloremque quia maiores aut + True + + + 11 + vero rerum temporibus dolor + True + + + 12 + ipsa repellendus fugit nisi + True + + + 13 + et doloremque nulla + False + + + 14 + repellendus sunt dolores architecto voluptatum + True + + + 15 + ab voluptatum amet voluptas + True + + + 16 + accusamus eos facilis sint et aut voluptatem + True + + + 17 + quo laboriosam deleniti aut qui + True + + + 18 + dolorum est consequatur ea mollitia in culpa + False + + + 19 + molestiae ipsa aut voluptatibus pariatur dolor nihil + True + + + 20 + ullam nobis libero sapiente ad optio sint + True + + + diff --git a/homeworks/DDYunin/6/hw_6/users/2.xml b/homeworks/DDYunin/6/hw_6/users/2.xml new file mode 100644 index 0000000..4c84833 --- /dev/null +++ b/homeworks/DDYunin/6/hw_6/users/2.xml @@ -0,0 +1,201 @@ + + + 2 + Shanna@melissa.tv + + + 11 + et ea vero quia laudantium autem + delectus reiciendis molestiae occaecati non minima eveniet qui voluptatibus accusamus in eum beatae sit vel qui neque voluptates ut commodi qui incidunt ut animi commodi + + + 12 + in quibusdam tempore odit est dolorem + itaque id aut magnam praesentium quia et ea odit et ea voluptas et sapiente quia nihil amet occaecati quia id voluptatem incidunt ea est distinctio odio + + + 13 + dolorum ut in voluptas mollitia et saepe quo animi + aut dicta possimus sint mollitia voluptas commodi quo doloremque iste corrupti reiciendis voluptatem eius rerum sit cumque quod eligendi laborum minima perferendis recusandae assumenda consectetur porro architecto ipsum ipsam + + + 14 + voluptatem eligendi optio + fuga et accusamus dolorum perferendis illo voluptas non doloremque neque facere ad qui dolorum molestiae beatae sed aut voluptas totam sit illum + + + 15 + eveniet quod temporibus + reprehenderit quos placeat velit minima officia dolores impedit repudiandae molestiae nam voluptas recusandae quis delectus officiis harum fugiat vitae + + + 16 + sint suscipit perspiciatis velit dolorum rerum ipsa laboriosam odio + suscipit nam nisi quo aperiam aut asperiores eos fugit maiores voluptatibus quia voluptatem quis ullam qui in alias quia est consequatur magni mollitia accusamus ea nisi voluptate dicta + + + 17 + fugit voluptas sed molestias voluptatem provident + eos voluptas et aut odit natus earum aspernatur fuga molestiae ullam deserunt ratione qui eos qui nihil ratione nemo velit ut aut id quo + + + 18 + voluptate et itaque vero tempora molestiae + eveniet quo quis laborum totam consequatur non dolor ut et est repudiandae est voluptatem vel debitis et magnam + + + 19 + adipisci placeat illum aut reiciendis qui + illum quis cupiditate provident sit magnam ea sed aut omnis veniam maiores ullam consequatur atque adipisci quo iste expedita sit quos voluptas + + + 20 + doloribus ad provident suscipit at + qui consequuntur ducimus possimus quisquam amet similique suscipit porro ipsam amet eos veritatis officiis exercitationem vel fugit aut necessitatibus totam omnis rerum consequatur expedita quidem cumque explicabo + + + + + 11 + quam nostrum impedit mollitia quod et dolor + + + 12 + consequatur autem doloribus natus consectetur + + + 13 + ab rerum non rerum consequatur ut ea unde + + + 14 + ducimus molestias eos animi atque nihil + + + 15 + ut pariatur rerum ipsum natus repellendus praesentium + + + 16 + voluptatem aut maxime inventore autem magnam atque repellat + + + 17 + aut minima voluptatem ut velit + + + 18 + nesciunt quia et doloremque + + + 19 + velit pariatur quaerat similique libero omnis quia + + + 20 + voluptas rerum iure ut enim + + + + + 21 + suscipit repellat esse quibusdam voluptatem incidunt + False + + + 22 + distinctio vitae autem nihil ut molestias quo + True + + + 23 + et itaque necessitatibus maxime molestiae qui quas velit + False + + + 24 + adipisci non ad dicta qui amet quaerat doloribus ea + False + + + 25 + voluptas quo tenetur perspiciatis explicabo natus + True + + + 26 + aliquam aut quasi + True + + + 27 + veritatis pariatur delectus + True + + + 28 + nesciunt totam sit blanditiis sit + False + + + 29 + laborum aut in quam + False + + + 30 + nemo perspiciatis repellat ut dolor libero commodi blanditiis omnis + True + + + 31 + repudiandae totam in est sint facere fuga + False + + + 32 + earum doloribus ea doloremque quis + False + + + 33 + sint sit aut vero + False + + + 34 + porro aut necessitatibus eaque distinctio + False + + + 35 + repellendus veritatis molestias dicta incidunt + True + + + 36 + excepturi deleniti adipisci voluptatem et neque optio illum ad + True + + + 37 + sunt cum tempora + False + + + 38 + totam quia non + False + + + 39 + doloremque quibusdam asperiores libero corrupti illum qui omnis + False + + + 40 + totam atque quo nesciunt + True + + + diff --git a/homeworks/DDYunin/6/hw_6/users/None.xml b/homeworks/DDYunin/6/hw_6/users/None.xml new file mode 100644 index 0000000..767ed13 --- /dev/null +++ b/homeworks/DDYunin/6/hw_6/users/None.xml @@ -0,0 +1,8 @@ + + + None + anastasia.net + + + + diff --git a/homeworks/DDYunin/6/hw_6/write_data.py b/homeworks/DDYunin/6/hw_6/write_data.py new file mode 100644 index 0000000..ba31396 --- /dev/null +++ b/homeworks/DDYunin/6/hw_6/write_data.py @@ -0,0 +1,83 @@ +import os +import shutil +from datetime import datetime + +from loguru import logger +from lxml import etree as et + +from hw_6.get_data import (get_user_data_albums, get_user_data_posts, + get_user_data_todos) + + +def write_data_xml(emails_and_ids): + create_catalog_users() + for email in emails_and_ids: + logger.info('Starts parsing for {0}'.format(email)) + xml_struct = create_struct_xml_file(email, emails_and_ids) + xml_struct = add_posts_in_xml_file(xml_struct, email, emails_and_ids) + xml_struct = add_albums_in_xml_file(xml_struct, email, emails_and_ids) + xml_struct = add_todos_in_xml_file(xml_struct, email, emails_and_ids) + save_ready_xml_file(xml_struct, email, emails_and_ids) + + +def create_struct_xml_file(user_email, all_data): + struct = et.Element('user') + id_element = et.SubElement(struct, 'id') + id_element.text = '{0}'.format(all_data[user_email]) + email_element = et.SubElement(struct, 'email') + email_element.text = '{0}'.format(user_email) + return struct + + +def add_posts_in_xml_file(xml_struct, user_email, all_data): + data_posts = get_user_data_posts(all_data[user_email]) + posts_element = et.SubElement(xml_struct, 'posts') + if not data_posts: + posts_element.text = '' + for post in data_posts: + post_element = et.SubElement(posts_element, 'post') + et.SubElement(post_element, 'id').text = '{0}'.format(post['id']) + et.SubElement(post_element, 'title').text = '{0}'.format(post['title']) + str_body = '{0}'.format(post['body']) + et.SubElement(post_element, 'body').text = str_body.replace('\n', ' ') + return xml_struct + + +def add_albums_in_xml_file(xml_struct, user_email, all_data): + data_albums = get_user_data_albums(all_data[user_email]) + albums_element = et.SubElement(xml_struct, 'albums') + if not data_albums: + albums_element.text = '' + for album in data_albums: + album_element = et.SubElement(albums_element, 'album') + et.SubElement(album_element, 'id').text = '{0}'.format(album['id']) + et.SubElement(album_element, 'title').text = '{0}'.format(album['title']) + return xml_struct + + +def add_todos_in_xml_file(xml_struct, user_email, all_data): + data_todos = get_user_data_todos(all_data[user_email]) + todos_element = et.SubElement(xml_struct, 'todos') + if not data_todos: + todos_element.text = '' + for todo in data_todos: + todo_element = et.SubElement(todos_element, 'todo') + et.SubElement(todo_element, 'id').text = '{0}'.format(todo['id']) + et.SubElement(todo_element, 'title').text = '{0}'.format(todo['title']) + et.SubElement(todo_element, 'completed').text = '{0}'.format(todo['completed']) + return xml_struct + + +def save_ready_xml_file(xml_struct, user_email, all_data): + xml_file = et.ElementTree(xml_struct) + start_time = datetime.now() + with open('hw_6/users/{0}.xml'.format(all_data[user_email]), 'wb') as xml_fl: + xml_file.write(xml_fl, encoding='UTF-8', pretty_print=True, xml_declaration=True) + end_time = datetime.now() + logger.info('The request lasted {0} seconds'.format(end_time - start_time)) + + +def create_catalog_users(): + if os.path.exists('hw_6/users'): + shutil.rmtree('hw_6/users') + os.mkdir('hw_6/users') diff --git a/homeworks/DDYunin/6/poetry.lock b/homeworks/DDYunin/6/poetry.lock index 5daa4b0..35b8fef 100644 --- a/homeworks/DDYunin/6/poetry.lock +++ b/homeworks/DDYunin/6/poetry.lock @@ -1,3 +1,44 @@ +[[package]] +name = "astor" +version = "0.8.1" +description = "Read/rewrite/write Python ASTs" +category = "main" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" + +[[package]] +name = "attrs" +version = "22.1.0" +description = "Classes Without Boilerplate" +category = "main" +optional = false +python-versions = ">=3.5" + +[package.extras] +dev = ["cloudpickle", "coverage[toml] (>=5.0.2)", "furo", "hypothesis", "mypy (>=0.900,!=0.940)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "sphinx", "sphinx-notfound-page", "zope.interface"] +docs = ["furo", "sphinx", "sphinx-notfound-page", "zope.interface"] +tests = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "zope.interface"] +tests-no-zope = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins"] + +[[package]] +name = "bandit" +version = "1.7.4" +description = "Security oriented static analyser for python code." +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +colorama = {version = ">=0.3.9", markers = "platform_system == \"Windows\""} +GitPython = ">=1.0.1" +PyYAML = ">=5.3.1" +stevedore = ">=1.20.0" + +[package.extras] +test = ["beautifulsoup4 (>=4.8.0)", "coverage (>=4.5.4)", "fixtures (>=3.0.0)", "flake8 (>=4.0.0)", "pylint (==1.9.4)", "stestr (>=2.5.0)", "testscenarios (>=0.5.0)", "testtools (>=2.3.0)", "toml"] +toml = ["toml"] +yaml = ["PyYAML"] + [[package]] name = "certifi" version = "2022.9.24" @@ -25,6 +66,225 @@ category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +[[package]] +name = "darglint" +version = "1.8.1" +description = "A utility for ensuring Google-style docstrings stay up to date with the source code." +category = "main" +optional = false +python-versions = ">=3.6,<4.0" + +[[package]] +name = "docutils" +version = "0.19" +description = "Docutils -- Python Documentation Utilities" +category = "main" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "eradicate" +version = "2.1.0" +description = "Removes commented-out code." +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "flake8" +version = "4.0.1" +description = "the modular source code checker: pep8 pyflakes and co" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +mccabe = ">=0.6.0,<0.7.0" +pycodestyle = ">=2.8.0,<2.9.0" +pyflakes = ">=2.4.0,<2.5.0" + +[[package]] +name = "flake8-bandit" +version = "3.0.0" +description = "Automated security testing with bandit and flake8." +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +bandit = ">=1.7.3" +flake8 = "*" +flake8-polyfill = "*" +pycodestyle = "*" + +[[package]] +name = "flake8-broken-line" +version = "0.5.0" +description = "Flake8 plugin to forbid backslashes for line breaks" +category = "main" +optional = false +python-versions = ">=3.6,<4.0" + +[package.dependencies] +flake8 = ">=3.5,<6" + +[[package]] +name = "flake8-bugbear" +version = "22.10.27" +description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle." +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +attrs = ">=19.2.0" +flake8 = ">=3.0.0" + +[package.extras] +dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit", "tox"] + +[[package]] +name = "flake8-commas" +version = "2.1.0" +description = "Flake8 lint for trailing commas." +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +flake8 = ">=2" + +[[package]] +name = "flake8-comprehensions" +version = "3.10.0" +description = "A flake8 plugin to help you write better list/set/dict comprehensions." +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +flake8 = ">=3.0,<3.2.0 || >3.2.0" + +[[package]] +name = "flake8-debugger" +version = "4.1.2" +description = "ipdb/pdb statement checker plugin for flake8" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +flake8 = ">=3.0" +pycodestyle = "*" + +[[package]] +name = "flake8-docstrings" +version = "1.6.0" +description = "Extension for flake8 which uses pydocstyle to check docstrings" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +flake8 = ">=3" +pydocstyle = ">=2.1" + +[[package]] +name = "flake8-eradicate" +version = "1.4.0" +description = "Flake8 plugin to find commented out code" +category = "main" +optional = false +python-versions = ">=3.7,<4.0" + +[package.dependencies] +attrs = "*" +eradicate = ">=2.0,<3.0" +flake8 = ">=3.5,<6" + +[[package]] +name = "flake8-isort" +version = "4.2.0" +description = "flake8 plugin that integrates isort ." +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +flake8 = ">=3.2.1,<6" +isort = ">=4.3.5,<6" + +[package.extras] +test = ["pytest-cov"] + +[[package]] +name = "flake8-polyfill" +version = "1.0.2" +description = "Polyfill package for Flake8 plugins" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +flake8 = "*" + +[[package]] +name = "flake8-quotes" +version = "3.3.1" +description = "Flake8 lint for quotes." +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +flake8 = "*" + +[[package]] +name = "flake8-rst-docstrings" +version = "0.2.7" +description = "Python docstring reStructuredText (RST) validator" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +flake8 = ">=3.0.0" +pygments = "*" +restructuredtext-lint = "*" + +[[package]] +name = "flake8-string-format" +version = "0.3.0" +description = "string format checker, plugin for flake8" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +flake8 = "*" + +[[package]] +name = "gitdb" +version = "4.0.9" +description = "Git Object Database" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +smmap = ">=3.0.1,<6" + +[[package]] +name = "gitpython" +version = "3.1.29" +description = "GitPython is a python library used to interact with Git repositories" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +gitdb = ">=4.0.1,<5" + [[package]] name = "idna" version = "3.4" @@ -33,6 +293,20 @@ category = "main" optional = false python-versions = ">=3.5" +[[package]] +name = "isort" +version = "5.10.1" +description = "A Python utility / library to sort Python imports." +category = "main" +optional = false +python-versions = ">=3.6.1,<4.0" + +[package.extras] +colors = ["colorama (>=0.4.3,<0.5.0)"] +pipfile-deprecated-finder = ["pipreqs", "requirementslib"] +plugins = ["setuptools"] +requirements-deprecated-finder = ["pip-api", "pipreqs"] + [[package]] name = "loguru" version = "0.6.0" @@ -62,6 +336,82 @@ html5 = ["html5lib"] htmlsoup = ["BeautifulSoup4"] source = ["Cython (>=0.29.7)"] +[[package]] +name = "mccabe" +version = "0.6.1" +description = "McCabe checker, plugin for flake8" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "pbr" +version = "5.11.0" +description = "Python Build Reasonableness" +category = "main" +optional = false +python-versions = ">=2.6" + +[[package]] +name = "pep8-naming" +version = "0.13.2" +description = "Check PEP-8 naming conventions, plugin for flake8" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +flake8 = ">=3.9.1" + +[[package]] +name = "pycodestyle" +version = "2.8.0" +description = "Python style guide checker" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "pydocstyle" +version = "6.1.1" +description = "Python docstring style checker" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +snowballstemmer = "*" + +[package.extras] +toml = ["toml"] + +[[package]] +name = "pyflakes" +version = "2.4.0" +description = "passive checker of Python programs" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "pygments" +version = "2.13.0" +description = "Pygments is a syntax highlighting package written in Python." +category = "main" +optional = false +python-versions = ">=3.6" + +[package.extras] +plugins = ["importlib-metadata"] + +[[package]] +name = "pyyaml" +version = "6.0" +description = "YAML parser and emitter for Python" +category = "main" +optional = false +python-versions = ">=3.6" + [[package]] name = "requests" version = "2.28.1" @@ -80,6 +430,52 @@ urllib3 = ">=1.21.1,<1.27" socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] +[[package]] +name = "restructuredtext-lint" +version = "1.4.0" +description = "reStructuredText linter" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +docutils = ">=0.11,<1.0" + +[[package]] +name = "smmap" +version = "5.0.0" +description = "A pure Python implementation of a sliding window memory map manager" +category = "main" +optional = false +python-versions = ">=3.6" + +[[package]] +name = "snowballstemmer" +version = "2.2.0" +description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "stevedore" +version = "4.1.0" +description = "Manage dynamic plugins for Python applications" +category = "main" +optional = false +python-versions = ">=3.8" + +[package.dependencies] +pbr = ">=2.0.0,<2.1.0 || >2.1.0" + +[[package]] +name = "typing-extensions" +version = "4.4.0" +description = "Backported and Experimental Type Hints for Python 3.7+" +category = "main" +optional = false +python-versions = ">=3.7" + [[package]] name = "urllib3" version = "1.26.12" @@ -93,6 +489,35 @@ brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] +[[package]] +name = "wemake-python-styleguide" +version = "0.17.0" +description = "The strictest and most opinionated python linter ever" +category = "main" +optional = false +python-versions = ">=3.7,<4.0" + +[package.dependencies] +astor = ">=0.8,<0.9" +attrs = "*" +darglint = ">=1.2,<2.0" +flake8 = ">=3.7,<5" +flake8-bandit = ">=2.1,<4" +flake8-broken-line = ">=0.5,<0.6" +flake8-bugbear = ">=22.9,<23.0" +flake8-commas = ">=2.0,<3.0" +flake8-comprehensions = ">=3.1,<4.0" +flake8-debugger = ">=4.0,<5.0" +flake8-docstrings = ">=1.3,<2.0" +flake8-eradicate = ">=1.0,<2.0" +flake8-isort = ">=4.0,<5.0" +flake8-quotes = ">=3.0,<4.0" +flake8-rst-docstrings = ">=0.2,<0.3" +flake8-string-format = ">=0.3,<0.4" +pep8-naming = ">=0.13,<0.14" +pygments = ">=2.4,<3.0" +typing_extensions = ">=4.0,<5.0" + [[package]] name = "win32-setctime" version = "1.1.0" @@ -107,9 +532,21 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "1.1" python-versions = "^3.10" -content-hash = "23d1213d8dfaa705892116ee5ed3506a1e2f20bce65b4ce8d413639e1210fcf8" +content-hash = "3927187d50882db68bbb0bca034651a4c510b975bc059c22eb1ed4331cbf5f24" [metadata.files] +astor = [ + {file = "astor-0.8.1-py2.py3-none-any.whl", hash = "sha256:070a54e890cefb5b3739d19f30f5a5ec840ffc9c50ffa7d23cc9fc1a38ebbfc5"}, + {file = "astor-0.8.1.tar.gz", hash = "sha256:6a6effda93f4e1ce9f618779b2dd1d9d84f1e32812c23a29b3fff6fd7f63fa5e"}, +] +attrs = [ + {file = "attrs-22.1.0-py2.py3-none-any.whl", hash = "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c"}, + {file = "attrs-22.1.0.tar.gz", hash = "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"}, +] +bandit = [ + {file = "bandit-1.7.4-py3-none-any.whl", hash = "sha256:412d3f259dab4077d0e7f0c11f50f650cc7d10db905d98f6520a95a18049658a"}, + {file = "bandit-1.7.4.tar.gz", hash = "sha256:2d63a8c573417bae338962d4b9b06fbc6080f74ecd955a092849e1e65c717bd2"}, +] certifi = [ {file = "certifi-2022.9.24-py3-none-any.whl", hash = "sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382"}, {file = "certifi-2022.9.24.tar.gz", hash = "sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14"}, @@ -122,10 +559,89 @@ colorama = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +darglint = [ + {file = "darglint-1.8.1-py3-none-any.whl", hash = "sha256:5ae11c259c17b0701618a20c3da343a3eb98b3bc4b5a83d31cdd94f5ebdced8d"}, + {file = "darglint-1.8.1.tar.gz", hash = "sha256:080d5106df149b199822e7ee7deb9c012b49891538f14a11be681044f0bb20da"}, +] +docutils = [ + {file = "docutils-0.19-py3-none-any.whl", hash = "sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc"}, + {file = "docutils-0.19.tar.gz", hash = "sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6"}, +] +eradicate = [ + {file = "eradicate-2.1.0-py3-none-any.whl", hash = "sha256:8bfaca181db9227dc88bdbce4d051a9627604c2243e7d85324f6d6ce0fd08bb2"}, + {file = "eradicate-2.1.0.tar.gz", hash = "sha256:aac7384ab25b1bf21c4c012de9b4bf8398945a14c98c911545b2ea50ab558014"}, +] +flake8 = [ + {file = "flake8-4.0.1-py2.py3-none-any.whl", hash = "sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d"}, + {file = "flake8-4.0.1.tar.gz", hash = "sha256:806e034dda44114815e23c16ef92f95c91e4c71100ff52813adf7132a6ad870d"}, +] +flake8-bandit = [ + {file = "flake8_bandit-3.0.0-py2.py3-none-any.whl", hash = "sha256:61b617f4f7cdaa0e2b1e6bf7b68afb2b619a227bb3e3ae00dd36c213bd17900a"}, + {file = "flake8_bandit-3.0.0.tar.gz", hash = "sha256:54d19427e6a8d50322a7b02e1841c0a7c22d856975f3459803320e0e18e2d6a1"}, +] +flake8-broken-line = [ + {file = "flake8-broken-line-0.5.0.tar.gz", hash = "sha256:7c98de9dd1385b71e888709c7f2aee3f0514107ecb5875bc95d0c03392191c97"}, + {file = "flake8_broken_line-0.5.0-py3-none-any.whl", hash = "sha256:daafb19b67eead0410ce7ba155d51a15b9d020ebe7630d87de9c2b93cedb6703"}, +] +flake8-bugbear = [ + {file = "flake8-bugbear-22.10.27.tar.gz", hash = "sha256:a6708608965c9e0de5fff13904fed82e0ba21ac929fe4896459226a797e11cd5"}, + {file = "flake8_bugbear-22.10.27-py3-none-any.whl", hash = "sha256:6ad0ab754507319060695e2f2be80e6d8977cfcea082293089a9226276bd825d"}, +] +flake8-commas = [ + {file = "flake8-commas-2.1.0.tar.gz", hash = "sha256:940441ab8ee544df564ae3b3f49f20462d75d5c7cac2463e0b27436e2050f263"}, + {file = "flake8_commas-2.1.0-py2.py3-none-any.whl", hash = "sha256:ebb96c31e01d0ef1d0685a21f3f0e2f8153a0381430e748bf0bbbb5d5b453d54"}, +] +flake8-comprehensions = [ + {file = "flake8-comprehensions-3.10.0.tar.gz", hash = "sha256:181158f7e7aa26a63a0a38e6017cef28c6adee71278ce56ce11f6ec9c4905058"}, + {file = "flake8_comprehensions-3.10.0-py3-none-any.whl", hash = "sha256:dad454fd3d525039121e98fa1dd90c46bc138708196a4ebbc949ad3c859adedb"}, +] +flake8-debugger = [ + {file = "flake8-debugger-4.1.2.tar.gz", hash = "sha256:52b002560941e36d9bf806fca2523dc7fb8560a295d5f1a6e15ac2ded7a73840"}, + {file = "flake8_debugger-4.1.2-py3-none-any.whl", hash = "sha256:0a5e55aeddcc81da631ad9c8c366e7318998f83ff00985a49e6b3ecf61e571bf"}, +] +flake8-docstrings = [ + {file = "flake8-docstrings-1.6.0.tar.gz", hash = "sha256:9fe7c6a306064af8e62a055c2f61e9eb1da55f84bb39caef2b84ce53708ac34b"}, + {file = "flake8_docstrings-1.6.0-py2.py3-none-any.whl", hash = "sha256:99cac583d6c7e32dd28bbfbef120a7c0d1b6dde4adb5a9fd441c4227a6534bde"}, +] +flake8-eradicate = [ + {file = "flake8-eradicate-1.4.0.tar.gz", hash = "sha256:3088cfd6717d1c9c6c3ac45ef2e5f5b6c7267f7504d5a74b781500e95cb9c7e1"}, + {file = "flake8_eradicate-1.4.0-py3-none-any.whl", hash = "sha256:e3bbd0871be358e908053c1ab728903c114f062ba596b4d40c852fd18f473d56"}, +] +flake8-isort = [ + {file = "flake8-isort-4.2.0.tar.gz", hash = "sha256:26571500cd54976bbc0cf1006ffbcd1a68dd102f816b7a1051b219616ba9fee0"}, + {file = "flake8_isort-4.2.0-py3-none-any.whl", hash = "sha256:5b87630fb3719bf4c1833fd11e0d9534f43efdeba524863e15d8f14a7ef6adbf"}, +] +flake8-polyfill = [ + {file = "flake8-polyfill-1.0.2.tar.gz", hash = "sha256:e44b087597f6da52ec6393a709e7108b2905317d0c0b744cdca6208e670d8eda"}, + {file = "flake8_polyfill-1.0.2-py2.py3-none-any.whl", hash = "sha256:12be6a34ee3ab795b19ca73505e7b55826d5f6ad7230d31b18e106400169b9e9"}, +] +flake8-quotes = [ + {file = "flake8-quotes-3.3.1.tar.gz", hash = "sha256:633adca6fb8a08131536af0d750b44d6985b9aba46f498871e21588c3e6f525a"}, +] +flake8-rst-docstrings = [ + {file = "flake8-rst-docstrings-0.2.7.tar.gz", hash = "sha256:2740067ab9237559dd45a3434d8c987792c7b259ca563621a3b95efe201f5382"}, + {file = "flake8_rst_docstrings-0.2.7-py3-none-any.whl", hash = "sha256:5d56075dce360bcc9c6775bfe7cb431aa395de600ca7e8d40580a28d50b2a803"}, +] +flake8-string-format = [ + {file = "flake8-string-format-0.3.0.tar.gz", hash = "sha256:65f3da786a1461ef77fca3780b314edb2853c377f2e35069723348c8917deaa2"}, + {file = "flake8_string_format-0.3.0-py2.py3-none-any.whl", hash = "sha256:812ff431f10576a74c89be4e85b8e075a705be39bc40c4b4278b5b13e2afa9af"}, +] +gitdb = [ + {file = "gitdb-4.0.9-py3-none-any.whl", hash = "sha256:8033ad4e853066ba6ca92050b9df2f89301b8fc8bf7e9324d412a63f8bf1a8fd"}, + {file = "gitdb-4.0.9.tar.gz", hash = "sha256:bac2fd45c0a1c9cf619e63a90d62bdc63892ef92387424b855792a6cabe789aa"}, +] +gitpython = [ + {file = "GitPython-3.1.29-py3-none-any.whl", hash = "sha256:41eea0deec2deea139b459ac03656f0dd28fc4a3387240ec1d3c259a2c47850f"}, + {file = "GitPython-3.1.29.tar.gz", hash = "sha256:cc36bfc4a3f913e66805a28e84703e419d9c264c1077e537b54f0e1af85dbefd"}, +] idna = [ {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, ] +isort = [ + {file = "isort-5.10.1-py3-none-any.whl", hash = "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7"}, + {file = "isort-5.10.1.tar.gz", hash = "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"}, +] loguru = [ {file = "loguru-0.6.0-py3-none-any.whl", hash = "sha256:4e2414d534a2ab57573365b3e6d0234dfb1d84b68b7f3b948e6fb743860a77c3"}, {file = "loguru-0.6.0.tar.gz", hash = "sha256:066bd06758d0a513e9836fd9c6b5a75bfb3fd36841f4b996bc60b547a309d41c"}, @@ -202,14 +718,107 @@ lxml = [ {file = "lxml-4.9.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:287605bede6bd36e930577c5925fcea17cb30453d96a7b4c63c14a257118dbb9"}, {file = "lxml-4.9.1.tar.gz", hash = "sha256:fe749b052bb7233fe5d072fcb549221a8cb1a16725c47c37e42b0b9cb3ff2c3f"}, ] +mccabe = [ + {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, + {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, +] +pbr = [ + {file = "pbr-5.11.0-py2.py3-none-any.whl", hash = "sha256:db2317ff07c84c4c63648c9064a79fe9d9f5c7ce85a9099d4b6258b3db83225a"}, + {file = "pbr-5.11.0.tar.gz", hash = "sha256:b97bc6695b2aff02144133c2e7399d5885223d42b7912ffaec2ca3898e673bfe"}, +] +pep8-naming = [ + {file = "pep8-naming-0.13.2.tar.gz", hash = "sha256:93eef62f525fd12a6f8c98f4dcc17fa70baae2f37fa1f73bec00e3e44392fa48"}, + {file = "pep8_naming-0.13.2-py3-none-any.whl", hash = "sha256:59e29e55c478db69cffbe14ab24b5bd2cd615c0413edf790d47d3fb7ba9a4e23"}, +] +pycodestyle = [ + {file = "pycodestyle-2.8.0-py2.py3-none-any.whl", hash = "sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20"}, + {file = "pycodestyle-2.8.0.tar.gz", hash = "sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f"}, +] +pydocstyle = [ + {file = "pydocstyle-6.1.1-py3-none-any.whl", hash = "sha256:6987826d6775056839940041beef5c08cc7e3d71d63149b48e36727f70144dc4"}, + {file = "pydocstyle-6.1.1.tar.gz", hash = "sha256:1d41b7c459ba0ee6c345f2eb9ae827cab14a7533a88c5c6f7e94923f72df92dc"}, +] +pyflakes = [ + {file = "pyflakes-2.4.0-py2.py3-none-any.whl", hash = "sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e"}, + {file = "pyflakes-2.4.0.tar.gz", hash = "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c"}, +] +pygments = [ + {file = "Pygments-2.13.0-py3-none-any.whl", hash = "sha256:f643f331ab57ba3c9d89212ee4a2dabc6e94f117cf4eefde99a0574720d14c42"}, + {file = "Pygments-2.13.0.tar.gz", hash = "sha256:56a8508ae95f98e2b9bdf93a6be5ae3f7d8af858b43e02c5a2ff083726be40c1"}, +] +pyyaml = [ + {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, + {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"}, + {file = "PyYAML-6.0-cp310-cp310-win32.whl", hash = "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513"}, + {file = "PyYAML-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a"}, + {file = "PyYAML-6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d4b0ba9512519522b118090257be113b9468d804b19d63c71dbcf4a48fa32358"}, + {file = "PyYAML-6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:81957921f441d50af23654aa6c5e5eaf9b06aba7f0a19c18a538dc7ef291c5a1"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:afa17f5bc4d1b10afd4466fd3a44dc0e245382deca5b3c353d8b757f9e3ecb8d"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:432557aa2c09802be39460360ddffd48156e30721f5e8d917f01d31694216782"}, + {file = "PyYAML-6.0-cp311-cp311-win32.whl", hash = "sha256:bfaef573a63ba8923503d27530362590ff4f576c626d86a9fed95822a8255fd7"}, + {file = "PyYAML-6.0-cp311-cp311-win_amd64.whl", hash = "sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf"}, + {file = "PyYAML-6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4"}, + {file = "PyYAML-6.0-cp36-cp36m-win32.whl", hash = "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293"}, + {file = "PyYAML-6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57"}, + {file = "PyYAML-6.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9"}, + {file = "PyYAML-6.0-cp37-cp37m-win32.whl", hash = "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737"}, + {file = "PyYAML-6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d"}, + {file = "PyYAML-6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287"}, + {file = "PyYAML-6.0-cp38-cp38-win32.whl", hash = "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78"}, + {file = "PyYAML-6.0-cp38-cp38-win_amd64.whl", hash = "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0"}, + {file = "PyYAML-6.0-cp39-cp39-win32.whl", hash = "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb"}, + {file = "PyYAML-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c"}, + {file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"}, +] requests = [ {file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"}, {file = "requests-2.28.1.tar.gz", hash = "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"}, ] +restructuredtext-lint = [ + {file = "restructuredtext_lint-1.4.0.tar.gz", hash = "sha256:1b235c0c922341ab6c530390892eb9e92f90b9b75046063e047cacfb0f050c45"}, +] +smmap = [ + {file = "smmap-5.0.0-py3-none-any.whl", hash = "sha256:2aba19d6a040e78d8b09de5c57e96207b09ed71d8e55ce0959eeee6c8e190d94"}, + {file = "smmap-5.0.0.tar.gz", hash = "sha256:c840e62059cd3be204b0c9c9f74be2c09d5648eddd4580d9314c3ecde0b30936"}, +] +snowballstemmer = [ + {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, + {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, +] +stevedore = [ + {file = "stevedore-4.1.0-py3-none-any.whl", hash = "sha256:3b1cbd592a87315f000d05164941ee5e164899f8fc0ce9a00bb0f321f40ef93e"}, + {file = "stevedore-4.1.0.tar.gz", hash = "sha256:02518a8f0d6d29be8a445b7f2ac63753ff29e8f2a2faa01777568d5500d777a6"}, +] +typing-extensions = [ + {file = "typing_extensions-4.4.0-py3-none-any.whl", hash = "sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e"}, + {file = "typing_extensions-4.4.0.tar.gz", hash = "sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa"}, +] urllib3 = [ {file = "urllib3-1.26.12-py2.py3-none-any.whl", hash = "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997"}, {file = "urllib3-1.26.12.tar.gz", hash = "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"}, ] +wemake-python-styleguide = [ + {file = "wemake-python-styleguide-0.17.0.tar.gz", hash = "sha256:c8869fac392019c2bb3eae4287399245d10d2726b23f1b3c68d1564909c3a71a"}, + {file = "wemake_python_styleguide-0.17.0-py3-none-any.whl", hash = "sha256:d10b953bbe4fba83a34f4c224a0e1849ede89e486eacfc760690e6c87a28eaae"}, +] win32-setctime = [ {file = "win32_setctime-1.1.0-py3-none-any.whl", hash = "sha256:231db239e959c2fe7eb1d7dc129f11172354f98361c4fa2d6d2d7e278baa8aad"}, {file = "win32_setctime-1.1.0.tar.gz", hash = "sha256:15cf5750465118d6929ae4de4eb46e8edae9a5634350c01ba582df868e932cb2"}, diff --git a/homeworks/DDYunin/6/pyproject.toml b/homeworks/DDYunin/6/pyproject.toml index d6da07c..85b2ca1 100644 --- a/homeworks/DDYunin/6/pyproject.toml +++ b/homeworks/DDYunin/6/pyproject.toml @@ -11,6 +11,8 @@ python = "^3.10" loguru = "^0.6.0" requests = "^2.28.1" lxml = "^4.9.1" +wemake-python-styleguide = "^0.17.0" +isort = "^5.10.1" [build-system] diff --git a/homeworks/DDYunin/6/setup.cfg b/homeworks/DDYunin/6/setup.cfg new file mode 100644 index 0000000..6348305 --- /dev/null +++ b/homeworks/DDYunin/6/setup.cfg @@ -0,0 +1,5 @@ +[flake8] +ignore = D100, D101, D102, D103, D104, D105, D107 # Missing docstring somewhere + +per-file-ignores = + hw_6/*.py: E501, WPS226, WPS318, WPS319, S410 From 6509459d3e9b3259090660a7eb66bf452be511f5 Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Mon, 31 Oct 2022 18:48:39 +0300 Subject: [PATCH 10/15] Update setup.cfg --- homeworks/DDYunin/6/hw_6/users/1.xml | 201 ------------------------ homeworks/DDYunin/6/hw_6/users/2.xml | 201 ------------------------ homeworks/DDYunin/6/hw_6/users/None.xml | 8 - homeworks/DDYunin/6/setup.cfg | 5 - setup.cfg | 5 +- 5 files changed, 4 insertions(+), 416 deletions(-) delete mode 100644 homeworks/DDYunin/6/hw_6/users/1.xml delete mode 100644 homeworks/DDYunin/6/hw_6/users/2.xml delete mode 100644 homeworks/DDYunin/6/hw_6/users/None.xml delete mode 100644 homeworks/DDYunin/6/setup.cfg diff --git a/homeworks/DDYunin/6/hw_6/users/1.xml b/homeworks/DDYunin/6/hw_6/users/1.xml deleted file mode 100644 index a4eecd1..0000000 --- a/homeworks/DDYunin/6/hw_6/users/1.xml +++ /dev/null @@ -1,201 +0,0 @@ - - - 1 - Sincere@april.biz - - - 1 - sunt aut facere repellat provident occaecati excepturi optio reprehenderit - quia et suscipit suscipit recusandae consequuntur expedita et cum reprehenderit molestiae ut ut quas totam nostrum rerum est autem sunt rem eveniet architecto - - - 2 - qui est esse - est rerum tempore vitae sequi sint nihil reprehenderit dolor beatae ea dolores neque fugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis qui aperiam non debitis possimus qui neque nisi nulla - - - 3 - ea molestias quasi exercitationem repellat qui ipsa sit aut - et iusto sed quo iure voluptatem occaecati omnis eligendi aut ad voluptatem doloribus vel accusantium quis pariatur molestiae porro eius odio et labore et velit aut - - - 4 - eum et est occaecati - ullam et saepe reiciendis voluptatem adipisci sit amet autem assumenda provident rerum culpa quis hic commodi nesciunt rem tenetur doloremque ipsam iure quis sunt voluptatem rerum illo velit - - - 5 - nesciunt quas odio - repudiandae veniam quaerat sunt sed alias aut fugiat sit autem sed est voluptatem omnis possimus esse voluptatibus quis est aut tenetur dolor neque - - - 6 - dolorem eum magni eos aperiam quia - ut aspernatur corporis harum nihil quis provident sequi mollitia nobis aliquid molestiae perspiciatis et ea nemo ab reprehenderit accusantium quas voluptate dolores velit et doloremque molestiae - - - 7 - magnam facilis autem - dolore placeat quibusdam ea quo vitae magni quis enim qui quis quo nemo aut saepe quidem repellat excepturi ut quia sunt ut sequi eos ea sed quas - - - 8 - dolorem dolore est ipsam - dignissimos aperiam dolorem qui eum facilis quibusdam animi sint suscipit qui sint possimus cum quaerat magni maiores excepturi ipsam ut commodi dolor voluptatum modi aut vitae - - - 9 - nesciunt iure omnis dolorem tempora et accusantium - consectetur animi nesciunt iure dolore enim quia ad veniam autem ut quam aut nobis et est aut quod aut provident voluptas autem voluptas - - - 10 - optio molestias id quia eum - quo et expedita modi cum officia vel magni doloribus qui repudiandae vero nisi sit quos veniam quod sed accusamus veritatis error - - - - - 1 - quidem molestiae enim - - - 2 - sunt qui excepturi placeat culpa - - - 3 - omnis laborum odio - - - 4 - non esse culpa molestiae omnis sed optio - - - 5 - eaque aut omnis a - - - 6 - natus impedit quibusdam illo est - - - 7 - quibusdam autem aliquid et et quia - - - 8 - qui fuga est a eum - - - 9 - saepe unde necessitatibus rem - - - 10 - distinctio laborum qui - - - - - 1 - delectus aut autem - False - - - 2 - quis ut nam facilis et officia qui - False - - - 3 - fugiat veniam minus - False - - - 4 - et porro tempora - True - - - 5 - laboriosam mollitia et enim quasi adipisci quia provident illum - False - - - 6 - qui ullam ratione quibusdam voluptatem quia omnis - False - - - 7 - illo expedita consequatur quia in - False - - - 8 - quo adipisci enim quam ut ab - True - - - 9 - molestiae perspiciatis ipsa - False - - - 10 - illo est ratione doloremque quia maiores aut - True - - - 11 - vero rerum temporibus dolor - True - - - 12 - ipsa repellendus fugit nisi - True - - - 13 - et doloremque nulla - False - - - 14 - repellendus sunt dolores architecto voluptatum - True - - - 15 - ab voluptatum amet voluptas - True - - - 16 - accusamus eos facilis sint et aut voluptatem - True - - - 17 - quo laboriosam deleniti aut qui - True - - - 18 - dolorum est consequatur ea mollitia in culpa - False - - - 19 - molestiae ipsa aut voluptatibus pariatur dolor nihil - True - - - 20 - ullam nobis libero sapiente ad optio sint - True - - - diff --git a/homeworks/DDYunin/6/hw_6/users/2.xml b/homeworks/DDYunin/6/hw_6/users/2.xml deleted file mode 100644 index 4c84833..0000000 --- a/homeworks/DDYunin/6/hw_6/users/2.xml +++ /dev/null @@ -1,201 +0,0 @@ - - - 2 - Shanna@melissa.tv - - - 11 - et ea vero quia laudantium autem - delectus reiciendis molestiae occaecati non minima eveniet qui voluptatibus accusamus in eum beatae sit vel qui neque voluptates ut commodi qui incidunt ut animi commodi - - - 12 - in quibusdam tempore odit est dolorem - itaque id aut magnam praesentium quia et ea odit et ea voluptas et sapiente quia nihil amet occaecati quia id voluptatem incidunt ea est distinctio odio - - - 13 - dolorum ut in voluptas mollitia et saepe quo animi - aut dicta possimus sint mollitia voluptas commodi quo doloremque iste corrupti reiciendis voluptatem eius rerum sit cumque quod eligendi laborum minima perferendis recusandae assumenda consectetur porro architecto ipsum ipsam - - - 14 - voluptatem eligendi optio - fuga et accusamus dolorum perferendis illo voluptas non doloremque neque facere ad qui dolorum molestiae beatae sed aut voluptas totam sit illum - - - 15 - eveniet quod temporibus - reprehenderit quos placeat velit minima officia dolores impedit repudiandae molestiae nam voluptas recusandae quis delectus officiis harum fugiat vitae - - - 16 - sint suscipit perspiciatis velit dolorum rerum ipsa laboriosam odio - suscipit nam nisi quo aperiam aut asperiores eos fugit maiores voluptatibus quia voluptatem quis ullam qui in alias quia est consequatur magni mollitia accusamus ea nisi voluptate dicta - - - 17 - fugit voluptas sed molestias voluptatem provident - eos voluptas et aut odit natus earum aspernatur fuga molestiae ullam deserunt ratione qui eos qui nihil ratione nemo velit ut aut id quo - - - 18 - voluptate et itaque vero tempora molestiae - eveniet quo quis laborum totam consequatur non dolor ut et est repudiandae est voluptatem vel debitis et magnam - - - 19 - adipisci placeat illum aut reiciendis qui - illum quis cupiditate provident sit magnam ea sed aut omnis veniam maiores ullam consequatur atque adipisci quo iste expedita sit quos voluptas - - - 20 - doloribus ad provident suscipit at - qui consequuntur ducimus possimus quisquam amet similique suscipit porro ipsam amet eos veritatis officiis exercitationem vel fugit aut necessitatibus totam omnis rerum consequatur expedita quidem cumque explicabo - - - - - 11 - quam nostrum impedit mollitia quod et dolor - - - 12 - consequatur autem doloribus natus consectetur - - - 13 - ab rerum non rerum consequatur ut ea unde - - - 14 - ducimus molestias eos animi atque nihil - - - 15 - ut pariatur rerum ipsum natus repellendus praesentium - - - 16 - voluptatem aut maxime inventore autem magnam atque repellat - - - 17 - aut minima voluptatem ut velit - - - 18 - nesciunt quia et doloremque - - - 19 - velit pariatur quaerat similique libero omnis quia - - - 20 - voluptas rerum iure ut enim - - - - - 21 - suscipit repellat esse quibusdam voluptatem incidunt - False - - - 22 - distinctio vitae autem nihil ut molestias quo - True - - - 23 - et itaque necessitatibus maxime molestiae qui quas velit - False - - - 24 - adipisci non ad dicta qui amet quaerat doloribus ea - False - - - 25 - voluptas quo tenetur perspiciatis explicabo natus - True - - - 26 - aliquam aut quasi - True - - - 27 - veritatis pariatur delectus - True - - - 28 - nesciunt totam sit blanditiis sit - False - - - 29 - laborum aut in quam - False - - - 30 - nemo perspiciatis repellat ut dolor libero commodi blanditiis omnis - True - - - 31 - repudiandae totam in est sint facere fuga - False - - - 32 - earum doloribus ea doloremque quis - False - - - 33 - sint sit aut vero - False - - - 34 - porro aut necessitatibus eaque distinctio - False - - - 35 - repellendus veritatis molestias dicta incidunt - True - - - 36 - excepturi deleniti adipisci voluptatem et neque optio illum ad - True - - - 37 - sunt cum tempora - False - - - 38 - totam quia non - False - - - 39 - doloremque quibusdam asperiores libero corrupti illum qui omnis - False - - - 40 - totam atque quo nesciunt - True - - - diff --git a/homeworks/DDYunin/6/hw_6/users/None.xml b/homeworks/DDYunin/6/hw_6/users/None.xml deleted file mode 100644 index 767ed13..0000000 --- a/homeworks/DDYunin/6/hw_6/users/None.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - None - anastasia.net - - - - diff --git a/homeworks/DDYunin/6/setup.cfg b/homeworks/DDYunin/6/setup.cfg deleted file mode 100644 index 6348305..0000000 --- a/homeworks/DDYunin/6/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[flake8] -ignore = D100, D101, D102, D103, D104, D105, D107 # Missing docstring somewhere - -per-file-ignores = - hw_6/*.py: E501, WPS226, WPS318, WPS319, S410 diff --git a/setup.cfg b/setup.cfg index 46c4e01..6348305 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,5 @@ [flake8] -ignore = D100, D101, D102, D103, D104, D105, D107 # Missing docstring somewhere \ No newline at end of file +ignore = D100, D101, D102, D103, D104, D105, D107 # Missing docstring somewhere + +per-file-ignores = + hw_6/*.py: E501, WPS226, WPS318, WPS319, S410 From c323aeeefa0930deacfcd161b1b4341b34381bca Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Mon, 31 Oct 2022 18:51:49 +0300 Subject: [PATCH 11/15] Resolving conflict --- homeworks/DDYunin/setup.cfg | 5 +++++ setup.cfg | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 homeworks/DDYunin/setup.cfg diff --git a/homeworks/DDYunin/setup.cfg b/homeworks/DDYunin/setup.cfg new file mode 100644 index 0000000..6348305 --- /dev/null +++ b/homeworks/DDYunin/setup.cfg @@ -0,0 +1,5 @@ +[flake8] +ignore = D100, D101, D102, D103, D104, D105, D107 # Missing docstring somewhere + +per-file-ignores = + hw_6/*.py: E501, WPS226, WPS318, WPS319, S410 diff --git a/setup.cfg b/setup.cfg index 6348305..380b2b5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,2 @@ [flake8] ignore = D100, D101, D102, D103, D104, D105, D107 # Missing docstring somewhere - -per-file-ignores = - hw_6/*.py: E501, WPS226, WPS318, WPS319, S410 From 06615843250b905ff46470cdecbf22e06740bb7e Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Mon, 31 Oct 2022 18:54:14 +0300 Subject: [PATCH 12/15] Try to resolve conflict with branch --- homeworks/DDYunin/{ => 6}/setup.cfg | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename homeworks/DDYunin/{ => 6}/setup.cfg (100%) diff --git a/homeworks/DDYunin/setup.cfg b/homeworks/DDYunin/6/setup.cfg similarity index 100% rename from homeworks/DDYunin/setup.cfg rename to homeworks/DDYunin/6/setup.cfg From c4bc4706d5400a0d3861abc2d28b4b47d83bae4f Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Mon, 31 Oct 2022 18:54:49 +0300 Subject: [PATCH 13/15] Try to resolve conflict with branch 2 --- homeworks/DDYunin/6/setup.cfg | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 homeworks/DDYunin/6/setup.cfg diff --git a/homeworks/DDYunin/6/setup.cfg b/homeworks/DDYunin/6/setup.cfg deleted file mode 100644 index 6348305..0000000 --- a/homeworks/DDYunin/6/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[flake8] -ignore = D100, D101, D102, D103, D104, D105, D107 # Missing docstring somewhere - -per-file-ignores = - hw_6/*.py: E501, WPS226, WPS318, WPS319, S410 From 85365057621ca2eeefdcb0508513325c0d5043fc Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Mon, 31 Oct 2022 18:58:09 +0300 Subject: [PATCH 14/15] Try to resolve conflict with branch 3 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 380b2b5..a89adc0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ [flake8] -ignore = D100, D101, D102, D103, D104, D105, D107 # Missing docstring somewhere +ignore = D100, D101, D102, D103, D104, D105, D107 # Missing docstring somewhere \ No newline at end of file From c9f2297f0d499481c8670544987eb3433833b067 Mon Sep 17 00:00:00 2001 From: Dan Yunin Date: Mon, 31 Oct 2022 19:05:15 +0300 Subject: [PATCH 15/15] Fix empty files --- homeworks/DDYunin/6/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 homeworks/DDYunin/6/README.md diff --git a/homeworks/DDYunin/6/README.md b/homeworks/DDYunin/6/README.md deleted file mode 100644 index e69de29..0000000