From d989471b4966dfec58fc22a3e067dcb34761a1c9 Mon Sep 17 00:00:00 2001 From: Namxobick Date: Sat, 24 Sep 2022 20:11:13 +0300 Subject: [PATCH 01/18] Array (Yurin Andrey) The main functions of the array --- array.py | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 array.py diff --git a/array.py b/array.py new file mode 100644 index 0000000..69f3335 --- /dev/null +++ b/array.py @@ -0,0 +1,61 @@ +class Array(object): + + def __init__(self, *args): + self._data = args + + def __str__(self): + return str(self._data) + + def __add__(self, other): + if not isinstance(other, Array): + print(f"Warning, expected type Array (type {other} is {type(other)})") + new_array = Array(*self._data, other) + else: + new_array = Array(*self._data, *other._data) + return new_array + + def __len__(self): + return len(self._data) + + def __iter__(self): + return iter(self._data) + + def __getitem__(self, item: int): + if not isinstance(item, int): + print(f"Error, expected type Array (type {item} is {type(item)})") + elif item < -len(self._data) or item >= len(self._data): + print("Error,index out of range") + else: + return self._data[item] + return + + def __setitem__(self, key: int, value): + if not isinstance(key, int): + print(f"Error, expected type Array (type {key} is {type(key)})") + return + + if key < 0: + key = len(self) + key + + if key < 0 or key >= len(self): + print("Error, index out of range") + return + + self._data = Array(*self._data[:key], value, *self[key + 1:]) + + def __eq__(self, other): + if not isinstance(other, Array): + return False + if self._data == other._data: + return True + else: + return False + + def append(self, new_element): + self._data = Array(*self._data, new_element) + + def index(self, searched_element): + try: + return self._data.index(searched_element) + except ValueError: + return -1 From 237ee9d67b404d0f7c6b64763bfada1bad6513fb Mon Sep 17 00:00:00 2001 From: Namxobick Date: Sat, 24 Sep 2022 20:15:23 +0300 Subject: [PATCH 02/18] Changed the folder system --- array.py => "homeworks/Yurin Andrey/\342\204\2261/Array.py" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename array.py => "homeworks/Yurin Andrey/\342\204\2261/Array.py" (100%) diff --git a/array.py "b/homeworks/Yurin Andrey/\342\204\2261/Array.py" similarity index 100% rename from array.py rename to "homeworks/Yurin Andrey/\342\204\2261/Array.py" From aefd4fd52edb93f403cccd462ff717a2a5ab85aa Mon Sep 17 00:00:00 2001 From: Namxobick Date: Wed, 28 Sep 2022 00:00:45 +0300 Subject: [PATCH 03/18] Fixed error description text --- "homeworks/Yurin Andrey/\342\204\2261/Array.py" | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git "a/homeworks/Yurin Andrey/\342\204\2261/Array.py" "b/homeworks/Yurin Andrey/\342\204\2261/Array.py" index 69f3335..36061f7 100644 --- "a/homeworks/Yurin Andrey/\342\204\2261/Array.py" +++ "b/homeworks/Yurin Andrey/\342\204\2261/Array.py" @@ -22,7 +22,7 @@ def __iter__(self): def __getitem__(self, item: int): if not isinstance(item, int): - print(f"Error, expected type Array (type {item} is {type(item)})") + print(f"Error, expected type int (type {item} is {type(item)})") elif item < -len(self._data) or item >= len(self._data): print("Error,index out of range") else: @@ -31,7 +31,7 @@ def __getitem__(self, item: int): def __setitem__(self, key: int, value): if not isinstance(key, int): - print(f"Error, expected type Array (type {key} is {type(key)})") + print(f"Error, expected type int (type {key} is {type(key)})") return if key < 0: @@ -58,4 +58,4 @@ def index(self, searched_element): try: return self._data.index(searched_element) except ValueError: - return -1 + return -1 \ No newline at end of file From 0ea1017016211c4e2699cb4e7014551b140279e3 Mon Sep 17 00:00:00 2001 From: Namxobick Date: Tue, 4 Oct 2022 17:00:17 +0300 Subject: [PATCH 04/18] =?UTF-8?q?Add=20HW3=20and=20practice=20=E2=84=961?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Yurin Andrey/\342\204\2262/Array.py" | 0 .../\342\204\2263/\320\241ontract.py" | 29 ++++++ "practice/\342\204\2261/game_15_puzzle.py" | 89 +++++++++++++++++++ 3 files changed, 118 insertions(+) rename "homeworks/Yurin Andrey/\342\204\2261/Array.py" => "homeworks/Yurin Andrey/\342\204\2262/Array.py" (100%) create mode 100644 "homeworks/Yurin Andrey/\342\204\2263/\320\241ontract.py" create mode 100644 "practice/\342\204\2261/game_15_puzzle.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2261/Array.py" "b/homeworks/Yurin Andrey/\342\204\2262/Array.py" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2261/Array.py" rename to "homeworks/Yurin Andrey/\342\204\2262/Array.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2263/\320\241ontract.py" "b/homeworks/Yurin Andrey/\342\204\2263/\320\241ontract.py" new file mode 100644 index 0000000..ba8137e --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2263/\320\241ontract.py" @@ -0,0 +1,29 @@ +class ContractError(Exception): + """We use this error when someone breaks our contract.""" + + +#: Special value, that indicates that validation for this type is not required. +Any = object() + + +def contract(arg_types=None, return_type=None, raises=None): + def decorator(function): + def wrapper(*args, **kwargs): + if arg_types is not None: + for index, arg_type in enumerate(arg_types): + if arg_type is not Any and arg_type != type(args[index]): + raise ContractError('Invalid argument type') from TypeError + + try: + result = function(*args, **kwargs) + except (raises if raises is not None and Any not in raises else Exception) as ex: + raise ex + except Exception: + raise ContractError from Exception + + if return_type is not None and not isinstance(result, return_type): + raise ContractError('Invalid return type') from TypeError + + return result + return wrapper + return decorator diff --git "a/practice/\342\204\2261/game_15_puzzle.py" "b/practice/\342\204\2261/game_15_puzzle.py" new file mode 100644 index 0000000..320d9dd --- /dev/null +++ "b/practice/\342\204\2261/game_15_puzzle.py" @@ -0,0 +1,89 @@ +import random + +EMPTY_MARK = 'x' + +MOVES = { + 'w': -4, + 's': 4, + 'a': -1, + 'd': 1, +} + + +def shuffle_field(gameMap): + mixingDepth = random.randint(50, 100) + for i in range(mixingDepth): + key = random.choice(["w", "s", "d", "a"]) + perform_move(gameMap, key) + return gameMap + pass + + +def print_field(gameMap): + for i in range(len(gameMap)): + if i % 4 == 0 and i != 0: + print() + print(gameMap[i], end=' ') + pass + + +def is_game_finished(gameMap): + if gameMap[:len(gameMap) - 1] == [(i + 1) for i in range(15)]: + return True + else: + return False + pass + + +def perform_move(gameMap, key): + indexEmptyTile = gameMap.index('x') + + if key == 'w': + if indexEmptyTile in [12, 13, 14, 15]: + return None + else: + gameMap[indexEmptyTile], gameMap[indexEmptyTile + 4] = gameMap[indexEmptyTile + 4], gameMap[indexEmptyTile] + + elif key == 's': + if indexEmptyTile in [0, 1, 2, 3]: + return None + else: + gameMap[indexEmptyTile], gameMap[indexEmptyTile - 4] = gameMap[indexEmptyTile - 4], gameMap[indexEmptyTile] + + elif key == 'a': + if indexEmptyTile in [3, 7, 11, 15]: + return None + else: + gameMap[indexEmptyTile], gameMap[indexEmptyTile + 1] = gameMap[indexEmptyTile + 1], gameMap[indexEmptyTile] + else: + if indexEmptyTile in [0, 4, 8, 12]: + return None + else: + gameMap[indexEmptyTile], gameMap[indexEmptyTile - 1] = gameMap[indexEmptyTile - 1], gameMap[indexEmptyTile] + pass + + +def handle_user_input(): + print() + key = input() + return key + + pass + + +def main(): + GameMap = shuffle_field([(i + 1) for i in range(15)] + [EMPTY_MARK]) + + while not(is_game_finished(GameMap)): + print_field(GameMap) + perform_move(GameMap, handle_user_input()) + print("WIN") + + pass + + +if __name__ == '__main__': + + main() + + From 98a63f3a1c2172d448c3527626bd4cb49ce6aeb1 Mon Sep 17 00:00:00 2001 From: Namxobick Date: Wed, 5 Oct 2022 19:36:11 +0300 Subject: [PATCH 05/18] Create exceptions.py --- "practice/\342\204\2262/exceptions.py" | 161 +++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 "practice/\342\204\2262/exceptions.py" diff --git "a/practice/\342\204\2262/exceptions.py" "b/practice/\342\204\2262/exceptions.py" new file mode 100644 index 0000000..2e4d3bb --- /dev/null +++ "b/practice/\342\204\2262/exceptions.py" @@ -0,0 +1,161 @@ +import math + + +def call_system_exit(): + try: + exit() + except SystemExit: + print('SystemExit') + + +def call_generator_exit(): + def generate(): + values = [0, 1] + for value in values: + try: + yield value + + except GeneratorExit: + print('GeneratorExit') + raise + + my_generator = generate() + next(my_generator) + my_generator.close() + + +def call_runtime_error(): + def generate(): + values = [0, 1] + for value in values: + try: + yield value + + except RuntimeError: + print('RuntimeError') + + my_generator = generate() + next(my_generator) + my_generator.close() + + +def call_stop_iteration(): + def generate(): + for value in [0]: + yield value + return + + my_generator = generate() + for i in range(2): + try: + next(my_generator) + except StopIteration: + print("StopIteration") + + +def call_overflow_error(): + results = [] + for i in range(1000): + try: + results.append(math.exp(i)) + except OverflowError: + print("OverflowError") + return + + +def call_zero_division_error(): + try: + x = 1 / 0 + except ZeroDivisionError: + print("ZeroDivisionError") + + +def call_assertion_error(): + try: + assert 0 == 1 + except AssertionError: + print("AssertionError") + + +def call_attribute_error(): + my_str = 'my' + try: + my_str.noattr + except AttributeError: + print("AttributeError") + + +def call_value_error(): + try: + chr(-100) + except ValueError: + print("ValueError") + + +def call_index_error(): + a = [] + try: + a[1] + except IndexError: + print("IndexError") + + +def call_key_error(): + my_dict = {0: 0} + try: + my_dict[1] + except KeyError: + print("KeyError") + + +def call_file_not_found_error(): + try: + f = open('') + except FileNotFoundError: + print('FileNotFoundError') + + +def call_memory_error(): + try: + x = list(range(10000000000)) + except MemoryError: + print('MemoryError') + + +def call_type_error(): + try: + x = 'a' + 5 + except TypeError: + print('TypeError') + + +def call_recursion_error(): + try: + call_recursion_error() + except RecursionError: + print('RecursionError') + + +def call_unicode_decoder_error(): + try: + b'\xd0'.decode('utf-8') + except UnicodeDecodeError: + print('UnicodeDecodeError') + + +call_system_exit() +call_generator_exit() +call_runtime_error() +call_stop_iteration() +call_overflow_error() +call_zero_division_error() +call_assertion_error() +call_attribute_error() +call_value_error() +call_index_error() +call_key_error() +call_file_not_found_error() +call_memory_error() +call_type_error() +call_recursion_error() +call_unicode_decoder_error() From ee4624ff2916b6fe233555050276fd75f4611846 Mon Sep 17 00:00:00 2001 From: Namxobick Date: Wed, 12 Oct 2022 00:08:58 +0300 Subject: [PATCH 06/18] Add HW4 --- .../\342\204\2264/.idea/.gitignore" | 3 + .../Yurin Andrey/\342\204\2264/.idea/hw5.iml" | 12 ++ .../inspectionProfiles/profiles_settings.xml" | 6 + .../\342\204\2264/.idea/misc.xml" | 4 + .../\342\204\2264/.idea/modules.xml" | 8 ++ .../Yurin Andrey/\342\204\2264/README.md" | 27 ++++ "homeworks/Yurin Andrey/\342\204\2264/hw5.md" | 53 +++++++ .../\342\204\2264/tests/conftest.py" | 5 + .../\342\204\2264/tests/test_done_command.py" | 30 ++++ .../tests/test_representations.py" | 18 +++ .../\342\204\2264/tests/test_to_read_item.py" | 43 ++++++ .../tests/test_undone_command.py" | 30 ++++ .../\342\204\2264/todo/__init__.py" | 0 .../\342\204\2264/todo/__main__.py" | 28 ++++ .../\342\204\2264/todo/commands.py" | 132 ++++++++++++++++++ .../\342\204\2264/todo/custom_exceptions.py" | 2 + .../\342\204\2264/todo/models.py" | 77 ++++++++++ .../\342\204\2264/todo/reflection.py" | 31 ++++ .../\342\204\2264/todo/runtime.py" | 52 +++++++ .../\342\204\2264/todo/storage.py" | 21 +++ 20 files changed, 582 insertions(+) create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/.idea/.gitignore" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/.idea/hw5.iml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/.idea/inspectionProfiles/profiles_settings.xml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/.idea/misc.xml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/.idea/modules.xml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/README.md" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/hw5.md" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/tests/conftest.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/tests/test_done_command.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/tests/test_representations.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/tests/test_to_read_item.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/tests/test_undone_command.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/__init__.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/__main__.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/commands.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/custom_exceptions.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/models.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/reflection.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/runtime.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/storage.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2264/.idea/.gitignore" "b/homeworks/Yurin Andrey/\342\204\2264/.idea/.gitignore" new file mode 100644 index 0000000..26d3352 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/.idea/.gitignore" @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git "a/homeworks/Yurin Andrey/\342\204\2264/.idea/hw5.iml" "b/homeworks/Yurin Andrey/\342\204\2264/.idea/hw5.iml" new file mode 100644 index 0000000..8b8c395 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/.idea/hw5.iml" @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2264/.idea/inspectionProfiles/profiles_settings.xml" "b/homeworks/Yurin Andrey/\342\204\2264/.idea/inspectionProfiles/profiles_settings.xml" new file mode 100644 index 0000000..105ce2d --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/.idea/inspectionProfiles/profiles_settings.xml" @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2264/.idea/misc.xml" "b/homeworks/Yurin Andrey/\342\204\2264/.idea/misc.xml" new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/.idea/misc.xml" @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2264/.idea/modules.xml" "b/homeworks/Yurin Andrey/\342\204\2264/.idea/modules.xml" new file mode 100644 index 0000000..8f8a12d --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/.idea/modules.xml" @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2264/README.md" "b/homeworks/Yurin Andrey/\342\204\2264/README.md" new file mode 100644 index 0000000..3f2028c --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/README.md" @@ -0,0 +1,27 @@ +# TODO CLI App + + +## Legend + +This application is used for our internal needs. +It was developed a long time ago by an unknown developer. + +It works fine. But there are several things we would like to improve. + + +## Running + +To run this app follow these steps: + +1. `cd hw5` +2. `python3 -m todo` ([docs](https://docs.python.org/3/using/cmdline.html#cmdoption-m)) +3. Enjoy! + + +## Testing + +If you don't know what you are doing, skip this step. + +0. Make sure that you are in this folder, near `README.md` +1. `pip install pytest` +2. `pytest` diff --git "a/homeworks/Yurin Andrey/\342\204\2264/hw5.md" "b/homeworks/Yurin Andrey/\342\204\2264/hw5.md" new file mode 100644 index 0000000..c587eff --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/hw5.md" @@ -0,0 +1,53 @@ +## Теория + +### Полезности + +- `datetime`: https://docs.python.org/3/library/datetime.html +- `collections`: https://docs.python.org/3/library/collections.html +- `itertools`: https://docs.python.org/3/library/itertools.html +- `functools`: https://docs.python.org/3/library/functools.html +- `os`: https://docs.python.org/3/library/os.html +- `sys`: https://docs.python.org/3/library/sys.html +- `re`: https://docs.python.org/3/library/re.html +- `argparse`: https://docs.python.org/3/library/argparse.html + +### Imports + +- modules: https://docs.python.org/3/tutorial/modules.html +- Решаем проблему цикличных импортов: https://stackoverflow.com/questions/5748946/pythonic-way-to-resolve-circular-import-statements +- Откуда можно импортировать: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH и https://stackoverflow.com/questions/19917492/how-to-use-pythonpath и http://www.johnny-lin.com/cdat_tips/tips_pylang/path.html +- Relative imports vs absolute: https://stackoverflow.com/questions/28400690/python3-correct-way-to-import-relative-or-absolute и http://pulkitgoyal.com/absolute-relative-imports + + +## Практика + +Данное задание будет построено в формате ролевой игры, чтобы показать реальность подобных задач, ситуаций и подходов. + +### Легенда + +В компании, куда вы пришли работать, есть для вас первая задача. +Все сотрудники пользуются внутренней системой ведения учета задач. +Но вот проблема, в ней есть некоторые моменты, которые нужно улучшить. + +Никто точно не помнит, кто написал программу и когда. +К сожаению, спросить, как она работает, некого. +Более того, сами сотрудники не могут посмотреть, что там в коде, потому что они не программисты. +Но они слышали, что там есть сложные части, а есть какие-то простые. +Вроде бы код написан нормально, но документации к нему не сохранилось. +Только инструкция по запуску. + +### Технические требования + +Менеджер подготовил для вас техническое задание, какие фичи он хотел бы увидеть: + +- Необходимо добавить всем задачам визуальный статус готовности. Он должен выглядеть так: `+ ToDo: ...`, где `+` или `-` - статус готовности (`+` - выполнено, `-` - невыполнено), `ToDo` - название типа задачи и `...` - атрибуты задачи +- Необходимо реализовать команду `done`, которая бы отмечала задачи выполнеными (все задачи по-умолчанию невыполнены) +- Необходимо реализовать команду `undone`, которая бы отмечала задачи невыполнеными +- Необходимо добавить новый тип задачи: `ToReadItem`, у которой было бы два поля: `heading` и `url`. Следовательно: что прочитать и где + +### Проверка результатов (для продвинуты, необязательно) + +Старый разработчик был большим фанатом [TTD](https://en.wikipedia.org/wiki/Test-driven_development), и он успел перед своим уходом написать тесты, как должы работать все те новые требования. +Но закончить проект не успел. + +В качестве проверки будем использовать их. diff --git "a/homeworks/Yurin Andrey/\342\204\2264/tests/conftest.py" "b/homeworks/Yurin Andrey/\342\204\2264/tests/conftest.py" new file mode 100644 index 0000000..e846edf --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/tests/conftest.py" @@ -0,0 +1,5 @@ +import os +import sys + +BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) +sys.path.append(BASE_DIR) diff --git "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_done_command.py" "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_done_command.py" new file mode 100644 index 0000000..83a6927 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_done_command.py" @@ -0,0 +1,30 @@ +def test_class_exists(): + from todo.commands import DoneCommand + + assert isinstance(DoneCommand, type) + + +def test_command_label_in_list(): + from todo.commands import DoneCommand + from todo.runtime import get_routes + + assert DoneCommand().label in get_routes() + + +def test_command_execution(monkeypatch): + from todo.commands import DoneCommand + from todo.runtime import perform_command + from todo.models import Storage, ToDoItem + + monkeypatch.setitem(__builtins__, 'input', lambda _: 0) + + item = ToDoItem('test') + item.done = False + + s = Storage() + s.items.clear() + s.items.append(item) + + perform_command(DoneCommand().label) + + assert item.done is True diff --git "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_representations.py" "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_representations.py" new file mode 100644 index 0000000..07043c8 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_representations.py" @@ -0,0 +1,18 @@ +def test_to_buy_item(): + from todo.models import ToBuyItem + + item = ToBuyItem('header', 'price') + assert str(item).startswith('- ToBuy: ') + + item.done = True + assert str(item).startswith('+ ToBuy: ') + + +def test_to_do_item(): + from todo.models import ToDoItem + + item = ToDoItem('subject') + assert str(item).startswith('- ToDo: ') + + item.done = True + assert str(item).startswith('+ ToDo: ') diff --git "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_to_read_item.py" "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_to_read_item.py" new file mode 100644 index 0000000..b1ea1e3 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_to_read_item.py" @@ -0,0 +1,43 @@ +def test_class_exists(): + from todo.models import ToReadItem + + assert isinstance(ToReadItem, type) + + +def test_there_are_attributes(): + from todo.models import ToReadItem + + heading = 'test' + url = 'http://ya.ru' + item = ToReadItem(heading, url) + + assert item.heading == heading + assert item.url == url + assert item.done is False + + +def test_fabric_method(monkeypatch): + from todo.models import ToReadItem + + value = 'some input' + + monkeypatch.setitem(__builtins__, 'input', lambda _: value) + item = ToReadItem.construct() + + assert item.heading == value + assert item.url == value + assert item.done is False + + +def test_representation(): + from todo.models import ToReadItem + + heading = 'test' + url = 'http://ya.ru' + item = ToReadItem(heading, url) + + assert str(item) == '- ToRead: {} {}'.format(heading, url) + + item.done = True + + assert str(item) == '+ ToRead: {} {}'.format(heading, url) diff --git "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_undone_command.py" "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_undone_command.py" new file mode 100644 index 0000000..b25bedf --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_undone_command.py" @@ -0,0 +1,30 @@ +def test_class_exists(): + from todo.commands import UndoneCommand + + assert isinstance(UndoneCommand, type) + + +def test_command_label_in_list(): + from todo.commands import UndoneCommand + from todo.runtime import get_routes + + assert UndoneCommand().label in get_routes() + + +def test_command_execution(monkeypatch): + from todo.commands import UndoneCommand + from todo.runtime import perform_command + from todo.models import Storage, ToDoItem + + monkeypatch.setitem(__builtins__, 'input', lambda _: 0) + + item = ToDoItem('test') + item.done = True + + s = Storage() + s.items.clear() + s.items.append(item) + + perform_command(UndoneCommand().label) + + assert item.done is False diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/__init__.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/__init__.py" new file mode 100644 index 0000000..e69de29 diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/__main__.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/__main__.py" new file mode 100644 index 0000000..55f9f2c --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/todo/__main__.py" @@ -0,0 +1,28 @@ +""" +Main file. Contains program execution logic. +""" + +from todo.custom_exceptions import UserExitException +from todo.runtime import parse_user_input, perform_command + + +def main(): + """ + Main method, works infinitely until user runs `exit` command. + Or hits `Ctrl+C` in the console. + """ + while True: + try: + perform_command(parse_user_input()) + except UserExitException: + break + except Exception as ex: + print('You have done something wrong!', ex) + + +if __name__ == '__main__': + try: + main() + except KeyboardInterrupt: + print() + print('Shutting down, bye!') diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/commands.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/commands.py" new file mode 100644 index 0000000..dea1063 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/todo/commands.py" @@ -0,0 +1,132 @@ + +from todo.custom_exceptions import UserExitException +from todo.models import BaseItem +from todo.reflection import find_classes + + +class BaseCommand(object): + label: str + + def perform(self, store): + raise NotImplementedError() + + +class ListCommand(BaseCommand): + label = 'list' + + def perform(self, store): + if len(store.items) == 0: + print('There are no items in the storage.') + return + + for index, obj in enumerate(store.items): + print('{0}: {1}'.format(index, str(obj))) + + +class NewCommand(BaseCommand): + label = 'new' + + def perform(self, store): + classes = self._load_item_classes() + + print('Select item type:') + for index, name in enumerate(classes.keys()): + print('{0}: {1}'.format(index, name)) + + selection = None + selected_key = None + + while True: + try: + selected_key = self._select_item(classes) + except ValueError: + print('Bad input, try again.') + except IndexError: + print('Wrong index, try again.') + else: + break + + selected_class = classes[selected_key] + print('Selected: {0}'.format(selected_class.__name__)) + print() + + new_object = selected_class.construct() + + store.items.append(new_object) + + print('Added {0}'.format(str(new_object))) + print() + return new_object + + def _load_item_classes(self) -> dict: + # Dynamic load: + return dict(find_classes(BaseItem)) + + def _select_item(self, classes): + selection = int(input('Input number: ')) + if selection < 0: + raise IndexError('Index needs to be >0') + return list(classes.keys())[selection] + + +class BaseMarkCommand(object): + + def perform(self, store): + counts = 0 + + for obj in store.items: + if str(obj)[0] == self.char: + counts += 1 + + if counts == 0: + print('There are no {0}items in the storage.'.format(self.char)) + return + + for index, obj in enumerate(store.items): + if str(obj)[0] == self.char: + print('{0}: {1}'.format(index, str(obj))) + + selected_item = self.select_item(store) + + print('{0} has been {1}'.format(selected_item, self.operation)) + print() + + operation = getattr(selected_item, str(self.operation), None) + assert operation is not None + operation() + + def select_item(self, store): + while True: + try: + selection = int(input('Input number of item: ')) + if selection < 0 or str(store.items[selection])[0] != self.char: + raise IndexError('MarkCommand -> select_item') + except ValueError: + print('Bad input, try again.') + except IndexError: + print('Wrong index, try again.') + else: + break + + if store.items is None: + print('There are no items in the storage.') + return store.items[selection] + + +class DoneCommand(BaseMarkCommand, BaseCommand): + label = 'done' + operation = 'mark_done' + char = '-' + + +class UndoneCommand(BaseMarkCommand, BaseCommand): + label = 'undone' + operation = 'mark_undone' + char = '+' + + +class ExitCommand(BaseCommand): + label = 'exit' + + def perform(self, _store): + raise UserExitException('See you next time!') diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/custom_exceptions.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/custom_exceptions.py" new file mode 100644 index 0000000..5e8963c --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/todo/custom_exceptions.py" @@ -0,0 +1,2 @@ +class UserExitException(Exception): + """We use this exception when user wants to exit.""" diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/models.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/models.py" new file mode 100644 index 0000000..aaaa03c --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/todo/models.py" @@ -0,0 +1,77 @@ +class BaseItem(object): + def __init__(self, heading): + self.heading = heading + self.done = False # TODO: make sure we can use it... + + def __repr__(self): + return self.__class__.__name__ + + def __str__(self): + return '{0} {1}'.format( + '+' if self.done else '-', + self.__repr__(), + ) + + def set_done(self, status: bool): + self.done = status + + def mark_done(self): + self.done = True + + def mark_undone(self): + self.done = False + + @classmethod + def construct(cls): + raise NotImplementedError() + + +class ToDoItem(BaseItem): + def __str__(self): + return '{0}: {1}'.format( + super().__str__(), + self.heading, + ) + + @classmethod + def construct(cls): + heading = input('Input heading: ') + return cls(heading) + + +class ToBuyItem(BaseItem): + def __init__(self, heading, price): + super().__init__(heading) + self.price = price + + def __str__(self): + return '{0}: {1} for {2}'.format( + super().__str__(), + self.heading, + self.price, + ) + + @classmethod + def construct(cls): + heading = input('Input heading: ') + price = input('Input price: ') + return cls(heading, price) + + +class ToReadItem(BaseItem): + def __init__(self, heading, url): + super().__init__(heading) + self.url = url + + def __str__(self): + return '{0}: {1} {2}'.format( + super().__str__(), + self.heading, + self.url, + ) + + @classmethod + def construct(cls): + heading = input('Input heading: ') + url = input('Input url: ') + return cls(heading, url) diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/reflection.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/reflection.py" new file mode 100644 index 0000000..e16c6f6 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/todo/reflection.py" @@ -0,0 +1,31 @@ +import inspect +import sys + + +def find_classes(base_class) -> tuple: + """ + Finds all subclasses of a class inside module. + + :param base_class: Base class to search children. + :return: tuple of subclasses + """ + return inspect.getmembers(sys.modules[base_class.__module__], _reflect_filter(base_class),) + + +def _reflect_filter(base_class): + """ + Reflection is used to load modules dynamically. + + This method is complex. It does some dark magic. + How is it even possible to understand it? + + :param base_class: Target base class + :return: function to filter only subclasses of `base_class` + """ + def class_filter(klass): + return inspect.isclass( + klass, + ) and klass.__module__ == base_class.__module__ and issubclass( + klass, base_class, + ) and klass is not base_class + return class_filter diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/runtime.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/runtime.py" new file mode 100644 index 0000000..c955fa3 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/todo/runtime.py" @@ -0,0 +1,52 @@ +from todo.commands import BaseCommand +from todo.custom_exceptions import UserExitException +from todo.reflection import find_classes +from todo.storage import Storage + + +def get_routes() -> dict: + """ + This function contains the dictionary of possible commands. + :return: `dict` of possible commands, with the format: `name -> class` + """ + routes = find_classes(BaseCommand) + return { + route().label: route + for _, route in routes + } + + +def perform_command(command: str) -> None: + """ + Performs the command by name. + Stores the result in `Storage()`. + :param command: command name, selected by user. + """ + command = command.lower() + routes = get_routes() + + try: + command_class = routes[command] + except KeyError: + print('Bad command, try again.') + return + + command_inst = command_class() + storage = Storage() + + try: + command_inst.perform(storage) + except UserExitException as ex: + # Handling `exit` command. + print(ex) + raise + + +def parse_user_input(): + """ + Gets the user input. + :return: `str` with the user input. + """ + commands = get_routes().keys() + message = 'Input your command: ({0}): '.format('|'.join(commands)) + return input(message) diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/storage.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/storage.py" new file mode 100644 index 0000000..ef58690 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2264/todo/storage.py" @@ -0,0 +1,21 @@ +class Storage(object): # storage = Storge() + """ + Singleton storage. + + Read more about singleton design pattern: + https://stackoverflow.com/questions/6760685/creating-a-singleton-in-python + https://en.wikipedia.org/wiki/Singleton_pattern + + It is used to emulate in-memory storage. + It should be replaced with a database in a real application. + """ + + obj = None + items = None + + @classmethod + def __new__(cls, *args): + if cls.obj is None: + cls.obj = object.__new__(cls) + cls.items = [] + return cls.obj From e80a98bfb6e4354bdda705abde87ef69e29faea6 Mon Sep 17 00:00:00 2001 From: Namxobick Date: Tue, 18 Oct 2022 18:24:34 +0300 Subject: [PATCH 07/18] add HW5 --- .../Yurin Andrey/\342\204\2262/Array.py" | 61 --- .../\342\204\2263/\320\241ontract.py" | 29 -- .../\342\204\2264/.idea/.gitignore" | 3 - .../Yurin Andrey/\342\204\2264/.idea/hw5.iml" | 12 - .../inspectionProfiles/profiles_settings.xml" | 6 - .../\342\204\2264/.idea/misc.xml" | 4 - .../\342\204\2264/.idea/modules.xml" | 8 - .../Yurin Andrey/\342\204\2264/README.md" | 27 -- "homeworks/Yurin Andrey/\342\204\2264/hw5.md" | 53 --- .../\342\204\2264/tests/conftest.py" | 5 - .../\342\204\2264/tests/test_done_command.py" | 30 -- .../tests/test_representations.py" | 18 - .../\342\204\2264/tests/test_to_read_item.py" | 43 -- .../tests/test_undone_command.py" | 30 -- .../\342\204\2264/todo/__main__.py" | 28 -- .../\342\204\2264/todo/commands.py" | 132 ------ .../\342\204\2264/todo/custom_exceptions.py" | 2 - .../\342\204\2264/todo/models.py" | 77 ---- .../\342\204\2264/todo/reflection.py" | 31 -- .../\342\204\2264/todo/runtime.py" | 52 --- .../\342\204\2264/todo/storage.py" | 21 - .../my-awesome-script/README.md" | 0 .../my_awesome_script/__init__.py" | 1 + .../my_awesome_script/__main__.py" | 17 + .../my_awesome_script/cmdInput.py" | 17 + .../my_awesome_script/command.py" | 33 ++ .../my-awesome-script/poetry.lock" | 406 ++++++++++++++++++ .../my-awesome-script/pyproject.toml" | 28 ++ .../my-awesome-script/tests/__init__.py" | 0 "practice/\342\204\2261/game_15_puzzle.py" | 89 ---- "practice/\342\204\2262/exceptions.py" | 161 ------- 31 files changed, 502 insertions(+), 922 deletions(-) delete mode 100644 "homeworks/Yurin Andrey/\342\204\2262/Array.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2263/\320\241ontract.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/.idea/.gitignore" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/.idea/hw5.iml" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/.idea/inspectionProfiles/profiles_settings.xml" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/.idea/misc.xml" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/.idea/modules.xml" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/README.md" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/hw5.md" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/tests/conftest.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/tests/test_done_command.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/tests/test_representations.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/tests/test_to_read_item.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/tests/test_undone_command.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/__main__.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/commands.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/custom_exceptions.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/models.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/reflection.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/runtime.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2264/todo/storage.py" rename "homeworks/Yurin Andrey/\342\204\2264/todo/__init__.py" => "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/README.md" (100%) create mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__init__.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__main__.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/poetry.lock" create mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/pyproject.toml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/tests/__init__.py" delete mode 100644 "practice/\342\204\2261/game_15_puzzle.py" delete mode 100644 "practice/\342\204\2262/exceptions.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2262/Array.py" "b/homeworks/Yurin Andrey/\342\204\2262/Array.py" deleted file mode 100644 index 36061f7..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2262/Array.py" +++ /dev/null @@ -1,61 +0,0 @@ -class Array(object): - - def __init__(self, *args): - self._data = args - - def __str__(self): - return str(self._data) - - def __add__(self, other): - if not isinstance(other, Array): - print(f"Warning, expected type Array (type {other} is {type(other)})") - new_array = Array(*self._data, other) - else: - new_array = Array(*self._data, *other._data) - return new_array - - def __len__(self): - return len(self._data) - - def __iter__(self): - return iter(self._data) - - def __getitem__(self, item: int): - if not isinstance(item, int): - print(f"Error, expected type int (type {item} is {type(item)})") - elif item < -len(self._data) or item >= len(self._data): - print("Error,index out of range") - else: - return self._data[item] - return - - def __setitem__(self, key: int, value): - if not isinstance(key, int): - print(f"Error, expected type int (type {key} is {type(key)})") - return - - if key < 0: - key = len(self) + key - - if key < 0 or key >= len(self): - print("Error, index out of range") - return - - self._data = Array(*self._data[:key], value, *self[key + 1:]) - - def __eq__(self, other): - if not isinstance(other, Array): - return False - if self._data == other._data: - return True - else: - return False - - def append(self, new_element): - self._data = Array(*self._data, new_element) - - def index(self, searched_element): - try: - return self._data.index(searched_element) - except ValueError: - return -1 \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2263/\320\241ontract.py" "b/homeworks/Yurin Andrey/\342\204\2263/\320\241ontract.py" deleted file mode 100644 index ba8137e..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2263/\320\241ontract.py" +++ /dev/null @@ -1,29 +0,0 @@ -class ContractError(Exception): - """We use this error when someone breaks our contract.""" - - -#: Special value, that indicates that validation for this type is not required. -Any = object() - - -def contract(arg_types=None, return_type=None, raises=None): - def decorator(function): - def wrapper(*args, **kwargs): - if arg_types is not None: - for index, arg_type in enumerate(arg_types): - if arg_type is not Any and arg_type != type(args[index]): - raise ContractError('Invalid argument type') from TypeError - - try: - result = function(*args, **kwargs) - except (raises if raises is not None and Any not in raises else Exception) as ex: - raise ex - except Exception: - raise ContractError from Exception - - if return_type is not None and not isinstance(result, return_type): - raise ContractError('Invalid return type') from TypeError - - return result - return wrapper - return decorator diff --git "a/homeworks/Yurin Andrey/\342\204\2264/.idea/.gitignore" "b/homeworks/Yurin Andrey/\342\204\2264/.idea/.gitignore" deleted file mode 100644 index 26d3352..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/.idea/.gitignore" +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git "a/homeworks/Yurin Andrey/\342\204\2264/.idea/hw5.iml" "b/homeworks/Yurin Andrey/\342\204\2264/.idea/hw5.iml" deleted file mode 100644 index 8b8c395..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/.idea/hw5.iml" +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2264/.idea/inspectionProfiles/profiles_settings.xml" "b/homeworks/Yurin Andrey/\342\204\2264/.idea/inspectionProfiles/profiles_settings.xml" deleted file mode 100644 index 105ce2d..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/.idea/inspectionProfiles/profiles_settings.xml" +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2264/.idea/misc.xml" "b/homeworks/Yurin Andrey/\342\204\2264/.idea/misc.xml" deleted file mode 100644 index d1e22ec..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/.idea/misc.xml" +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2264/.idea/modules.xml" "b/homeworks/Yurin Andrey/\342\204\2264/.idea/modules.xml" deleted file mode 100644 index 8f8a12d..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/.idea/modules.xml" +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2264/README.md" "b/homeworks/Yurin Andrey/\342\204\2264/README.md" deleted file mode 100644 index 3f2028c..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/README.md" +++ /dev/null @@ -1,27 +0,0 @@ -# TODO CLI App - - -## Legend - -This application is used for our internal needs. -It was developed a long time ago by an unknown developer. - -It works fine. But there are several things we would like to improve. - - -## Running - -To run this app follow these steps: - -1. `cd hw5` -2. `python3 -m todo` ([docs](https://docs.python.org/3/using/cmdline.html#cmdoption-m)) -3. Enjoy! - - -## Testing - -If you don't know what you are doing, skip this step. - -0. Make sure that you are in this folder, near `README.md` -1. `pip install pytest` -2. `pytest` diff --git "a/homeworks/Yurin Andrey/\342\204\2264/hw5.md" "b/homeworks/Yurin Andrey/\342\204\2264/hw5.md" deleted file mode 100644 index c587eff..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/hw5.md" +++ /dev/null @@ -1,53 +0,0 @@ -## Теория - -### Полезности - -- `datetime`: https://docs.python.org/3/library/datetime.html -- `collections`: https://docs.python.org/3/library/collections.html -- `itertools`: https://docs.python.org/3/library/itertools.html -- `functools`: https://docs.python.org/3/library/functools.html -- `os`: https://docs.python.org/3/library/os.html -- `sys`: https://docs.python.org/3/library/sys.html -- `re`: https://docs.python.org/3/library/re.html -- `argparse`: https://docs.python.org/3/library/argparse.html - -### Imports - -- modules: https://docs.python.org/3/tutorial/modules.html -- Решаем проблему цикличных импортов: https://stackoverflow.com/questions/5748946/pythonic-way-to-resolve-circular-import-statements -- Откуда можно импортировать: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH и https://stackoverflow.com/questions/19917492/how-to-use-pythonpath и http://www.johnny-lin.com/cdat_tips/tips_pylang/path.html -- Relative imports vs absolute: https://stackoverflow.com/questions/28400690/python3-correct-way-to-import-relative-or-absolute и http://pulkitgoyal.com/absolute-relative-imports - - -## Практика - -Данное задание будет построено в формате ролевой игры, чтобы показать реальность подобных задач, ситуаций и подходов. - -### Легенда - -В компании, куда вы пришли работать, есть для вас первая задача. -Все сотрудники пользуются внутренней системой ведения учета задач. -Но вот проблема, в ней есть некоторые моменты, которые нужно улучшить. - -Никто точно не помнит, кто написал программу и когда. -К сожаению, спросить, как она работает, некого. -Более того, сами сотрудники не могут посмотреть, что там в коде, потому что они не программисты. -Но они слышали, что там есть сложные части, а есть какие-то простые. -Вроде бы код написан нормально, но документации к нему не сохранилось. -Только инструкция по запуску. - -### Технические требования - -Менеджер подготовил для вас техническое задание, какие фичи он хотел бы увидеть: - -- Необходимо добавить всем задачам визуальный статус готовности. Он должен выглядеть так: `+ ToDo: ...`, где `+` или `-` - статус готовности (`+` - выполнено, `-` - невыполнено), `ToDo` - название типа задачи и `...` - атрибуты задачи -- Необходимо реализовать команду `done`, которая бы отмечала задачи выполнеными (все задачи по-умолчанию невыполнены) -- Необходимо реализовать команду `undone`, которая бы отмечала задачи невыполнеными -- Необходимо добавить новый тип задачи: `ToReadItem`, у которой было бы два поля: `heading` и `url`. Следовательно: что прочитать и где - -### Проверка результатов (для продвинуты, необязательно) - -Старый разработчик был большим фанатом [TTD](https://en.wikipedia.org/wiki/Test-driven_development), и он успел перед своим уходом написать тесты, как должы работать все те новые требования. -Но закончить проект не успел. - -В качестве проверки будем использовать их. diff --git "a/homeworks/Yurin Andrey/\342\204\2264/tests/conftest.py" "b/homeworks/Yurin Andrey/\342\204\2264/tests/conftest.py" deleted file mode 100644 index e846edf..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/tests/conftest.py" +++ /dev/null @@ -1,5 +0,0 @@ -import os -import sys - -BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) -sys.path.append(BASE_DIR) diff --git "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_done_command.py" "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_done_command.py" deleted file mode 100644 index 83a6927..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_done_command.py" +++ /dev/null @@ -1,30 +0,0 @@ -def test_class_exists(): - from todo.commands import DoneCommand - - assert isinstance(DoneCommand, type) - - -def test_command_label_in_list(): - from todo.commands import DoneCommand - from todo.runtime import get_routes - - assert DoneCommand().label in get_routes() - - -def test_command_execution(monkeypatch): - from todo.commands import DoneCommand - from todo.runtime import perform_command - from todo.models import Storage, ToDoItem - - monkeypatch.setitem(__builtins__, 'input', lambda _: 0) - - item = ToDoItem('test') - item.done = False - - s = Storage() - s.items.clear() - s.items.append(item) - - perform_command(DoneCommand().label) - - assert item.done is True diff --git "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_representations.py" "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_representations.py" deleted file mode 100644 index 07043c8..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_representations.py" +++ /dev/null @@ -1,18 +0,0 @@ -def test_to_buy_item(): - from todo.models import ToBuyItem - - item = ToBuyItem('header', 'price') - assert str(item).startswith('- ToBuy: ') - - item.done = True - assert str(item).startswith('+ ToBuy: ') - - -def test_to_do_item(): - from todo.models import ToDoItem - - item = ToDoItem('subject') - assert str(item).startswith('- ToDo: ') - - item.done = True - assert str(item).startswith('+ ToDo: ') diff --git "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_to_read_item.py" "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_to_read_item.py" deleted file mode 100644 index b1ea1e3..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_to_read_item.py" +++ /dev/null @@ -1,43 +0,0 @@ -def test_class_exists(): - from todo.models import ToReadItem - - assert isinstance(ToReadItem, type) - - -def test_there_are_attributes(): - from todo.models import ToReadItem - - heading = 'test' - url = 'http://ya.ru' - item = ToReadItem(heading, url) - - assert item.heading == heading - assert item.url == url - assert item.done is False - - -def test_fabric_method(monkeypatch): - from todo.models import ToReadItem - - value = 'some input' - - monkeypatch.setitem(__builtins__, 'input', lambda _: value) - item = ToReadItem.construct() - - assert item.heading == value - assert item.url == value - assert item.done is False - - -def test_representation(): - from todo.models import ToReadItem - - heading = 'test' - url = 'http://ya.ru' - item = ToReadItem(heading, url) - - assert str(item) == '- ToRead: {} {}'.format(heading, url) - - item.done = True - - assert str(item) == '+ ToRead: {} {}'.format(heading, url) diff --git "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_undone_command.py" "b/homeworks/Yurin Andrey/\342\204\2264/tests/test_undone_command.py" deleted file mode 100644 index b25bedf..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/tests/test_undone_command.py" +++ /dev/null @@ -1,30 +0,0 @@ -def test_class_exists(): - from todo.commands import UndoneCommand - - assert isinstance(UndoneCommand, type) - - -def test_command_label_in_list(): - from todo.commands import UndoneCommand - from todo.runtime import get_routes - - assert UndoneCommand().label in get_routes() - - -def test_command_execution(monkeypatch): - from todo.commands import UndoneCommand - from todo.runtime import perform_command - from todo.models import Storage, ToDoItem - - monkeypatch.setitem(__builtins__, 'input', lambda _: 0) - - item = ToDoItem('test') - item.done = True - - s = Storage() - s.items.clear() - s.items.append(item) - - perform_command(UndoneCommand().label) - - assert item.done is False diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/__main__.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/__main__.py" deleted file mode 100644 index 55f9f2c..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/todo/__main__.py" +++ /dev/null @@ -1,28 +0,0 @@ -""" -Main file. Contains program execution logic. -""" - -from todo.custom_exceptions import UserExitException -from todo.runtime import parse_user_input, perform_command - - -def main(): - """ - Main method, works infinitely until user runs `exit` command. - Or hits `Ctrl+C` in the console. - """ - while True: - try: - perform_command(parse_user_input()) - except UserExitException: - break - except Exception as ex: - print('You have done something wrong!', ex) - - -if __name__ == '__main__': - try: - main() - except KeyboardInterrupt: - print() - print('Shutting down, bye!') diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/commands.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/commands.py" deleted file mode 100644 index dea1063..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/todo/commands.py" +++ /dev/null @@ -1,132 +0,0 @@ - -from todo.custom_exceptions import UserExitException -from todo.models import BaseItem -from todo.reflection import find_classes - - -class BaseCommand(object): - label: str - - def perform(self, store): - raise NotImplementedError() - - -class ListCommand(BaseCommand): - label = 'list' - - def perform(self, store): - if len(store.items) == 0: - print('There are no items in the storage.') - return - - for index, obj in enumerate(store.items): - print('{0}: {1}'.format(index, str(obj))) - - -class NewCommand(BaseCommand): - label = 'new' - - def perform(self, store): - classes = self._load_item_classes() - - print('Select item type:') - for index, name in enumerate(classes.keys()): - print('{0}: {1}'.format(index, name)) - - selection = None - selected_key = None - - while True: - try: - selected_key = self._select_item(classes) - except ValueError: - print('Bad input, try again.') - except IndexError: - print('Wrong index, try again.') - else: - break - - selected_class = classes[selected_key] - print('Selected: {0}'.format(selected_class.__name__)) - print() - - new_object = selected_class.construct() - - store.items.append(new_object) - - print('Added {0}'.format(str(new_object))) - print() - return new_object - - def _load_item_classes(self) -> dict: - # Dynamic load: - return dict(find_classes(BaseItem)) - - def _select_item(self, classes): - selection = int(input('Input number: ')) - if selection < 0: - raise IndexError('Index needs to be >0') - return list(classes.keys())[selection] - - -class BaseMarkCommand(object): - - def perform(self, store): - counts = 0 - - for obj in store.items: - if str(obj)[0] == self.char: - counts += 1 - - if counts == 0: - print('There are no {0}items in the storage.'.format(self.char)) - return - - for index, obj in enumerate(store.items): - if str(obj)[0] == self.char: - print('{0}: {1}'.format(index, str(obj))) - - selected_item = self.select_item(store) - - print('{0} has been {1}'.format(selected_item, self.operation)) - print() - - operation = getattr(selected_item, str(self.operation), None) - assert operation is not None - operation() - - def select_item(self, store): - while True: - try: - selection = int(input('Input number of item: ')) - if selection < 0 or str(store.items[selection])[0] != self.char: - raise IndexError('MarkCommand -> select_item') - except ValueError: - print('Bad input, try again.') - except IndexError: - print('Wrong index, try again.') - else: - break - - if store.items is None: - print('There are no items in the storage.') - return store.items[selection] - - -class DoneCommand(BaseMarkCommand, BaseCommand): - label = 'done' - operation = 'mark_done' - char = '-' - - -class UndoneCommand(BaseMarkCommand, BaseCommand): - label = 'undone' - operation = 'mark_undone' - char = '+' - - -class ExitCommand(BaseCommand): - label = 'exit' - - def perform(self, _store): - raise UserExitException('See you next time!') diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/custom_exceptions.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/custom_exceptions.py" deleted file mode 100644 index 5e8963c..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/todo/custom_exceptions.py" +++ /dev/null @@ -1,2 +0,0 @@ -class UserExitException(Exception): - """We use this exception when user wants to exit.""" diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/models.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/models.py" deleted file mode 100644 index aaaa03c..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/todo/models.py" +++ /dev/null @@ -1,77 +0,0 @@ -class BaseItem(object): - def __init__(self, heading): - self.heading = heading - self.done = False # TODO: make sure we can use it... - - def __repr__(self): - return self.__class__.__name__ - - def __str__(self): - return '{0} {1}'.format( - '+' if self.done else '-', - self.__repr__(), - ) - - def set_done(self, status: bool): - self.done = status - - def mark_done(self): - self.done = True - - def mark_undone(self): - self.done = False - - @classmethod - def construct(cls): - raise NotImplementedError() - - -class ToDoItem(BaseItem): - def __str__(self): - return '{0}: {1}'.format( - super().__str__(), - self.heading, - ) - - @classmethod - def construct(cls): - heading = input('Input heading: ') - return cls(heading) - - -class ToBuyItem(BaseItem): - def __init__(self, heading, price): - super().__init__(heading) - self.price = price - - def __str__(self): - return '{0}: {1} for {2}'.format( - super().__str__(), - self.heading, - self.price, - ) - - @classmethod - def construct(cls): - heading = input('Input heading: ') - price = input('Input price: ') - return cls(heading, price) - - -class ToReadItem(BaseItem): - def __init__(self, heading, url): - super().__init__(heading) - self.url = url - - def __str__(self): - return '{0}: {1} {2}'.format( - super().__str__(), - self.heading, - self.url, - ) - - @classmethod - def construct(cls): - heading = input('Input heading: ') - url = input('Input url: ') - return cls(heading, url) diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/reflection.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/reflection.py" deleted file mode 100644 index e16c6f6..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/todo/reflection.py" +++ /dev/null @@ -1,31 +0,0 @@ -import inspect -import sys - - -def find_classes(base_class) -> tuple: - """ - Finds all subclasses of a class inside module. - - :param base_class: Base class to search children. - :return: tuple of subclasses - """ - return inspect.getmembers(sys.modules[base_class.__module__], _reflect_filter(base_class),) - - -def _reflect_filter(base_class): - """ - Reflection is used to load modules dynamically. - - This method is complex. It does some dark magic. - How is it even possible to understand it? - - :param base_class: Target base class - :return: function to filter only subclasses of `base_class` - """ - def class_filter(klass): - return inspect.isclass( - klass, - ) and klass.__module__ == base_class.__module__ and issubclass( - klass, base_class, - ) and klass is not base_class - return class_filter diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/runtime.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/runtime.py" deleted file mode 100644 index c955fa3..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/todo/runtime.py" +++ /dev/null @@ -1,52 +0,0 @@ -from todo.commands import BaseCommand -from todo.custom_exceptions import UserExitException -from todo.reflection import find_classes -from todo.storage import Storage - - -def get_routes() -> dict: - """ - This function contains the dictionary of possible commands. - :return: `dict` of possible commands, with the format: `name -> class` - """ - routes = find_classes(BaseCommand) - return { - route().label: route - for _, route in routes - } - - -def perform_command(command: str) -> None: - """ - Performs the command by name. - Stores the result in `Storage()`. - :param command: command name, selected by user. - """ - command = command.lower() - routes = get_routes() - - try: - command_class = routes[command] - except KeyError: - print('Bad command, try again.') - return - - command_inst = command_class() - storage = Storage() - - try: - command_inst.perform(storage) - except UserExitException as ex: - # Handling `exit` command. - print(ex) - raise - - -def parse_user_input(): - """ - Gets the user input. - :return: `str` with the user input. - """ - commands = get_routes().keys() - message = 'Input your command: ({0}): '.format('|'.join(commands)) - return input(message) diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/storage.py" "b/homeworks/Yurin Andrey/\342\204\2264/todo/storage.py" deleted file mode 100644 index ef58690..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2264/todo/storage.py" +++ /dev/null @@ -1,21 +0,0 @@ -class Storage(object): # storage = Storge() - """ - Singleton storage. - - Read more about singleton design pattern: - https://stackoverflow.com/questions/6760685/creating-a-singleton-in-python - https://en.wikipedia.org/wiki/Singleton_pattern - - It is used to emulate in-memory storage. - It should be replaced with a database in a real application. - """ - - obj = None - items = None - - @classmethod - def __new__(cls, *args): - if cls.obj is None: - cls.obj = object.__new__(cls) - cls.items = [] - return cls.obj diff --git "a/homeworks/Yurin Andrey/\342\204\2264/todo/__init__.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/README.md" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2264/todo/__init__.py" rename to "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/README.md" diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__init__.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__init__.py" new file mode 100644 index 0000000..8b13789 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__init__.py" @@ -0,0 +1 @@ + diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__main__.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__main__.py" new file mode 100644 index 0000000..e12a4d3 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__main__.py" @@ -0,0 +1,17 @@ +from .cmdInput import cmd_input + + +def main(): + try: + cmd_input() + except Exception as ex: + print('You have done something wrong!', ex) + + +if __name__ == '__main__': + try: + main() + except KeyboardInterrupt: + print() + print('Shutting down, bye!') + diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" new file mode 100644 index 0000000..f159705 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" @@ -0,0 +1,17 @@ +import argparse +from .command import command + + +def cmd_input(): + parser = argparse.ArgumentParser() + parser.add_argument("operation", help="highlight 'any text' or cowsay 'any text' or time 'Region/City'" + "(example: Europe/Moscow)", + choices=["highlight", "cowsay", "time"]) + parser.add_argument("text") + args = parser.parse_args() + + try: + command(args.operation, args.text) + except Exception as ex: + command("help") + raise ex diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" new file mode 100644 index 0000000..65e37ad --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" @@ -0,0 +1,33 @@ +from pygments import highlight +from pygments.formatters import TerminalFormatter +from pygments.lexers import PythonLexer +from cowpy import cow +from datetime import datetime +import pytz + + +def command(operation: str, text: str = None) -> None: + functions[operation](text) if operation != "help" else functions[operation]() + + +def highlight_(code: str) -> None: + print(highlight(code, PythonLexer(), TerminalFormatter())) + + +def cowsay_(text: str) -> None: + print(cow.milk_random_cow(text)) + + +def time_(timezone: str) -> None: + local_date = datetime.now(pytz.timezone(timezone)) + print("{0} {1}".format(local_date.date(), local_date.time())) + + +def help_() -> None: + print("EXAMPLE COMMAND:") + print(" highlight 'any text'") + print(" cowsay 'any text'") + print(" time 'Region/City' (example: Europe/Moscow)") + + +functions = {'highlight': highlight_, "cowsay": cowsay_, "time": time_, "help": help_} diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/poetry.lock" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/poetry.lock" new file mode 100644 index 0000000..7edca04 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/poetry.lock" @@ -0,0 +1,406 @@ +[[package]] +name = "argparse" +version = "1.4.0" +description = "Python command-line parsing library" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "certifi" +version = "2022.9.24" +description = "Python package for providing Mozilla's CA Bundle." +category = "dev" +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 = "dev" +optional = false +python-versions = ">=3.6.0" + +[package.extras] +unicode-backport = ["unicodedata2"] + +[[package]] +name = "click" +version = "8.1.3" +description = "Composable command line interface toolkit" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.5" +description = "Cross-platform colored terminal text." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "cowpy" +version = "1.1.5" +description = "" +category = "main" +optional = false +python-versions = ">=3.6" + +[[package]] +name = "cowsay" +version = "5.0" +description = "The famous cowsay for GNU/Linux is now available for python" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "datetime" +version = "4.7" +description = "This package provides a DateTime data type, as known from Zope. Unless you need to communicate with Zope APIs, you're probably better off using Python's built-in datetime module." +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +pytz = "*" +"zope.interface" = "*" + +[[package]] +name = "dparse" +version = "0.6.2" +description = "A parser for Python dependency files" +category = "dev" +optional = false +python-versions = ">=3.5" + +[package.dependencies] +packaging = "*" +toml = "*" + +[package.extras] +conda = ["pyyaml"] +pipenv = ["pipenv"] + +[[package]] +name = "idna" +version = "3.4" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "dev" +optional = false +python-versions = ">=3.5" + +[[package]] +name = "packaging" +version = "21.3" +description = "Core utilities for Python packages" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" + +[[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 = "pyparsing" +version = "3.0.9" +description = "pyparsing module - Classes and methods to define and execute parsing grammars" +category = "dev" +optional = false +python-versions = ">=3.6.8" + +[package.extras] +diagrams = ["jinja2", "railroad-diagrams"] + +[[package]] +name = "pytz" +version = "2022.5" +description = "World timezone definitions, modern and historical" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "requests" +version = "2.28.1" +description = "Python HTTP for Humans." +category = "dev" +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 = "ruamel-yaml" +version = "0.17.21" +description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" +category = "dev" +optional = false +python-versions = ">=3" + +[package.dependencies] +"ruamel.yaml.clib" = {version = ">=0.2.6", markers = "platform_python_implementation == \"CPython\" and python_version < \"3.11\""} + +[package.extras] +docs = ["ryd"] +jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] + +[[package]] +name = "ruamel-yaml-clib" +version = "0.2.6" +description = "C version of reader, parser and emitter for ruamel.yaml derived from libyaml" +category = "dev" +optional = false +python-versions = ">=3.5" + +[[package]] +name = "safety" +version = "2.3.1" +description = "Checks installed dependencies for known vulnerabilities and licenses." +category = "dev" +optional = false +python-versions = "*" + +[package.dependencies] +Click = ">=8.0.2" +dparse = ">=0.6.2" +packaging = ">=21.0" +requests = "*" +"ruamel.yaml" = ">=0.17.21" +setuptools = ">=19.3" + +[package.extras] +github = ["jinja2 (>=3.1.0)", "pygithub (>=1.43.3)"] +gitlab = ["python-gitlab (>=1.3.0)"] + +[[package]] +name = "setuptools" +version = "65.5.0" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8 (<5)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mock", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] + +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "urllib3" +version = "1.26.12" +description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "dev" +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 = "zope-interface" +version = "5.5.0" +description = "Interfaces for Python" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.dependencies] +setuptools = "*" + +[package.extras] +docs = ["Sphinx", "repoze.sphinx.autointerface"] +test = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] +testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] + +[metadata] +lock-version = "1.1" +python-versions = "^3.10" +content-hash = "d036dc1a7cac361bea337634151b60e5959201bebcd5f35561850a3df446cc67" + +[metadata.files] +argparse = [ + {file = "argparse-1.4.0-py2.py3-none-any.whl", hash = "sha256:c31647edb69fd3d465a847ea3157d37bed1f95f19760b11a47aa91c04b666314"}, + {file = "argparse-1.4.0.tar.gz", hash = "sha256:62b089a55be1d8949cd2bc7e0df0bddb9e028faefc8c32038cc84862aefdd6e4"}, +] +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"}, +] +click = [ + {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, + {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, +] +colorama = [ + {file = "colorama-0.4.5-py2.py3-none-any.whl", hash = "sha256:854bf444933e37f5824ae7bfc1e98d5bce2ebe4160d46b5edf346a89358e99da"}, + {file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"}, +] +cowpy = [ + {file = "cowpy-1.1.5-py3-none-any.whl", hash = "sha256:de5ae7646dd30b4936013666c6bd019af9cf411cc3b377c8538cfd8414262921"}, + {file = "cowpy-1.1.5.tar.gz", hash = "sha256:089172db1d88c30a2e1b741b18945ee84170bd943a3ca71948e4ae3a3255e554"}, +] +cowsay = [ + {file = "cowsay-5.0.tar.gz", hash = "sha256:c00e02444f5bc7332826686bd44d963caabbaba9a804a63153822edce62bbbf3"}, +] +datetime = [ + {file = "DateTime-4.7-py2.py3-none-any.whl", hash = "sha256:b8d2d605cfb5fed0da86f9ad64d0973c6f84b21939d49265e135811b33ee8113"}, + {file = "DateTime-4.7.tar.gz", hash = "sha256:7ff7c4a857f08b73db17a85fc54f102d065ad16e7db0133e699c5f1b37e41478"}, +] +dparse = [ + {file = "dparse-0.6.2-py3-none-any.whl", hash = "sha256:8097076f1dd26c377f30d4745e6ec18fef42f3bf493933b842ac5bafad8c345f"}, + {file = "dparse-0.6.2.tar.gz", hash = "sha256:d45255bda21f998bc7ddf2afd5e62505ba6134756ba2d42a84c56b0826614dfe"}, +] +idna = [ + {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, + {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, +] +packaging = [ + {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, + {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, +] +pygments = [ + {file = "Pygments-2.13.0-py3-none-any.whl", hash = "sha256:f643f331ab57ba3c9d89212ee4a2dabc6e94f117cf4eefde99a0574720d14c42"}, + {file = "Pygments-2.13.0.tar.gz", hash = "sha256:56a8508ae95f98e2b9bdf93a6be5ae3f7d8af858b43e02c5a2ff083726be40c1"}, +] +pyparsing = [ + {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, + {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, +] +pytz = [ + {file = "pytz-2022.5-py2.py3-none-any.whl", hash = "sha256:335ab46900b1465e714b4fda4963d87363264eb662aab5e65da039c25f1f5b22"}, + {file = "pytz-2022.5.tar.gz", hash = "sha256:c4d88f472f54d615e9cd582a5004d1e5f624854a6a27a6211591c251f22a6914"}, +] +requests = [ + {file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"}, + {file = "requests-2.28.1.tar.gz", hash = "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"}, +] +ruamel-yaml = [ + {file = "ruamel.yaml-0.17.21-py3-none-any.whl", hash = "sha256:742b35d3d665023981bd6d16b3d24248ce5df75fdb4e2924e93a05c1f8b61ca7"}, + {file = "ruamel.yaml-0.17.21.tar.gz", hash = "sha256:8b7ce697a2f212752a35c1ac414471dc16c424c9573be4926b56ff3f5d23b7af"}, +] +ruamel-yaml-clib = [ + {file = "ruamel.yaml.clib-0.2.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:6e7be2c5bcb297f5b82fee9c665eb2eb7001d1050deaba8471842979293a80b0"}, + {file = "ruamel.yaml.clib-0.2.6-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:066f886bc90cc2ce44df8b5f7acfc6a7e2b2e672713f027136464492b0c34d7c"}, + {file = "ruamel.yaml.clib-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:221eca6f35076c6ae472a531afa1c223b9c29377e62936f61bc8e6e8bdc5f9e7"}, + {file = "ruamel.yaml.clib-0.2.6-cp310-cp310-win32.whl", hash = "sha256:1070ba9dd7f9370d0513d649420c3b362ac2d687fe78c6e888f5b12bf8bc7bee"}, + {file = "ruamel.yaml.clib-0.2.6-cp310-cp310-win_amd64.whl", hash = "sha256:77df077d32921ad46f34816a9a16e6356d8100374579bc35e15bab5d4e9377de"}, + {file = "ruamel.yaml.clib-0.2.6-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:cfdb9389d888c5b74af297e51ce357b800dd844898af9d4a547ffc143fa56751"}, + {file = "ruamel.yaml.clib-0.2.6-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:7b2927e92feb51d830f531de4ccb11b320255ee95e791022555971c466af4527"}, + {file = "ruamel.yaml.clib-0.2.6-cp35-cp35m-win32.whl", hash = "sha256:ada3f400d9923a190ea8b59c8f60680c4ef8a4b0dfae134d2f2ff68429adfab5"}, + {file = "ruamel.yaml.clib-0.2.6-cp35-cp35m-win_amd64.whl", hash = "sha256:de9c6b8a1ba52919ae919f3ae96abb72b994dd0350226e28f3686cb4f142165c"}, + {file = "ruamel.yaml.clib-0.2.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d67f273097c368265a7b81e152e07fb90ed395df6e552b9fa858c6d2c9f42502"}, + {file = "ruamel.yaml.clib-0.2.6-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:72a2b8b2ff0a627496aad76f37a652bcef400fd861721744201ef1b45199ab78"}, + {file = "ruamel.yaml.clib-0.2.6-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:d3c620a54748a3d4cf0bcfe623e388407c8e85a4b06b8188e126302bcab93ea8"}, + {file = "ruamel.yaml.clib-0.2.6-cp36-cp36m-win32.whl", hash = "sha256:9efef4aab5353387b07f6b22ace0867032b900d8e91674b5d8ea9150db5cae94"}, + {file = "ruamel.yaml.clib-0.2.6-cp36-cp36m-win_amd64.whl", hash = "sha256:846fc8336443106fe23f9b6d6b8c14a53d38cef9a375149d61f99d78782ea468"}, + {file = "ruamel.yaml.clib-0.2.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0847201b767447fc33b9c235780d3aa90357d20dd6108b92be544427bea197dd"}, + {file = "ruamel.yaml.clib-0.2.6-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:78988ed190206672da0f5d50c61afef8f67daa718d614377dcd5e3ed85ab4a99"}, + {file = "ruamel.yaml.clib-0.2.6-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:210c8fcfeff90514b7133010bf14e3bad652c8efde6b20e00c43854bf94fa5a6"}, + {file = "ruamel.yaml.clib-0.2.6-cp37-cp37m-win32.whl", hash = "sha256:a49e0161897901d1ac9c4a79984b8410f450565bbad64dbfcbf76152743a0cdb"}, + {file = "ruamel.yaml.clib-0.2.6-cp37-cp37m-win_amd64.whl", hash = "sha256:bf75d28fa071645c529b5474a550a44686821decebdd00e21127ef1fd566eabe"}, + {file = "ruamel.yaml.clib-0.2.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a32f8d81ea0c6173ab1b3da956869114cae53ba1e9f72374032e33ba3118c233"}, + {file = "ruamel.yaml.clib-0.2.6-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7f7ecb53ae6848f959db6ae93bdff1740e651809780822270eab111500842a84"}, + {file = "ruamel.yaml.clib-0.2.6-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:61bc5e5ca632d95925907c569daa559ea194a4d16084ba86084be98ab1cec1c6"}, + {file = "ruamel.yaml.clib-0.2.6-cp38-cp38-win32.whl", hash = "sha256:89221ec6d6026f8ae859c09b9718799fea22c0e8da8b766b0b2c9a9ba2db326b"}, + {file = "ruamel.yaml.clib-0.2.6-cp38-cp38-win_amd64.whl", hash = "sha256:31ea73e564a7b5fbbe8188ab8b334393e06d997914a4e184975348f204790277"}, + {file = "ruamel.yaml.clib-0.2.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:dc6a613d6c74eef5a14a214d433d06291526145431c3b964f5e16529b1842bed"}, + {file = "ruamel.yaml.clib-0.2.6-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:1866cf2c284a03b9524a5cc00daca56d80057c5ce3cdc86a52020f4c720856f0"}, + {file = "ruamel.yaml.clib-0.2.6-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:1b4139a6ffbca8ef60fdaf9b33dec05143ba746a6f0ae0f9d11d38239211d335"}, + {file = "ruamel.yaml.clib-0.2.6-cp39-cp39-win32.whl", hash = "sha256:3fb9575a5acd13031c57a62cc7823e5d2ff8bc3835ba4d94b921b4e6ee664104"}, + {file = "ruamel.yaml.clib-0.2.6-cp39-cp39-win_amd64.whl", hash = "sha256:825d5fccef6da42f3c8eccd4281af399f21c02b32d98e113dbc631ea6a6ecbc7"}, + {file = "ruamel.yaml.clib-0.2.6.tar.gz", hash = "sha256:4ff604ce439abb20794f05613c374759ce10e3595d1867764dd1ae675b85acbd"}, +] +safety = [ + {file = "safety-2.3.1-py3-none-any.whl", hash = "sha256:8f098d12b607db2756886280e85c28ece8db1bba4f45fc5f981f4663217bd619"}, + {file = "safety-2.3.1.tar.gz", hash = "sha256:6e6fcb7d4e8321098cf289f59b65051cafd3467f089c6e57c9f894ae32c23b71"}, +] +setuptools = [ + {file = "setuptools-65.5.0-py3-none-any.whl", hash = "sha256:f62ea9da9ed6289bfe868cd6845968a2c854d1427f8548d52cae02a42b4f0356"}, + {file = "setuptools-65.5.0.tar.gz", hash = "sha256:512e5536220e38146176efb833d4a62aa726b7bbff82cfbc8ba9eaa3996e0b17"}, +] +toml = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] +urllib3 = [ + {file = "urllib3-1.26.12-py2.py3-none-any.whl", hash = "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997"}, + {file = "urllib3-1.26.12.tar.gz", hash = "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"}, +] +zope-interface = [ + {file = "zope.interface-5.5.0-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:2cb3003941f5f4fa577479ac6d5db2b940acb600096dd9ea9bf07007f5cab46f"}, + {file = "zope.interface-5.5.0-cp27-cp27m-win32.whl", hash = "sha256:8c791f4c203ccdbcda588ea4c8a6e4353e10435ea48ddd3d8734a26fe9714cba"}, + {file = "zope.interface-5.5.0-cp27-cp27m-win_amd64.whl", hash = "sha256:3eedf3d04179774d750e8bb4463e6da350956a50ed44d7b86098e452d7ec385e"}, + {file = "zope.interface-5.5.0-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:58a66c2020a347973168a4a9d64317bac52f9fdfd3e6b80b252be30da881a64e"}, + {file = "zope.interface-5.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da7912ae76e1df6a1fb841b619110b1be4c86dfb36699d7fd2f177105cdea885"}, + {file = "zope.interface-5.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:423c074e404f13e6fa07f4454f47fdbb38d358be22945bc812b94289d9142374"}, + {file = "zope.interface-5.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:7bdcec93f152e0e1942102537eed7b166d6661ae57835b20a52a2a3d6a3e1bf3"}, + {file = "zope.interface-5.5.0-cp310-cp310-win32.whl", hash = "sha256:03f5ae315db0d0de668125d983e2a819a554f3fdb2d53b7e934e3eb3c3c7375d"}, + {file = "zope.interface-5.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:8b9f153208d74ccfa25449a0c6cb756ab792ce0dc99d9d771d935f039b38740c"}, + {file = "zope.interface-5.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aeac590cce44e68ee8ad0b8ecf4d7bf15801f102d564ca1b0eb1f12f584ee656"}, + {file = "zope.interface-5.5.0-cp35-cp35m-win32.whl", hash = "sha256:7d9ec1e6694af39b687045712a8ad14ddcb568670d5eb1b66b48b98b9312afba"}, + {file = "zope.interface-5.5.0-cp35-cp35m-win_amd64.whl", hash = "sha256:d18fb0f6c8169d26044128a2e7d3c39377a8a151c564e87b875d379dbafd3930"}, + {file = "zope.interface-5.5.0-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:0eb2b3e84f48dd9cfc8621c80fba905d7e228615c67f76c7df7c716065669bb6"}, + {file = "zope.interface-5.5.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df6593e150d13cfcce69b0aec5df7bc248cb91e4258a7374c129bb6d56b4e5ca"}, + {file = "zope.interface-5.5.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:9dc4493aa3d87591e3d2bf1453e25b98038c839ca8e499df3d7106631b66fe83"}, + {file = "zope.interface-5.5.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5c6023ae7defd052cf76986ce77922177b0c2f3913bea31b5b28fbdf6cb7099e"}, + {file = "zope.interface-5.5.0-cp36-cp36m-win32.whl", hash = "sha256:a69c28d85bb7cf557751a5214cb3f657b2b035c8c96d71080c1253b75b79b69b"}, + {file = "zope.interface-5.5.0-cp36-cp36m-win_amd64.whl", hash = "sha256:85dd6dd9aaae7a176948d8bb62e20e2968588fd787c29c5d0d964ab475168d3d"}, + {file = "zope.interface-5.5.0-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:970661ece2029915b8f7f70892e88404340fbdefd64728380cad41c8dce14ff4"}, + {file = "zope.interface-5.5.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e3495bb0cdcea212154e558082c256f11b18031f05193ae2fb85d048848db14"}, + {file = "zope.interface-5.5.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:3f68404edb1a4fb6aa8a94675521ca26c83ebbdbb90e894f749ae0dc4ca98418"}, + {file = "zope.interface-5.5.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:740f3c1b44380658777669bcc42f650f5348e53797f2cee0d93dc9b0f9d7cc69"}, + {file = "zope.interface-5.5.0-cp37-cp37m-win32.whl", hash = "sha256:006f8dd81fae28027fc28ada214855166712bf4f0bfbc5a8788f9b70982b9437"}, + {file = "zope.interface-5.5.0-cp37-cp37m-win_amd64.whl", hash = "sha256:43490ad65d4c64e45a30e51a2beb7a6b63e1ff395302ad22392224eb618476d6"}, + {file = "zope.interface-5.5.0-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:f70726b60009433111fe9928f5d89cbb18962411d33c45fb19eb81b9bbd26fcd"}, + {file = "zope.interface-5.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfa614d049667bed1c737435c609c0956c5dc0dbafdc1145ee7935e4658582cb"}, + {file = "zope.interface-5.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:58a975f89e4584d0223ab813c5ba4787064c68feef4b30d600f5e01de90ae9ce"}, + {file = "zope.interface-5.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:37ec9ade9902f412cc7e7a32d71f79dec3035bad9bd0170226252eed88763c48"}, + {file = "zope.interface-5.5.0-cp38-cp38-win32.whl", hash = "sha256:be11fce0e6af6c0e8d93c10ef17b25aa7c4acb7ec644bff2596c0d639c49e20f"}, + {file = "zope.interface-5.5.0-cp38-cp38-win_amd64.whl", hash = "sha256:cbbf83914b9a883ab324f728de869f4e406e0cbcd92df7e0a88decf6f9ab7d5a"}, + {file = "zope.interface-5.5.0-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:26c1456520fdcafecc5765bec4783eeafd2e893eabc636908f50ee31fe5c738c"}, + {file = "zope.interface-5.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47ff078734a1030c48103422a99e71a7662d20258c00306546441adf689416f7"}, + {file = "zope.interface-5.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:687cab7f9ae18d2c146f315d0ca81e5ffe89a139b88277afa70d52f632515854"}, + {file = "zope.interface-5.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d80f6236b57a95eb19d5e47eb68d0296119e1eff6deaa2971ab8abe3af918420"}, + {file = "zope.interface-5.5.0-cp39-cp39-win32.whl", hash = "sha256:9cdc4e898d3b1547d018829fd4a9f403e52e51bba24be0fbfa37f3174e1ef797"}, + {file = "zope.interface-5.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:6566b3d2657e7609cd8751bcb1eab1202b1692a7af223035a5887d64bb3a2f3b"}, + {file = "zope.interface-5.5.0.tar.gz", hash = "sha256:700ebf9662cf8df70e2f0cb4988e078c53f65ee3eefd5c9d80cf988c4175c8e3"}, +] diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/pyproject.toml" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/pyproject.toml" new file mode 100644 index 0000000..b090d3c --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/pyproject.toml" @@ -0,0 +1,28 @@ +[tool.poetry] +name = "my-awesome-script" +version = "0.1.0" +description = "" +authors = ["Your Namxobick "] +readme = "README.md" +packages = [{include = "my_awesome_script"}] + +[tool.poetry.dependencies] +python = "^3.10" +pygments = "^2.13.0" +argparse = "^1.4.0" +cowpy = "^1.1.5" +cowsay = "^5.0" +pytz = "^2022.4" +datetime = "^4.7" + + +[tool.poetry.group.dev.dependencies] +safety = "^2.3.1" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + +[tool.poetry.scripts] +my_awesome_script = "my_awesome_script.__main__:main" + diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/tests/__init__.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/tests/__init__.py" new file mode 100644 index 0000000..e69de29 diff --git "a/practice/\342\204\2261/game_15_puzzle.py" "b/practice/\342\204\2261/game_15_puzzle.py" deleted file mode 100644 index 320d9dd..0000000 --- "a/practice/\342\204\2261/game_15_puzzle.py" +++ /dev/null @@ -1,89 +0,0 @@ -import random - -EMPTY_MARK = 'x' - -MOVES = { - 'w': -4, - 's': 4, - 'a': -1, - 'd': 1, -} - - -def shuffle_field(gameMap): - mixingDepth = random.randint(50, 100) - for i in range(mixingDepth): - key = random.choice(["w", "s", "d", "a"]) - perform_move(gameMap, key) - return gameMap - pass - - -def print_field(gameMap): - for i in range(len(gameMap)): - if i % 4 == 0 and i != 0: - print() - print(gameMap[i], end=' ') - pass - - -def is_game_finished(gameMap): - if gameMap[:len(gameMap) - 1] == [(i + 1) for i in range(15)]: - return True - else: - return False - pass - - -def perform_move(gameMap, key): - indexEmptyTile = gameMap.index('x') - - if key == 'w': - if indexEmptyTile in [12, 13, 14, 15]: - return None - else: - gameMap[indexEmptyTile], gameMap[indexEmptyTile + 4] = gameMap[indexEmptyTile + 4], gameMap[indexEmptyTile] - - elif key == 's': - if indexEmptyTile in [0, 1, 2, 3]: - return None - else: - gameMap[indexEmptyTile], gameMap[indexEmptyTile - 4] = gameMap[indexEmptyTile - 4], gameMap[indexEmptyTile] - - elif key == 'a': - if indexEmptyTile in [3, 7, 11, 15]: - return None - else: - gameMap[indexEmptyTile], gameMap[indexEmptyTile + 1] = gameMap[indexEmptyTile + 1], gameMap[indexEmptyTile] - else: - if indexEmptyTile in [0, 4, 8, 12]: - return None - else: - gameMap[indexEmptyTile], gameMap[indexEmptyTile - 1] = gameMap[indexEmptyTile - 1], gameMap[indexEmptyTile] - pass - - -def handle_user_input(): - print() - key = input() - return key - - pass - - -def main(): - GameMap = shuffle_field([(i + 1) for i in range(15)] + [EMPTY_MARK]) - - while not(is_game_finished(GameMap)): - print_field(GameMap) - perform_move(GameMap, handle_user_input()) - print("WIN") - - pass - - -if __name__ == '__main__': - - main() - - diff --git "a/practice/\342\204\2262/exceptions.py" "b/practice/\342\204\2262/exceptions.py" deleted file mode 100644 index 2e4d3bb..0000000 --- "a/practice/\342\204\2262/exceptions.py" +++ /dev/null @@ -1,161 +0,0 @@ -import math - - -def call_system_exit(): - try: - exit() - except SystemExit: - print('SystemExit') - - -def call_generator_exit(): - def generate(): - values = [0, 1] - for value in values: - try: - yield value - - except GeneratorExit: - print('GeneratorExit') - raise - - my_generator = generate() - next(my_generator) - my_generator.close() - - -def call_runtime_error(): - def generate(): - values = [0, 1] - for value in values: - try: - yield value - - except RuntimeError: - print('RuntimeError') - - my_generator = generate() - next(my_generator) - my_generator.close() - - -def call_stop_iteration(): - def generate(): - for value in [0]: - yield value - return - - my_generator = generate() - for i in range(2): - try: - next(my_generator) - except StopIteration: - print("StopIteration") - - -def call_overflow_error(): - results = [] - for i in range(1000): - try: - results.append(math.exp(i)) - except OverflowError: - print("OverflowError") - return - - -def call_zero_division_error(): - try: - x = 1 / 0 - except ZeroDivisionError: - print("ZeroDivisionError") - - -def call_assertion_error(): - try: - assert 0 == 1 - except AssertionError: - print("AssertionError") - - -def call_attribute_error(): - my_str = 'my' - try: - my_str.noattr - except AttributeError: - print("AttributeError") - - -def call_value_error(): - try: - chr(-100) - except ValueError: - print("ValueError") - - -def call_index_error(): - a = [] - try: - a[1] - except IndexError: - print("IndexError") - - -def call_key_error(): - my_dict = {0: 0} - try: - my_dict[1] - except KeyError: - print("KeyError") - - -def call_file_not_found_error(): - try: - f = open('') - except FileNotFoundError: - print('FileNotFoundError') - - -def call_memory_error(): - try: - x = list(range(10000000000)) - except MemoryError: - print('MemoryError') - - -def call_type_error(): - try: - x = 'a' + 5 - except TypeError: - print('TypeError') - - -def call_recursion_error(): - try: - call_recursion_error() - except RecursionError: - print('RecursionError') - - -def call_unicode_decoder_error(): - try: - b'\xd0'.decode('utf-8') - except UnicodeDecodeError: - print('UnicodeDecodeError') - - -call_system_exit() -call_generator_exit() -call_runtime_error() -call_stop_iteration() -call_overflow_error() -call_zero_division_error() -call_assertion_error() -call_attribute_error() -call_value_error() -call_index_error() -call_key_error() -call_file_not_found_error() -call_memory_error() -call_type_error() -call_recursion_error() -call_unicode_decoder_error() From 7fab8cf22fb27a726e1439d5ce6626da3bebabc8 Mon Sep 17 00:00:00 2001 From: Namxobick <100288192+Namxobick@users.noreply.github.com> Date: Wed, 19 Oct 2022 19:47:09 +0300 Subject: [PATCH 08/18] Update command.py --- .../my-awesome-script/my_awesome_script/command.py" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" index 65e37ad..7d0ec6c 100644 --- "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" +++ "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" @@ -7,7 +7,7 @@ def command(operation: str, text: str = None) -> None: - functions[operation](text) if operation != "help" else functions[operation]() + functions[operation]() if operation == 'help' else functions[operation](text) def highlight_(code: str) -> None: @@ -30,4 +30,4 @@ def help_() -> None: print(" time 'Region/City' (example: Europe/Moscow)") -functions = {'highlight': highlight_, "cowsay": cowsay_, "time": time_, "help": help_} +functions = {'highlight': highlight_, 'cowsay': cowsay_, 'time': time_, 'help': help_} From bf39444ef98bb619e38344fdac05f1916cafeb90 Mon Sep 17 00:00:00 2001 From: Namxobick <100288192+Namxobick@users.noreply.github.com> Date: Wed, 19 Oct 2022 19:50:37 +0300 Subject: [PATCH 09/18] Update cmdInput.py --- .../my_awesome_script/cmdInput.py" | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" index f159705..aebf2c5 100644 --- "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" +++ "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" @@ -1,17 +1,17 @@ import argparse -from .command import command + +from .command import command, functions def cmd_input(): + """Input method.""" parser = argparse.ArgumentParser() - parser.add_argument("operation", help="highlight 'any text' or cowsay 'any text' or time 'Region/City'" - "(example: Europe/Moscow)", - choices=["highlight", "cowsay", "time"]) - parser.add_argument("text") + parser.add_argument('operation', help='input command', choices=functions) + parser.add_argument('parameter', help="'Any text' or 'Region/City'") args = parser.parse_args() try: - command(args.operation, args.text) + command(args.operation, args.parameter) except Exception as ex: - command("help") + command('help') raise ex From 3c3e026c155dfe91d318f3795443e82944cf7154 Mon Sep 17 00:00:00 2001 From: Namxobick <100288192+Namxobick@users.noreply.github.com> Date: Wed, 19 Oct 2022 19:51:59 +0300 Subject: [PATCH 10/18] Update command.py --- .../my-awesome-script/my_awesome_script/command.py" | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" index 7d0ec6c..a8df3a2 100644 --- "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" +++ "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" @@ -1,9 +1,11 @@ + +from datetime import datetime + +import pytz +from cowpy import cow from pygments import highlight from pygments.formatters import TerminalFormatter from pygments.lexers import PythonLexer -from cowpy import cow -from datetime import datetime -import pytz def command(operation: str, text: str = None) -> None: @@ -24,7 +26,7 @@ def time_(timezone: str) -> None: def help_() -> None: - print("EXAMPLE COMMAND:") + print('EXAMPLE COMMAND:') print(" highlight 'any text'") print(" cowsay 'any text'") print(" time 'Region/City' (example: Europe/Moscow)") From 9c97217556a4c78400296113bf7073b3c9ae840f Mon Sep 17 00:00:00 2001 From: Namxobick <100288192+Namxobick@users.noreply.github.com> Date: Wed, 19 Oct 2022 19:53:42 +0300 Subject: [PATCH 11/18] Update cmdInput.py --- .../my-awesome-script/my_awesome_script/cmdInput.py" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" index aebf2c5..04bfc96 100644 --- "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" +++ "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" @@ -6,7 +6,7 @@ def cmd_input(): """Input method.""" parser = argparse.ArgumentParser() - parser.add_argument('operation', help='input command', choices=functions) + parser.add_argument('operation', help='Input command', choices=functions) parser.add_argument('parameter', help="'Any text' or 'Region/City'") args = parser.parse_args() From 9adf179292473e8c4dd28fc00c4bac6ca5a253c6 Mon Sep 17 00:00:00 2001 From: Namxobick Date: Tue, 25 Oct 2022 23:36:30 +0300 Subject: [PATCH 12/18] Add HW6 --- .../my-awesome-script/README.md" | 0 .../my_awesome_script/__init__.py" | 1 - .../my_awesome_script/__main__.py" | 17 - .../my_awesome_script/cmdInput.py" | 17 - .../my_awesome_script/command.py" | 35 - .../my-awesome-script/poetry.lock" | 406 ---------- .../my-awesome-script/pyproject.toml" | 28 - .../\342\204\2266/.idea/.gitignore" | 3 + .../Yurin Andrey/\342\204\2266/.idea/HW6.iml" | 8 + .../inspectionProfiles/profiles_settings.xml" | 6 + .../\342\204\2266/.idea/misc.xml" | 4 + .../\342\204\2266/.idea/modules.xml" | 8 + .../\342\204\2266/files/email/email.csv" | 2 + .../\342\204\2266/files/users/1.xml" | 201 +++++ .../\342\204\2266/files/users/2.xml" | 201 +++++ .../\342\204\2266/files/users/5.xml" | 201 +++++ .../Yurin Andrey/\342\204\2266/poetry.lock" | 739 ++++++++++++++++++ .../\342\204\2266/pyproject.toml" | 17 + .../Yurin Andrey/\342\204\2266/setup.cfg" | 97 +++ .../\342\204\2266/todo/__init__.py" | 0 .../\342\204\2266/todo/__main__.py" | 21 + .../Yurin Andrey/\342\204\2266/todo/basic.py" | 51 ++ .../\342\204\2266/todo/json_parsing.py" | 66 ++ .../\342\204\2266/todo/read_csv_file.py" | 20 + .../\342\204\2266/todo/writer_xml.py" | 61 ++ 25 files changed, 1706 insertions(+), 504 deletions(-) delete mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/README.md" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__init__.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__main__.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/poetry.lock" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/pyproject.toml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/.idea/.gitignore" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/.idea/HW6.iml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/.idea/inspectionProfiles/profiles_settings.xml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/.idea/misc.xml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/.idea/modules.xml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/files/email/email.csv" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/files/users/1.xml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/files/users/2.xml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/files/users/5.xml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/poetry.lock" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/pyproject.toml" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/setup.cfg" rename "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/tests/__init__.py" => "homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" (100%) create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/todo/__main__.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/todo/basic.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/todo/json_parsing.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/todo/read_csv_file.py" create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/todo/writer_xml.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/README.md" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/README.md" deleted file mode 100644 index e69de29..0000000 diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__init__.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__init__.py" deleted file mode 100644 index 8b13789..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__init__.py" +++ /dev/null @@ -1 +0,0 @@ - diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__main__.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__main__.py" deleted file mode 100644 index e12a4d3..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/__main__.py" +++ /dev/null @@ -1,17 +0,0 @@ -from .cmdInput import cmd_input - - -def main(): - try: - cmd_input() - except Exception as ex: - print('You have done something wrong!', ex) - - -if __name__ == '__main__': - try: - main() - except KeyboardInterrupt: - print() - print('Shutting down, bye!') - diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" deleted file mode 100644 index 04bfc96..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/cmdInput.py" +++ /dev/null @@ -1,17 +0,0 @@ -import argparse - -from .command import command, functions - - -def cmd_input(): - """Input method.""" - parser = argparse.ArgumentParser() - parser.add_argument('operation', help='Input command', choices=functions) - parser.add_argument('parameter', help="'Any text' or 'Region/City'") - args = parser.parse_args() - - try: - command(args.operation, args.parameter) - except Exception as ex: - command('help') - raise ex diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" deleted file mode 100644 index a8df3a2..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/my_awesome_script/command.py" +++ /dev/null @@ -1,35 +0,0 @@ - -from datetime import datetime - -import pytz -from cowpy import cow -from pygments import highlight -from pygments.formatters import TerminalFormatter -from pygments.lexers import PythonLexer - - -def command(operation: str, text: str = None) -> None: - functions[operation]() if operation == 'help' else functions[operation](text) - - -def highlight_(code: str) -> None: - print(highlight(code, PythonLexer(), TerminalFormatter())) - - -def cowsay_(text: str) -> None: - print(cow.milk_random_cow(text)) - - -def time_(timezone: str) -> None: - local_date = datetime.now(pytz.timezone(timezone)) - print("{0} {1}".format(local_date.date(), local_date.time())) - - -def help_() -> None: - print('EXAMPLE COMMAND:') - print(" highlight 'any text'") - print(" cowsay 'any text'") - print(" time 'Region/City' (example: Europe/Moscow)") - - -functions = {'highlight': highlight_, 'cowsay': cowsay_, 'time': time_, 'help': help_} diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/poetry.lock" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/poetry.lock" deleted file mode 100644 index 7edca04..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/poetry.lock" +++ /dev/null @@ -1,406 +0,0 @@ -[[package]] -name = "argparse" -version = "1.4.0" -description = "Python command-line parsing library" -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "certifi" -version = "2022.9.24" -description = "Python package for providing Mozilla's CA Bundle." -category = "dev" -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 = "dev" -optional = false -python-versions = ">=3.6.0" - -[package.extras] -unicode-backport = ["unicodedata2"] - -[[package]] -name = "click" -version = "8.1.3" -description = "Composable command line interface toolkit" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} - -[[package]] -name = "colorama" -version = "0.4.5" -description = "Cross-platform colored terminal text." -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[[package]] -name = "cowpy" -version = "1.1.5" -description = "" -category = "main" -optional = false -python-versions = ">=3.6" - -[[package]] -name = "cowsay" -version = "5.0" -description = "The famous cowsay for GNU/Linux is now available for python" -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "datetime" -version = "4.7" -description = "This package provides a DateTime data type, as known from Zope. Unless you need to communicate with Zope APIs, you're probably better off using Python's built-in datetime module." -category = "main" -optional = false -python-versions = "*" - -[package.dependencies] -pytz = "*" -"zope.interface" = "*" - -[[package]] -name = "dparse" -version = "0.6.2" -description = "A parser for Python dependency files" -category = "dev" -optional = false -python-versions = ">=3.5" - -[package.dependencies] -packaging = "*" -toml = "*" - -[package.extras] -conda = ["pyyaml"] -pipenv = ["pipenv"] - -[[package]] -name = "idna" -version = "3.4" -description = "Internationalized Domain Names in Applications (IDNA)" -category = "dev" -optional = false -python-versions = ">=3.5" - -[[package]] -name = "packaging" -version = "21.3" -description = "Core utilities for Python packages" -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" - -[[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 = "pyparsing" -version = "3.0.9" -description = "pyparsing module - Classes and methods to define and execute parsing grammars" -category = "dev" -optional = false -python-versions = ">=3.6.8" - -[package.extras] -diagrams = ["jinja2", "railroad-diagrams"] - -[[package]] -name = "pytz" -version = "2022.5" -description = "World timezone definitions, modern and historical" -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "requests" -version = "2.28.1" -description = "Python HTTP for Humans." -category = "dev" -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 = "ruamel-yaml" -version = "0.17.21" -description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" -category = "dev" -optional = false -python-versions = ">=3" - -[package.dependencies] -"ruamel.yaml.clib" = {version = ">=0.2.6", markers = "platform_python_implementation == \"CPython\" and python_version < \"3.11\""} - -[package.extras] -docs = ["ryd"] -jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] - -[[package]] -name = "ruamel-yaml-clib" -version = "0.2.6" -description = "C version of reader, parser and emitter for ruamel.yaml derived from libyaml" -category = "dev" -optional = false -python-versions = ">=3.5" - -[[package]] -name = "safety" -version = "2.3.1" -description = "Checks installed dependencies for known vulnerabilities and licenses." -category = "dev" -optional = false -python-versions = "*" - -[package.dependencies] -Click = ">=8.0.2" -dparse = ">=0.6.2" -packaging = ">=21.0" -requests = "*" -"ruamel.yaml" = ">=0.17.21" -setuptools = ">=19.3" - -[package.extras] -github = ["jinja2 (>=3.1.0)", "pygithub (>=1.43.3)"] -gitlab = ["python-gitlab (>=1.3.0)"] - -[[package]] -name = "setuptools" -version = "65.5.0" -description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "main" -optional = false -python-versions = ">=3.7" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8 (<5)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mock", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] - -[[package]] -name = "toml" -version = "0.10.2" -description = "Python Library for Tom's Obvious, Minimal Language" -category = "dev" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" - -[[package]] -name = "urllib3" -version = "1.26.12" -description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "dev" -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 = "zope-interface" -version = "5.5.0" -description = "Interfaces for Python" -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[package.dependencies] -setuptools = "*" - -[package.extras] -docs = ["Sphinx", "repoze.sphinx.autointerface"] -test = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] -testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] - -[metadata] -lock-version = "1.1" -python-versions = "^3.10" -content-hash = "d036dc1a7cac361bea337634151b60e5959201bebcd5f35561850a3df446cc67" - -[metadata.files] -argparse = [ - {file = "argparse-1.4.0-py2.py3-none-any.whl", hash = "sha256:c31647edb69fd3d465a847ea3157d37bed1f95f19760b11a47aa91c04b666314"}, - {file = "argparse-1.4.0.tar.gz", hash = "sha256:62b089a55be1d8949cd2bc7e0df0bddb9e028faefc8c32038cc84862aefdd6e4"}, -] -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"}, -] -click = [ - {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, - {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, -] -colorama = [ - {file = "colorama-0.4.5-py2.py3-none-any.whl", hash = "sha256:854bf444933e37f5824ae7bfc1e98d5bce2ebe4160d46b5edf346a89358e99da"}, - {file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"}, -] -cowpy = [ - {file = "cowpy-1.1.5-py3-none-any.whl", hash = "sha256:de5ae7646dd30b4936013666c6bd019af9cf411cc3b377c8538cfd8414262921"}, - {file = "cowpy-1.1.5.tar.gz", hash = "sha256:089172db1d88c30a2e1b741b18945ee84170bd943a3ca71948e4ae3a3255e554"}, -] -cowsay = [ - {file = "cowsay-5.0.tar.gz", hash = "sha256:c00e02444f5bc7332826686bd44d963caabbaba9a804a63153822edce62bbbf3"}, -] -datetime = [ - {file = "DateTime-4.7-py2.py3-none-any.whl", hash = "sha256:b8d2d605cfb5fed0da86f9ad64d0973c6f84b21939d49265e135811b33ee8113"}, - {file = "DateTime-4.7.tar.gz", hash = "sha256:7ff7c4a857f08b73db17a85fc54f102d065ad16e7db0133e699c5f1b37e41478"}, -] -dparse = [ - {file = "dparse-0.6.2-py3-none-any.whl", hash = "sha256:8097076f1dd26c377f30d4745e6ec18fef42f3bf493933b842ac5bafad8c345f"}, - {file = "dparse-0.6.2.tar.gz", hash = "sha256:d45255bda21f998bc7ddf2afd5e62505ba6134756ba2d42a84c56b0826614dfe"}, -] -idna = [ - {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, - {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, -] -packaging = [ - {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, - {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, -] -pygments = [ - {file = "Pygments-2.13.0-py3-none-any.whl", hash = "sha256:f643f331ab57ba3c9d89212ee4a2dabc6e94f117cf4eefde99a0574720d14c42"}, - {file = "Pygments-2.13.0.tar.gz", hash = "sha256:56a8508ae95f98e2b9bdf93a6be5ae3f7d8af858b43e02c5a2ff083726be40c1"}, -] -pyparsing = [ - {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, - {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, -] -pytz = [ - {file = "pytz-2022.5-py2.py3-none-any.whl", hash = "sha256:335ab46900b1465e714b4fda4963d87363264eb662aab5e65da039c25f1f5b22"}, - {file = "pytz-2022.5.tar.gz", hash = "sha256:c4d88f472f54d615e9cd582a5004d1e5f624854a6a27a6211591c251f22a6914"}, -] -requests = [ - {file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"}, - {file = "requests-2.28.1.tar.gz", hash = "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"}, -] -ruamel-yaml = [ - {file = "ruamel.yaml-0.17.21-py3-none-any.whl", hash = "sha256:742b35d3d665023981bd6d16b3d24248ce5df75fdb4e2924e93a05c1f8b61ca7"}, - {file = "ruamel.yaml-0.17.21.tar.gz", hash = "sha256:8b7ce697a2f212752a35c1ac414471dc16c424c9573be4926b56ff3f5d23b7af"}, -] -ruamel-yaml-clib = [ - {file = "ruamel.yaml.clib-0.2.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:6e7be2c5bcb297f5b82fee9c665eb2eb7001d1050deaba8471842979293a80b0"}, - {file = "ruamel.yaml.clib-0.2.6-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:066f886bc90cc2ce44df8b5f7acfc6a7e2b2e672713f027136464492b0c34d7c"}, - {file = "ruamel.yaml.clib-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:221eca6f35076c6ae472a531afa1c223b9c29377e62936f61bc8e6e8bdc5f9e7"}, - {file = "ruamel.yaml.clib-0.2.6-cp310-cp310-win32.whl", hash = "sha256:1070ba9dd7f9370d0513d649420c3b362ac2d687fe78c6e888f5b12bf8bc7bee"}, - {file = "ruamel.yaml.clib-0.2.6-cp310-cp310-win_amd64.whl", hash = "sha256:77df077d32921ad46f34816a9a16e6356d8100374579bc35e15bab5d4e9377de"}, - {file = "ruamel.yaml.clib-0.2.6-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:cfdb9389d888c5b74af297e51ce357b800dd844898af9d4a547ffc143fa56751"}, - {file = "ruamel.yaml.clib-0.2.6-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:7b2927e92feb51d830f531de4ccb11b320255ee95e791022555971c466af4527"}, - {file = "ruamel.yaml.clib-0.2.6-cp35-cp35m-win32.whl", hash = "sha256:ada3f400d9923a190ea8b59c8f60680c4ef8a4b0dfae134d2f2ff68429adfab5"}, - {file = "ruamel.yaml.clib-0.2.6-cp35-cp35m-win_amd64.whl", hash = "sha256:de9c6b8a1ba52919ae919f3ae96abb72b994dd0350226e28f3686cb4f142165c"}, - {file = "ruamel.yaml.clib-0.2.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d67f273097c368265a7b81e152e07fb90ed395df6e552b9fa858c6d2c9f42502"}, - {file = "ruamel.yaml.clib-0.2.6-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:72a2b8b2ff0a627496aad76f37a652bcef400fd861721744201ef1b45199ab78"}, - {file = "ruamel.yaml.clib-0.2.6-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:d3c620a54748a3d4cf0bcfe623e388407c8e85a4b06b8188e126302bcab93ea8"}, - {file = "ruamel.yaml.clib-0.2.6-cp36-cp36m-win32.whl", hash = "sha256:9efef4aab5353387b07f6b22ace0867032b900d8e91674b5d8ea9150db5cae94"}, - {file = "ruamel.yaml.clib-0.2.6-cp36-cp36m-win_amd64.whl", hash = "sha256:846fc8336443106fe23f9b6d6b8c14a53d38cef9a375149d61f99d78782ea468"}, - {file = "ruamel.yaml.clib-0.2.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0847201b767447fc33b9c235780d3aa90357d20dd6108b92be544427bea197dd"}, - {file = "ruamel.yaml.clib-0.2.6-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:78988ed190206672da0f5d50c61afef8f67daa718d614377dcd5e3ed85ab4a99"}, - {file = "ruamel.yaml.clib-0.2.6-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:210c8fcfeff90514b7133010bf14e3bad652c8efde6b20e00c43854bf94fa5a6"}, - {file = "ruamel.yaml.clib-0.2.6-cp37-cp37m-win32.whl", hash = "sha256:a49e0161897901d1ac9c4a79984b8410f450565bbad64dbfcbf76152743a0cdb"}, - {file = "ruamel.yaml.clib-0.2.6-cp37-cp37m-win_amd64.whl", hash = "sha256:bf75d28fa071645c529b5474a550a44686821decebdd00e21127ef1fd566eabe"}, - {file = "ruamel.yaml.clib-0.2.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a32f8d81ea0c6173ab1b3da956869114cae53ba1e9f72374032e33ba3118c233"}, - {file = "ruamel.yaml.clib-0.2.6-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7f7ecb53ae6848f959db6ae93bdff1740e651809780822270eab111500842a84"}, - {file = "ruamel.yaml.clib-0.2.6-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:61bc5e5ca632d95925907c569daa559ea194a4d16084ba86084be98ab1cec1c6"}, - {file = "ruamel.yaml.clib-0.2.6-cp38-cp38-win32.whl", hash = "sha256:89221ec6d6026f8ae859c09b9718799fea22c0e8da8b766b0b2c9a9ba2db326b"}, - {file = "ruamel.yaml.clib-0.2.6-cp38-cp38-win_amd64.whl", hash = "sha256:31ea73e564a7b5fbbe8188ab8b334393e06d997914a4e184975348f204790277"}, - {file = "ruamel.yaml.clib-0.2.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:dc6a613d6c74eef5a14a214d433d06291526145431c3b964f5e16529b1842bed"}, - {file = "ruamel.yaml.clib-0.2.6-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:1866cf2c284a03b9524a5cc00daca56d80057c5ce3cdc86a52020f4c720856f0"}, - {file = "ruamel.yaml.clib-0.2.6-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:1b4139a6ffbca8ef60fdaf9b33dec05143ba746a6f0ae0f9d11d38239211d335"}, - {file = "ruamel.yaml.clib-0.2.6-cp39-cp39-win32.whl", hash = "sha256:3fb9575a5acd13031c57a62cc7823e5d2ff8bc3835ba4d94b921b4e6ee664104"}, - {file = "ruamel.yaml.clib-0.2.6-cp39-cp39-win_amd64.whl", hash = "sha256:825d5fccef6da42f3c8eccd4281af399f21c02b32d98e113dbc631ea6a6ecbc7"}, - {file = "ruamel.yaml.clib-0.2.6.tar.gz", hash = "sha256:4ff604ce439abb20794f05613c374759ce10e3595d1867764dd1ae675b85acbd"}, -] -safety = [ - {file = "safety-2.3.1-py3-none-any.whl", hash = "sha256:8f098d12b607db2756886280e85c28ece8db1bba4f45fc5f981f4663217bd619"}, - {file = "safety-2.3.1.tar.gz", hash = "sha256:6e6fcb7d4e8321098cf289f59b65051cafd3467f089c6e57c9f894ae32c23b71"}, -] -setuptools = [ - {file = "setuptools-65.5.0-py3-none-any.whl", hash = "sha256:f62ea9da9ed6289bfe868cd6845968a2c854d1427f8548d52cae02a42b4f0356"}, - {file = "setuptools-65.5.0.tar.gz", hash = "sha256:512e5536220e38146176efb833d4a62aa726b7bbff82cfbc8ba9eaa3996e0b17"}, -] -toml = [ - {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, - {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, -] -urllib3 = [ - {file = "urllib3-1.26.12-py2.py3-none-any.whl", hash = "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997"}, - {file = "urllib3-1.26.12.tar.gz", hash = "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"}, -] -zope-interface = [ - {file = "zope.interface-5.5.0-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:2cb3003941f5f4fa577479ac6d5db2b940acb600096dd9ea9bf07007f5cab46f"}, - {file = "zope.interface-5.5.0-cp27-cp27m-win32.whl", hash = "sha256:8c791f4c203ccdbcda588ea4c8a6e4353e10435ea48ddd3d8734a26fe9714cba"}, - {file = "zope.interface-5.5.0-cp27-cp27m-win_amd64.whl", hash = "sha256:3eedf3d04179774d750e8bb4463e6da350956a50ed44d7b86098e452d7ec385e"}, - {file = "zope.interface-5.5.0-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:58a66c2020a347973168a4a9d64317bac52f9fdfd3e6b80b252be30da881a64e"}, - {file = "zope.interface-5.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da7912ae76e1df6a1fb841b619110b1be4c86dfb36699d7fd2f177105cdea885"}, - {file = "zope.interface-5.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:423c074e404f13e6fa07f4454f47fdbb38d358be22945bc812b94289d9142374"}, - {file = "zope.interface-5.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:7bdcec93f152e0e1942102537eed7b166d6661ae57835b20a52a2a3d6a3e1bf3"}, - {file = "zope.interface-5.5.0-cp310-cp310-win32.whl", hash = "sha256:03f5ae315db0d0de668125d983e2a819a554f3fdb2d53b7e934e3eb3c3c7375d"}, - {file = "zope.interface-5.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:8b9f153208d74ccfa25449a0c6cb756ab792ce0dc99d9d771d935f039b38740c"}, - {file = "zope.interface-5.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aeac590cce44e68ee8ad0b8ecf4d7bf15801f102d564ca1b0eb1f12f584ee656"}, - {file = "zope.interface-5.5.0-cp35-cp35m-win32.whl", hash = "sha256:7d9ec1e6694af39b687045712a8ad14ddcb568670d5eb1b66b48b98b9312afba"}, - {file = "zope.interface-5.5.0-cp35-cp35m-win_amd64.whl", hash = "sha256:d18fb0f6c8169d26044128a2e7d3c39377a8a151c564e87b875d379dbafd3930"}, - {file = "zope.interface-5.5.0-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:0eb2b3e84f48dd9cfc8621c80fba905d7e228615c67f76c7df7c716065669bb6"}, - {file = "zope.interface-5.5.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df6593e150d13cfcce69b0aec5df7bc248cb91e4258a7374c129bb6d56b4e5ca"}, - {file = "zope.interface-5.5.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:9dc4493aa3d87591e3d2bf1453e25b98038c839ca8e499df3d7106631b66fe83"}, - {file = "zope.interface-5.5.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5c6023ae7defd052cf76986ce77922177b0c2f3913bea31b5b28fbdf6cb7099e"}, - {file = "zope.interface-5.5.0-cp36-cp36m-win32.whl", hash = "sha256:a69c28d85bb7cf557751a5214cb3f657b2b035c8c96d71080c1253b75b79b69b"}, - {file = "zope.interface-5.5.0-cp36-cp36m-win_amd64.whl", hash = "sha256:85dd6dd9aaae7a176948d8bb62e20e2968588fd787c29c5d0d964ab475168d3d"}, - {file = "zope.interface-5.5.0-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:970661ece2029915b8f7f70892e88404340fbdefd64728380cad41c8dce14ff4"}, - {file = "zope.interface-5.5.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e3495bb0cdcea212154e558082c256f11b18031f05193ae2fb85d048848db14"}, - {file = "zope.interface-5.5.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:3f68404edb1a4fb6aa8a94675521ca26c83ebbdbb90e894f749ae0dc4ca98418"}, - {file = "zope.interface-5.5.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:740f3c1b44380658777669bcc42f650f5348e53797f2cee0d93dc9b0f9d7cc69"}, - {file = "zope.interface-5.5.0-cp37-cp37m-win32.whl", hash = "sha256:006f8dd81fae28027fc28ada214855166712bf4f0bfbc5a8788f9b70982b9437"}, - {file = "zope.interface-5.5.0-cp37-cp37m-win_amd64.whl", hash = "sha256:43490ad65d4c64e45a30e51a2beb7a6b63e1ff395302ad22392224eb618476d6"}, - {file = "zope.interface-5.5.0-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:f70726b60009433111fe9928f5d89cbb18962411d33c45fb19eb81b9bbd26fcd"}, - {file = "zope.interface-5.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfa614d049667bed1c737435c609c0956c5dc0dbafdc1145ee7935e4658582cb"}, - {file = "zope.interface-5.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:58a975f89e4584d0223ab813c5ba4787064c68feef4b30d600f5e01de90ae9ce"}, - {file = "zope.interface-5.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:37ec9ade9902f412cc7e7a32d71f79dec3035bad9bd0170226252eed88763c48"}, - {file = "zope.interface-5.5.0-cp38-cp38-win32.whl", hash = "sha256:be11fce0e6af6c0e8d93c10ef17b25aa7c4acb7ec644bff2596c0d639c49e20f"}, - {file = "zope.interface-5.5.0-cp38-cp38-win_amd64.whl", hash = "sha256:cbbf83914b9a883ab324f728de869f4e406e0cbcd92df7e0a88decf6f9ab7d5a"}, - {file = "zope.interface-5.5.0-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:26c1456520fdcafecc5765bec4783eeafd2e893eabc636908f50ee31fe5c738c"}, - {file = "zope.interface-5.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47ff078734a1030c48103422a99e71a7662d20258c00306546441adf689416f7"}, - {file = "zope.interface-5.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:687cab7f9ae18d2c146f315d0ca81e5ffe89a139b88277afa70d52f632515854"}, - {file = "zope.interface-5.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d80f6236b57a95eb19d5e47eb68d0296119e1eff6deaa2971ab8abe3af918420"}, - {file = "zope.interface-5.5.0-cp39-cp39-win32.whl", hash = "sha256:9cdc4e898d3b1547d018829fd4a9f403e52e51bba24be0fbfa37f3174e1ef797"}, - {file = "zope.interface-5.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:6566b3d2657e7609cd8751bcb1eab1202b1692a7af223035a5887d64bb3a2f3b"}, - {file = "zope.interface-5.5.0.tar.gz", hash = "sha256:700ebf9662cf8df70e2f0cb4988e078c53f65ee3eefd5c9d80cf988c4175c8e3"}, -] diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/pyproject.toml" "b/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/pyproject.toml" deleted file mode 100644 index b090d3c..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/pyproject.toml" +++ /dev/null @@ -1,28 +0,0 @@ -[tool.poetry] -name = "my-awesome-script" -version = "0.1.0" -description = "" -authors = ["Your Namxobick "] -readme = "README.md" -packages = [{include = "my_awesome_script"}] - -[tool.poetry.dependencies] -python = "^3.10" -pygments = "^2.13.0" -argparse = "^1.4.0" -cowpy = "^1.1.5" -cowsay = "^5.0" -pytz = "^2022.4" -datetime = "^4.7" - - -[tool.poetry.group.dev.dependencies] -safety = "^2.3.1" - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - -[tool.poetry.scripts] -my_awesome_script = "my_awesome_script.__main__:main" - diff --git "a/homeworks/Yurin Andrey/\342\204\2266/.idea/.gitignore" "b/homeworks/Yurin Andrey/\342\204\2266/.idea/.gitignore" new file mode 100644 index 0000000..26d3352 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/.idea/.gitignore" @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git "a/homeworks/Yurin Andrey/\342\204\2266/.idea/HW6.iml" "b/homeworks/Yurin Andrey/\342\204\2266/.idea/HW6.iml" new file mode 100644 index 0000000..909438d --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/.idea/HW6.iml" @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/.idea/inspectionProfiles/profiles_settings.xml" "b/homeworks/Yurin Andrey/\342\204\2266/.idea/inspectionProfiles/profiles_settings.xml" new file mode 100644 index 0000000..105ce2d --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/.idea/inspectionProfiles/profiles_settings.xml" @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/.idea/misc.xml" "b/homeworks/Yurin Andrey/\342\204\2266/.idea/misc.xml" new file mode 100644 index 0000000..a971a2c --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/.idea/misc.xml" @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/.idea/modules.xml" "b/homeworks/Yurin Andrey/\342\204\2266/.idea/modules.xml" new file mode 100644 index 0000000..7a2b005 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/.idea/modules.xml" @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/files/email/email.csv" "b/homeworks/Yurin Andrey/\342\204\2266/files/email/email.csv" new file mode 100644 index 0000000..16a1bdb --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/files/email/email.csv" @@ -0,0 +1,2 @@ +"Sincere@april.biz","Shanna@melissa.tv","anastasia.net" +"yurinsin@gmail.com","Lucio_Hettinger@annie.ca" \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/files/users/1.xml" "b/homeworks/Yurin Andrey/\342\204\2266/files/users/1.xml" new file mode 100644 index 0000000..1e0c5ed --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/files/users/1.xml" @@ -0,0 +1,201 @@ + + + 1 + Sincere@april.biz + + + 1 + sunt aut facere repellat provident occaecati excepturi optio reprehenderit + quia et suscipitsuscipit recusandae consequuntur expedita et cumreprehenderit molestiae ut ut quas totamnostrum rerum est autem sunt rem eveniet architecto + + + 2 + qui est esse + est rerum tempore vitaesequi sint nihil reprehenderit dolor beatae ea dolores nequefugiat blanditiis voluptate porro vel nihil molestiae ut reiciendisqui aperiam non debitis possimus qui neque nisi nulla + + + 3 + ea molestias quasi exercitationem repellat qui ipsa sit aut + et iusto sed quo iurevoluptatem occaecati omnis eligendi aut advoluptatem doloribus vel accusantium quis pariaturmolestiae porro eius odio et labore et velit aut + + + 4 + eum et est occaecati + ullam et saepe reiciendis voluptatem adipiscisit amet autem assumenda provident rerum culpaquis hic commodi nesciunt rem tenetur doloremque ipsam iurequis sunt voluptatem rerum illo velit + + + 5 + nesciunt quas odio + repudiandae veniam quaerat sunt sedalias aut fugiat sit autem sed estvoluptatem omnis possimus esse voluptatibus quisest aut tenetur dolor neque + + + 6 + dolorem eum magni eos aperiam quia + ut aspernatur corporis harum nihil quis provident sequimollitia nobis aliquid molestiaeperspiciatis et ea nemo ab reprehenderit accusantium quasvoluptate dolores velit et doloremque molestiae + + + 7 + magnam facilis autem + dolore placeat quibusdam ea quo vitaemagni quis enim qui quis quo nemo aut saepequidem repellat excepturi ut quiasunt ut sequi eos ea sed quas + + + 8 + dolorem dolore est ipsam + dignissimos aperiam dolorem qui eumfacilis quibusdam animi sint suscipit qui sint possimus cumquaerat magni maiores excepturiipsam ut commodi dolor voluptatum modi aut vitae + + + 9 + nesciunt iure omnis dolorem tempora et accusantium + consectetur animi nesciunt iure doloreenim quia adveniam autem ut quam aut nobiset est aut quod aut provident voluptas autem voluptas + + + 10 + optio molestias id quia eum + quo et expedita modi cum officia vel magnidoloribus qui repudiandaevero nisi sitquos 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 + + + \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/files/users/2.xml" "b/homeworks/Yurin Andrey/\342\204\2266/files/users/2.xml" new file mode 100644 index 0000000..964471e --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/files/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 voluptatibusaccusamus in eum beatae sitvel qui neque voluptates ut commodi qui inciduntut animi commodi + + + 12 + in quibusdam tempore odit est dolorem + itaque id aut magnampraesentium quia et ea odit et ea voluptas etsapiente quia nihil amet occaecati quia id voluptatemincidunt ea est distinctio odio + + + 13 + dolorum ut in voluptas mollitia et saepe quo animi + aut dicta possimus sint mollitia voluptas commodi quo doloremqueiste corrupti reiciendis voluptatem eius rerumsit cumque quod eligendi laborum minimaperferendis recusandae assumenda consectetur porro architecto ipsum ipsam + + + 14 + voluptatem eligendi optio + fuga et accusamus dolorum perferendis illo voluptasnon doloremque neque faceread qui dolorum molestiae beataesed aut voluptas totam sit illum + + + 15 + eveniet quod temporibus + reprehenderit quos placeatvelit minima officia dolores impedit repudiandae molestiae namvoluptas recusandae quis delectusofficiis harum fugiat vitae + + + 16 + sint suscipit perspiciatis velit dolorum rerum ipsa laboriosam odio + suscipit nam nisi quo aperiam autasperiores eos fugit maiores voluptatibus quiavoluptatem quis ullam qui in alias quia estconsequatur magni mollitia accusamus ea nisi voluptate dicta + + + 17 + fugit voluptas sed molestias voluptatem provident + eos voluptas et aut odit natus earumaspernatur fuga molestiae ullamdeserunt ratione qui eosqui nihil ratione nemo velit ut aut id quo + + + 18 + voluptate et itaque vero tempora molestiae + eveniet quo quislaborum totam consequatur non dolorut et est repudiandaeest voluptatem vel debitis et magnam + + + 19 + adipisci placeat illum aut reiciendis qui + illum quis cupiditate provident sit magnamea sed aut omnisveniam maiores ullam consequatur atqueadipisci quo iste expedita sit quos voluptas + + + 20 + doloribus ad provident suscipit at + qui consequuntur ducimus possimus quisquam amet similiquesuscipit porro ipsam ameteos veritatis officiis exercitationem vel fugit aut necessitatibus totamomnis 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 + + + \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/files/users/5.xml" "b/homeworks/Yurin Andrey/\342\204\2266/files/users/5.xml" new file mode 100644 index 0000000..bb5866e --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/files/users/5.xml" @@ -0,0 +1,201 @@ + + + 5 + Lucio_Hettinger@annie.ca + + + 41 + non est facere + molestias id nostrumexcepturi molestiae dolore omnis repellendus quaerat saepeconsectetur iste quaerat tenetur asperiores accusamus ex utnam quidem est ducimus sunt debitis saepe + + + 42 + commodi ullam sint et excepturi error explicabo praesentium voluptas + odio fugit voluptatum ducimus earum autem est incidunt voluptatemodit reiciendis aliquam sunt sequi nulla doloremnon facere repellendus voluptates quiaratione harum vitae ut + + + 43 + eligendi iste nostrum consequuntur adipisci praesentium sit beatae perferendis + similique fugit estillum et dolorum harum et voluptate eaque quidemexercitationem quos nam commodi possimus cum odio nihil nulladolorum exercitationem magnam ex et a et distinctio debitis + + + 44 + optio dolor molestias sit + temporibus est consectetur doloreet libero debitis vel velit laboriosam quiaipsum quibusdam qui itaque fuga rem autea et iure quam sed maxime ut distinctio quae + + + 45 + ut numquam possimus omnis eius suscipit laudantium iure + est natus reiciendis nihil possimus aut providentex et dolorrepellat pariatur estnobis rerum repellendus dolorem autem + + + 46 + aut quo modi neque nostrum ducimus + voluptatem quisquam istevoluptatibus natus officiis facilis doloremquis quas ipsamvel et voluptatum in aliquid + + + 47 + quibusdam cumque rem aut deserunt + voluptatem assumenda ut qui ut cupiditate aut impedit veniamoccaecati nemo illum voluptatem laudantiummolestiae beatae rerum ea iure soluta nostrumeligendi et voluptate + + + 48 + ut voluptatem illum ea doloribus itaque eos + voluptates quo voluptatem facilis iure occaecativel assumenda rerum officia etillum perspiciatis ab delenitilaudantium repellat ad ut et autem reprehenderit + + + 49 + laborum non sunt aut ut assumenda perspiciatis voluptas + inventore ab sintnatus fugit id nulla sequi architecto nihil quaerateos tenetur in in eum veritatis nonquibusdam officiis aspernatur cumque aut commodi aut + + + 50 + repellendus qui recusandae incidunt voluptates tenetur qui omnis exercitationem + error suscipit maxime adipisci consequuntur recusandaevoluptas eligendi et est et voluptatesquia distinctio ab amet quaerat molestiae et vitaeadipisci impedit sequi nesciunt quis consectetur + + + + + 41 + ea voluptates maiores eos accusantium officiis tempore mollitia consequatur + + + 42 + tenetur explicabo ea + + + 43 + aperiam doloremque nihil + + + 44 + sapiente cum numquam officia consequatur vel natus quos suscipit + + + 45 + tenetur quos ea unde est enim corrupti qui + + + 46 + molestiae voluptate non + + + 47 + temporibus molestiae aut + + + 48 + modi consequatur culpa aut quam soluta alias perspiciatis laudantium + + + 49 + ut aut vero repudiandae voluptas ullam voluptas at consequatur + + + 50 + sed qui sed quas sit ducimus dolor + + + + + 81 + suscipit qui totam + True + + + 82 + voluptates eum voluptas et dicta + False + + + 83 + quidem at rerum quis ex aut sit quam + True + + + 84 + sunt veritatis ut voluptate + False + + + 85 + et quia ad iste a + True + + + 86 + incidunt ut saepe autem + True + + + 87 + laudantium quae eligendi consequatur quia et vero autem + True + + + 88 + vitae aut excepturi laboriosam sint aliquam et et accusantium + False + + + 89 + sequi ut omnis et + True + + + 90 + molestiae nisi accusantium tenetur dolorem et + True + + + 91 + nulla quis consequatur saepe qui id expedita + True + + + 92 + in omnis laboriosam + True + + + 93 + odio iure consequatur molestiae quibusdam necessitatibus quia sint + True + + + 94 + facilis modi saepe mollitia + False + + + 95 + vel nihil et molestiae iusto assumenda nemo quo ut + True + + + 96 + nobis suscipit ducimus enim asperiores voluptas + False + + + 97 + dolorum laboriosam eos qui iure aliquam + False + + + 98 + debitis accusantium ut quo facilis nihil quis sapiente necessitatibus + True + + + 99 + neque voluptates ratione + False + + + 100 + excepturi a et neque qui expedita vel voluptate + False + + + \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/poetry.lock" "b/homeworks/Yurin Andrey/\342\204\2266/poetry.lock" new file mode 100644 index 0000000..54cb65e --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/poetry.lock" @@ -0,0 +1,739 @@ +[[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" +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.5" +description = "Cross-platform colored terminal text." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[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.9.23" +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.6" + +[package.dependencies] +attrs = ">=19.2.0" +flake8 = ">=3.0.0" + +[package.extras] +dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit"] + +[[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" +description = "Internationalized Domain Names in Applications (IDNA)" +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" +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 = "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" +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 = "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" +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 = "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" +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 = "32db271446ad0a1ae8a378422c1709486c4fdbcc4329844fd595a63f963a4304" + +[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"}, +] +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.5-py2.py3-none-any.whl", hash = "sha256:854bf444933e37f5824ae7bfc1e98d5bce2ebe4160d46b5edf346a89358e99da"}, + {file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"}, +] +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.9.23.tar.gz", hash = "sha256:17b9623325e6e0dcdcc80ed9e4aa811287fcc81d7e03313b8736ea5733759937"}, + {file = "flake8_bugbear-22.9.23-py3-none-any.whl", hash = "sha256:cd2779b2b7ada212d7a322814a1e5651f1868ab0d3f24cc9da66169ab8fda474"}, +] +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"}, +] +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/Yurin Andrey/\342\204\2266/pyproject.toml" "b/homeworks/Yurin Andrey/\342\204\2266/pyproject.toml" new file mode 100644 index 0000000..2b47c60 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/pyproject.toml" @@ -0,0 +1,17 @@ +[tool.poetry] +name = "hw6" +version = "0.1.0" +description = "" +authors = ["Namxobick "] +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.10" +loguru = "^0.6.0" +requests = "^2.28.1" +wemake-python-styleguide = "^0.17.0" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/setup.cfg" "b/homeworks/Yurin Andrey/\342\204\2266/setup.cfg" new file mode 100644 index 0000000..8e9eda3 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/setup.cfg" @@ -0,0 +1,97 @@ +# All configuration for plugins and other utils is defined here. +# Read more about `setup.cfg`: +# https://docs.python.org/3/distutils/configfile.html + +[flake8] +# Base flake8 configuration: +# https://flake8.pycqa.org/en/latest/user/configuration.html +format = wemake +show-source = true +statistics = false +doctests = true + +# darglint configuration: +# https://github.com/terrencepreilly/darglint +strictness = long +docstring-style = numpy + +# Plugins: +max-complexity = 6 +max-line-length = 80 + +# wemake-python-styleguide settings: +i-control-code = false + +# Disable some pydocstyle checks: +# Exclude some pydoctest checks globally: +ignore = D100, D104, D106, D401, W504, X100, RST303, RST304, DAR103, DAR203 + +# Excluding some directories: +exclude = + .git + __pycache__ + .venv + .eggs + *.egg + +# Ignoring some errors in some files: +per-file-ignores = + # Enable `assert` keyword and magic numbers for tests: + tests/*.py: S101, WPS226, WPS432 + + +[isort] +# isort configuration: +# https://pycqa.github.io/isort/docs/configuration/options.html +profile = wemake + + +[tool:pytest] +# Directories that are not visited by pytest collector: +norecursedirs = *.egg .eggs dist build docs .tox .git __pycache__ + +# Strict `@xfail` by default: +xfail_strict = true + +# Extra options: +addopts = + --strict-markers + --strict-config + --tb=short + --doctest-modules + --cov={{ cookiecutter.project_name.lower().replace('-', '_') }} + --cov-report=term-missing:skip-covered + --cov-report=html + --cov-report=xml + --cov-branch + --cov-fail-under=100 + + +[mypy] +# mypy configurations: http://bit.ly/2zEl9WI +enable_error_code = truthy-bool, redundant-expr, unused-awaitable + +allow_redefinition = false +check_untyped_defs = true +disallow_any_explicit = true +disallow_any_generics = true +disallow_untyped_calls = true +ignore_errors = false +ignore_missing_imports = true +implicit_reexport = false +local_partial_types = true +strict_optional = true +strict_equality = true +no_implicit_optional = true +warn_no_return = true +warn_unused_ignores = true +warn_redundant_casts = true +warn_unused_configs = true +warn_unreachable = true + + +[doc8] +# doc8 configuration: https://pypi.org/project/doc8/ +ignore-path = docs/_build +max-line-length = 80 +sphinx = true \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/tests/__init__.py" "b/homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2265/my-awesome-script/tests/__init__.py" rename to "homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/__main__.py" "b/homeworks/Yurin Andrey/\342\204\2266/todo/__main__.py" new file mode 100644 index 0000000..d3cd584 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/todo/__main__.py" @@ -0,0 +1,21 @@ +from typing import Final + +from basic import basic +from loguru import logger + + +def main(): + """Main method. Entry point.""" + try: + basic(PATH_EMAIL, PATH_JSON) + except Exception as ex: + logger.critical('You have done something wrong!', ex) + + +if __name__ == '__main__': + PATH_EMAIL: Final = '../files/email/email.csv' + PATH_JSON: Final = 'https://jsonplaceholder.typicode.com/users/' + try: + main() + except KeyboardInterrupt: + logger.critical('Shutting down, bye!') diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/basic.py" "b/homeworks/Yurin Andrey/\342\204\2266/todo/basic.py" new file mode 100644 index 0000000..21e163e --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/todo/basic.py" @@ -0,0 +1,51 @@ +import re + +import json_parsing as scraping +import read_csv_file as csv +from loguru import logger +from writer_xml import write_xml + + +def basic(path_email: str, path_json: str): + """ + Basic method. + + Connects other methods. + + :param path_email : path to PATH_EMAIL + :param path_json : path to PATH_JSON + """ + types_info = ['posts', 'albums', 'todos'] + _user_xml(types_info, path_email, path_json) + + +def _is_email(entry: str) -> bool: + regex = re.compile(r'^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+(\.[A-Z|a-z]{2,})+') + return re.match(regex, entry) is not None + + +def _get_emails_id(path_email: str, path_json: str) -> dict: + all_emails_id = scraping.get_email_id(path_json) + emails = csv.read(path_email) + + emails_id = {} + for key in emails: + if _is_email(key): + user_id = all_emails_id.get(key) + if user_id is None: + logger.warning('{0} missing from the website'.format(key)) + else: + emails_id[key] = user_id + else: + logger.warning('{0} is not valid email'.format(key)) + logger.info('{0} users were found in website'.format(len(emails_id))) + return emails_id + + +def _user_xml(types_info: list, path_email: str, path_json: str): + emails_id = _get_emails_id(path_email, path_json) + for key in emails_id: + path = '../files/users/{0}.xml'.format(str(emails_id.get(key))) + user_id = str(emails_id.get(key)) + user_info = scraping.get_user_info(path_json, user_id, types_info) + write_xml(user_id, str(key), user_info, types_info, path) diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/json_parsing.py" "b/homeworks/Yurin Andrey/\342\204\2266/todo/json_parsing.py" new file mode 100644 index 0000000..f1ac92d --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/todo/json_parsing.py" @@ -0,0 +1,66 @@ +import requests +from loguru import logger + + +def get_all_info(path: str) -> dict: + """ + Gets all the information from the website. + + :param path : path PATH_JSON + :return dict : information from the website + """ + response = requests.get(path) + return response.json() + + +def get_email_id(path: str) -> dict: + """ + Receives the user ID by email from the website. + + :param path : path PATH_JSON + :return dict : email:id + """ + logger.info('The beginning of requests users from the site') + user_email_id: dict[str:int] = {} + user = 1 + while True: + response = requests.get(path + '/{0}'.format(user)) + user_info = response.json() + if not user_info: + break + + logger.info(('Request to {0} (ID: {1}) took {2}'.format( + user_info.get('email'), + user_info.get('id'), + response.elapsed, + ))) + + user_email_id[user_info.get('email')] = user_info.get('id') + user += 1 + + logger.info('The ending of requests users from the site') + return user_email_id + + +def get_user_info(path: str, user_id: str, types_info: list) -> dict: + """ + Receives the user info ('posts', 'albums', 'todos') by id from the website. + + :param path : path PATH_JSON + :param user_id + :param types_info : ['posts', 'albums', 'todos'] + :return dict : email:id + """ + user_info: dict[str:list] = {} + logger.info('Starts parsing for ID: {0}'.format(user_id)) + for type_info in types_info: + response = requests.get(path + '{0}/{1}/'.format(user_id, type_info)) + user_info[type_info] = response.json() + logger.info(('Request to ID: {1} for get {0}: took {2}'.format( + type_info, + user_id, + response.elapsed, + ))) + logger.info('Ends parsing for ID: {0}'.format(user_id)) + + return user_info diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/read_csv_file.py" "b/homeworks/Yurin Andrey/\342\204\2266/todo/read_csv_file.py" new file mode 100644 index 0000000..4d698c8 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/todo/read_csv_file.py" @@ -0,0 +1,20 @@ +import csv + +from loguru import logger + + +def read(path: str = None) -> tuple: + """ + Read the csv file. + + :param path :path to email.csv + :return tuple : tuple of emails + """ + with open(path) as csv_file: + emails: list[str] = [] + reader = csv.reader(csv_file, delimiter=',', quotechar='"') + for line in reader: + emails.extend(line) + + logger.info('{0} users were read from csv file'.format(len(emails))) + return tuple(emails) diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/writer_xml.py" "b/homeworks/Yurin Andrey/\342\204\2266/todo/writer_xml.py" new file mode 100644 index 0000000..28c60f3 --- /dev/null +++ "b/homeworks/Yurin Andrey/\342\204\2266/todo/writer_xml.py" @@ -0,0 +1,61 @@ +from xml.etree import ElementTree as Et # noqa: S405 + +from loguru import logger + + +def _remove_enter(string: str) -> str: + return string.replace('\n', '') + + +def _append_elem(root, name_new_root: str, text: str = None): + name = Et.Element(name_new_root) + if text is not None: + name.text = text + root.append(name) + + +def _append_type_info(root, name_new_root: str, user_all_info: dict): + names = Et.Element(name_new_root) + + for user_info in user_all_info.get(name_new_root): + name = Et.Element(name_new_root[:-1]) + names.append(name) + _append_elem(name, 'id', str(user_info.get('id'))) + _append_elem(name, 'title', _remove_enter(str(user_info.get('title')))) + + match name_new_root: + case 'posts': + body = _remove_enter(str(user_info.get('body'))) + _append_elem(name, 'body', body) + case 'todos': + completed = _remove_enter(str(user_info.get('completed'))) + _append_elem(name, 'completed', completed) + root.append(names) + + +def write_xml(user_id: str, user_email: str, user_info: dict, types_info: list, path: str): # noqa: E501 + """ + Creates ET.Element tree and writes the user info to xml file. + + :param user_id + :param user_email + :param user_info : user information from the website (PATH_JSON) + :param types_info : 'posts', 'albums', 'todos' + :param path : the path to the recording file + """ + root = Et.Element('user') + _append_elem(root, 'id', user_id) + _append_elem(root, 'email', user_email) + for type_info in types_info: + _append_type_info(root, type_info, user_info) + + etree = Et.ElementTree(root) + Et.indent(etree) + with open(path, 'wb') as xml_file: + etree.write(xml_file, encoding='utf-8', xml_declaration=True) + + logger.info('Saved {0}/{1}.xml for user with email `{2}`'.format( + path, + user_id, + user_email, + )) From f32d39e09acd1b868f385af912e6bd77ba5e7a8d Mon Sep 17 00:00:00 2001 From: Namxobick Date: Wed, 26 Oct 2022 14:38:42 +0300 Subject: [PATCH 13/18] Deleted unnecessary files --- .../\342\204\2266/.idea/.gitignore" | 3 --- .../Yurin Andrey/\342\204\2266/.idea/HW6.iml" | 8 -------- .../inspectionProfiles/profiles_settings.xml" | 6 ------ .../Yurin Andrey/\342\204\2266/.idea/misc.xml" | 4 ---- .../\342\204\2266/.idea/modules.xml" | 8 -------- .../Yurin Andrey/\342\204\2266/poetry.lock" | 18 +++++++++--------- .../\342\204\2266/todo/__init__.py" | 0 7 files changed, 9 insertions(+), 38 deletions(-) delete mode 100644 "homeworks/Yurin Andrey/\342\204\2266/.idea/.gitignore" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2266/.idea/HW6.iml" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2266/.idea/inspectionProfiles/profiles_settings.xml" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2266/.idea/misc.xml" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2266/.idea/modules.xml" delete mode 100644 "homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/.idea/.gitignore" "b/homeworks/Yurin Andrey/\342\204\2266/.idea/.gitignore" deleted file mode 100644 index 26d3352..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2266/.idea/.gitignore" +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git "a/homeworks/Yurin Andrey/\342\204\2266/.idea/HW6.iml" "b/homeworks/Yurin Andrey/\342\204\2266/.idea/HW6.iml" deleted file mode 100644 index 909438d..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2266/.idea/HW6.iml" +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/.idea/inspectionProfiles/profiles_settings.xml" "b/homeworks/Yurin Andrey/\342\204\2266/.idea/inspectionProfiles/profiles_settings.xml" deleted file mode 100644 index 105ce2d..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2266/.idea/inspectionProfiles/profiles_settings.xml" +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/.idea/misc.xml" "b/homeworks/Yurin Andrey/\342\204\2266/.idea/misc.xml" deleted file mode 100644 index a971a2c..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2266/.idea/misc.xml" +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/.idea/modules.xml" "b/homeworks/Yurin Andrey/\342\204\2266/.idea/modules.xml" deleted file mode 100644 index 7a2b005..0000000 --- "a/homeworks/Yurin Andrey/\342\204\2266/.idea/modules.xml" +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git "a/homeworks/Yurin Andrey/\342\204\2266/poetry.lock" "b/homeworks/Yurin Andrey/\342\204\2266/poetry.lock" index 54cb65e..783ee7f 100644 --- "a/homeworks/Yurin Andrey/\342\204\2266/poetry.lock" +++ "b/homeworks/Yurin Andrey/\342\204\2266/poetry.lock" @@ -60,11 +60,11 @@ unicode-backport = ["unicodedata2"] [[package]] name = "colorama" -version = "0.4.5" +version = "0.4.6" description = "Cross-platform colored terminal text." category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" [[package]] name = "darglint" @@ -130,18 +130,18 @@ flake8 = ">=3.5,<6" [[package]] name = "flake8-bugbear" -version = "22.9.23" +version = "22.10.25" 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.6" +python-versions = ">=3.7" [package.dependencies] attrs = ">=19.2.0" flake8 = ">=3.0.0" [package.extras] -dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit"] +dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit", "tox"] [[package]] name = "flake8-commas" @@ -542,8 +542,8 @@ charset-normalizer = [ {file = "charset_normalizer-2.1.1-py3-none-any.whl", hash = "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"}, ] colorama = [ - {file = "colorama-0.4.5-py2.py3-none-any.whl", hash = "sha256:854bf444933e37f5824ae7bfc1e98d5bce2ebe4160d46b5edf346a89358e99da"}, - {file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"}, + {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"}, @@ -570,8 +570,8 @@ flake8-broken-line = [ {file = "flake8_broken_line-0.5.0-py3-none-any.whl", hash = "sha256:daafb19b67eead0410ce7ba155d51a15b9d020ebe7630d87de9c2b93cedb6703"}, ] flake8-bugbear = [ - {file = "flake8-bugbear-22.9.23.tar.gz", hash = "sha256:17b9623325e6e0dcdcc80ed9e4aa811287fcc81d7e03313b8736ea5733759937"}, - {file = "flake8_bugbear-22.9.23-py3-none-any.whl", hash = "sha256:cd2779b2b7ada212d7a322814a1e5651f1868ab0d3f24cc9da66169ab8fda474"}, + {file = "flake8-bugbear-22.10.25.tar.gz", hash = "sha256:89e51284eb929fbb7f23fbd428491e7427f7cdc8b45a77248daffe86a039d696"}, + {file = "flake8_bugbear-22.10.25-py3-none-any.whl", hash = "sha256:584631b608dc0d7d3f9201046d5840a45502da4732d5e8df6c7ac1694a91cb9e"}, ] flake8-commas = [ {file = "flake8-commas-2.1.0.tar.gz", hash = "sha256:940441ab8ee544df564ae3b3f49f20462d75d5c7cac2463e0b27436e2050f263"}, diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" "b/homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" deleted file mode 100644 index e69de29..0000000 From 555bf1352be13b80bd5bb0e38f3b24465dcbb904 Mon Sep 17 00:00:00 2001 From: Namxobick Date: Wed, 26 Oct 2022 14:40:33 +0300 Subject: [PATCH 14/18] Create __init__.py --- "homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" "b/homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" new file mode 100644 index 0000000..e69de29 From e1aa78c85f4148d72cb29dcf61712da04c9b0a6f Mon Sep 17 00:00:00 2001 From: Namxobick <100288192+Namxobick@users.noreply.github.com> Date: Wed, 26 Oct 2022 14:43:03 +0300 Subject: [PATCH 15/18] Delete __init__.py --- "homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 "homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" "b/homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" deleted file mode 100644 index e69de29..0000000 From 85d819eea954496f2d5b034a4c00897c2c864f4f Mon Sep 17 00:00:00 2001 From: Namxobick Date: Thu, 27 Oct 2022 22:17:17 +0300 Subject: [PATCH 16/18] Changed folder name --- .../Namxobick/\342\204\2266/files/email/email.csv" | 0 .../Namxobick/\342\204\2266/files/users/1.xml" | 0 .../Namxobick/\342\204\2266/files/users/2.xml" | 0 .../Namxobick/\342\204\2266/files/users/5.xml" | 0 .../Namxobick/\342\204\2266/poetry.lock" | 0 .../Namxobick/\342\204\2266/pyproject.toml" | 0 .../setup.cfg" => "homeworks/Namxobick/\342\204\2266/setup.cfg" | 0 .../Namxobick/\342\204\2266/todo/__init__.py" | 0 .../Namxobick/\342\204\2266/todo/__main__.py" | 0 .../Namxobick/\342\204\2266/todo/basic.py" | 0 .../Namxobick/\342\204\2266/todo/json_parsing.py" | 0 .../Namxobick/\342\204\2266/todo/read_csv_file.py" | 0 .../Namxobick/\342\204\2266/todo/writer_xml.py" | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename "homeworks/Yurin Andrey/\342\204\2266/files/email/email.csv" => "homeworks/Namxobick/\342\204\2266/files/email/email.csv" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/files/users/1.xml" => "homeworks/Namxobick/\342\204\2266/files/users/1.xml" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/files/users/2.xml" => "homeworks/Namxobick/\342\204\2266/files/users/2.xml" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/files/users/5.xml" => "homeworks/Namxobick/\342\204\2266/files/users/5.xml" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/poetry.lock" => "homeworks/Namxobick/\342\204\2266/poetry.lock" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/pyproject.toml" => "homeworks/Namxobick/\342\204\2266/pyproject.toml" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/setup.cfg" => "homeworks/Namxobick/\342\204\2266/setup.cfg" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" => "homeworks/Namxobick/\342\204\2266/todo/__init__.py" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/todo/__main__.py" => "homeworks/Namxobick/\342\204\2266/todo/__main__.py" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/todo/basic.py" => "homeworks/Namxobick/\342\204\2266/todo/basic.py" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/todo/json_parsing.py" => "homeworks/Namxobick/\342\204\2266/todo/json_parsing.py" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/todo/read_csv_file.py" => "homeworks/Namxobick/\342\204\2266/todo/read_csv_file.py" (100%) rename "homeworks/Yurin Andrey/\342\204\2266/todo/writer_xml.py" => "homeworks/Namxobick/\342\204\2266/todo/writer_xml.py" (100%) diff --git "a/homeworks/Yurin Andrey/\342\204\2266/files/email/email.csv" "b/homeworks/Namxobick/\342\204\2266/files/email/email.csv" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/files/email/email.csv" rename to "homeworks/Namxobick/\342\204\2266/files/email/email.csv" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/files/users/1.xml" "b/homeworks/Namxobick/\342\204\2266/files/users/1.xml" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/files/users/1.xml" rename to "homeworks/Namxobick/\342\204\2266/files/users/1.xml" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/files/users/2.xml" "b/homeworks/Namxobick/\342\204\2266/files/users/2.xml" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/files/users/2.xml" rename to "homeworks/Namxobick/\342\204\2266/files/users/2.xml" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/files/users/5.xml" "b/homeworks/Namxobick/\342\204\2266/files/users/5.xml" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/files/users/5.xml" rename to "homeworks/Namxobick/\342\204\2266/files/users/5.xml" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/poetry.lock" "b/homeworks/Namxobick/\342\204\2266/poetry.lock" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/poetry.lock" rename to "homeworks/Namxobick/\342\204\2266/poetry.lock" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/pyproject.toml" "b/homeworks/Namxobick/\342\204\2266/pyproject.toml" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/pyproject.toml" rename to "homeworks/Namxobick/\342\204\2266/pyproject.toml" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/setup.cfg" "b/homeworks/Namxobick/\342\204\2266/setup.cfg" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/setup.cfg" rename to "homeworks/Namxobick/\342\204\2266/setup.cfg" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" "b/homeworks/Namxobick/\342\204\2266/todo/__init__.py" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/todo/__init__.py" rename to "homeworks/Namxobick/\342\204\2266/todo/__init__.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/__main__.py" "b/homeworks/Namxobick/\342\204\2266/todo/__main__.py" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/todo/__main__.py" rename to "homeworks/Namxobick/\342\204\2266/todo/__main__.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/basic.py" "b/homeworks/Namxobick/\342\204\2266/todo/basic.py" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/todo/basic.py" rename to "homeworks/Namxobick/\342\204\2266/todo/basic.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/json_parsing.py" "b/homeworks/Namxobick/\342\204\2266/todo/json_parsing.py" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/todo/json_parsing.py" rename to "homeworks/Namxobick/\342\204\2266/todo/json_parsing.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/read_csv_file.py" "b/homeworks/Namxobick/\342\204\2266/todo/read_csv_file.py" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/todo/read_csv_file.py" rename to "homeworks/Namxobick/\342\204\2266/todo/read_csv_file.py" diff --git "a/homeworks/Yurin Andrey/\342\204\2266/todo/writer_xml.py" "b/homeworks/Namxobick/\342\204\2266/todo/writer_xml.py" similarity index 100% rename from "homeworks/Yurin Andrey/\342\204\2266/todo/writer_xml.py" rename to "homeworks/Namxobick/\342\204\2266/todo/writer_xml.py" From 50e6588ca5e44b8c2590a90e6fc8b301c7abb400 Mon Sep 17 00:00:00 2001 From: Namxobick Date: Sun, 30 Oct 2022 00:07:11 +0300 Subject: [PATCH 17/18] Changed folder name --- .../email.csv" => homeworks/Namxobick/6/files/email/email.csv | 0 .../files/users/1.xml" => homeworks/Namxobick/6/files/users/1.xml | 0 .../files/users/2.xml" => homeworks/Namxobick/6/files/users/2.xml | 0 .../files/users/5.xml" => homeworks/Namxobick/6/files/users/5.xml | 0 .../poetry.lock" => homeworks/Namxobick/6/poetry.lock | 0 .../pyproject.toml" => homeworks/Namxobick/6/pyproject.toml | 0 .../\342\204\2266/setup.cfg" => homeworks/Namxobick/6/setup.cfg | 0 .../todo/__init__.py" => homeworks/Namxobick/6/todo/__init__.py | 0 .../todo/__main__.py" => homeworks/Namxobick/6/todo/__main__.py | 0 .../todo/basic.py" => homeworks/Namxobick/6/todo/basic.py | 0 .../Namxobick/6/todo/json_parsing.py | 0 .../Namxobick/6/todo/read_csv_file.py | 0 .../writer_xml.py" => homeworks/Namxobick/6/todo/writer_xml.py | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename "homeworks/Namxobick/\342\204\2266/files/email/email.csv" => homeworks/Namxobick/6/files/email/email.csv (100%) rename "homeworks/Namxobick/\342\204\2266/files/users/1.xml" => homeworks/Namxobick/6/files/users/1.xml (100%) rename "homeworks/Namxobick/\342\204\2266/files/users/2.xml" => homeworks/Namxobick/6/files/users/2.xml (100%) rename "homeworks/Namxobick/\342\204\2266/files/users/5.xml" => homeworks/Namxobick/6/files/users/5.xml (100%) rename "homeworks/Namxobick/\342\204\2266/poetry.lock" => homeworks/Namxobick/6/poetry.lock (100%) rename "homeworks/Namxobick/\342\204\2266/pyproject.toml" => homeworks/Namxobick/6/pyproject.toml (100%) rename "homeworks/Namxobick/\342\204\2266/setup.cfg" => homeworks/Namxobick/6/setup.cfg (100%) rename "homeworks/Namxobick/\342\204\2266/todo/__init__.py" => homeworks/Namxobick/6/todo/__init__.py (100%) rename "homeworks/Namxobick/\342\204\2266/todo/__main__.py" => homeworks/Namxobick/6/todo/__main__.py (100%) rename "homeworks/Namxobick/\342\204\2266/todo/basic.py" => homeworks/Namxobick/6/todo/basic.py (100%) rename "homeworks/Namxobick/\342\204\2266/todo/json_parsing.py" => homeworks/Namxobick/6/todo/json_parsing.py (100%) rename "homeworks/Namxobick/\342\204\2266/todo/read_csv_file.py" => homeworks/Namxobick/6/todo/read_csv_file.py (100%) rename "homeworks/Namxobick/\342\204\2266/todo/writer_xml.py" => homeworks/Namxobick/6/todo/writer_xml.py (100%) diff --git "a/homeworks/Namxobick/\342\204\2266/files/email/email.csv" b/homeworks/Namxobick/6/files/email/email.csv similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/files/email/email.csv" rename to homeworks/Namxobick/6/files/email/email.csv diff --git "a/homeworks/Namxobick/\342\204\2266/files/users/1.xml" b/homeworks/Namxobick/6/files/users/1.xml similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/files/users/1.xml" rename to homeworks/Namxobick/6/files/users/1.xml diff --git "a/homeworks/Namxobick/\342\204\2266/files/users/2.xml" b/homeworks/Namxobick/6/files/users/2.xml similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/files/users/2.xml" rename to homeworks/Namxobick/6/files/users/2.xml diff --git "a/homeworks/Namxobick/\342\204\2266/files/users/5.xml" b/homeworks/Namxobick/6/files/users/5.xml similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/files/users/5.xml" rename to homeworks/Namxobick/6/files/users/5.xml diff --git "a/homeworks/Namxobick/\342\204\2266/poetry.lock" b/homeworks/Namxobick/6/poetry.lock similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/poetry.lock" rename to homeworks/Namxobick/6/poetry.lock diff --git "a/homeworks/Namxobick/\342\204\2266/pyproject.toml" b/homeworks/Namxobick/6/pyproject.toml similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/pyproject.toml" rename to homeworks/Namxobick/6/pyproject.toml diff --git "a/homeworks/Namxobick/\342\204\2266/setup.cfg" b/homeworks/Namxobick/6/setup.cfg similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/setup.cfg" rename to homeworks/Namxobick/6/setup.cfg diff --git "a/homeworks/Namxobick/\342\204\2266/todo/__init__.py" b/homeworks/Namxobick/6/todo/__init__.py similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/todo/__init__.py" rename to homeworks/Namxobick/6/todo/__init__.py diff --git "a/homeworks/Namxobick/\342\204\2266/todo/__main__.py" b/homeworks/Namxobick/6/todo/__main__.py similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/todo/__main__.py" rename to homeworks/Namxobick/6/todo/__main__.py diff --git "a/homeworks/Namxobick/\342\204\2266/todo/basic.py" b/homeworks/Namxobick/6/todo/basic.py similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/todo/basic.py" rename to homeworks/Namxobick/6/todo/basic.py diff --git "a/homeworks/Namxobick/\342\204\2266/todo/json_parsing.py" b/homeworks/Namxobick/6/todo/json_parsing.py similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/todo/json_parsing.py" rename to homeworks/Namxobick/6/todo/json_parsing.py diff --git "a/homeworks/Namxobick/\342\204\2266/todo/read_csv_file.py" b/homeworks/Namxobick/6/todo/read_csv_file.py similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/todo/read_csv_file.py" rename to homeworks/Namxobick/6/todo/read_csv_file.py diff --git "a/homeworks/Namxobick/\342\204\2266/todo/writer_xml.py" b/homeworks/Namxobick/6/todo/writer_xml.py similarity index 100% rename from "homeworks/Namxobick/\342\204\2266/todo/writer_xml.py" rename to homeworks/Namxobick/6/todo/writer_xml.py From cff5f2355d7e5cb847ff7ac51ee00e58163b7acc Mon Sep 17 00:00:00 2001 From: Namxobick Date: Mon, 21 Nov 2022 15:55:32 +0300 Subject: [PATCH 18/18] Changed file names and file json_parser.py json_parser.py: changed method get_email_id --- homeworks/Namxobick/6/poetry.lock | 129 ++++++++++++++++-- homeworks/Namxobick/6/pyproject.toml | 1 + homeworks/Namxobick/6/todo/__main__.py | 4 + homeworks/Namxobick/6/todo/basic.py | 4 +- .../todo/{json_parsing.py => json_parser.py} | 21 +-- .../{read_csv_file.py => reader_csv_file.py} | 0 6 files changed, 133 insertions(+), 26 deletions(-) rename homeworks/Namxobick/6/todo/{json_parsing.py => json_parser.py} (77%) rename homeworks/Namxobick/6/todo/{read_csv_file.py => reader_csv_file.py} (100%) diff --git a/homeworks/Namxobick/6/poetry.lock b/homeworks/Namxobick/6/poetry.lock index 783ee7f..a38c4c7 100644 --- a/homeworks/Namxobick/6/poetry.lock +++ b/homeworks/Namxobick/6/poetry.lock @@ -1,3 +1,20 @@ +[[package]] +name = "anyio" +version = "3.6.2" +description = "High level compatibility layer for multiple asynchronous event loop implementations" +category = "main" +optional = false +python-versions = ">=3.6.2" + +[package.dependencies] +idna = ">=2.8" +sniffio = ">=1.1" + +[package.extras] +doc = ["packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] +test = ["contextlib2", "coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "mock (>=4)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (<0.15)", "uvloop (>=0.15)"] +trio = ["trio (>=0.16,<0.22)"] + [[package]] name = "astor" version = "0.8.1" @@ -130,7 +147,7 @@ flake8 = ">=3.5,<6" [[package]] name = "flake8-bugbear" -version = "22.10.25" +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 @@ -156,7 +173,7 @@ flake8 = ">=2" [[package]] name = "flake8-comprehensions" -version = "3.10.0" +version = "3.10.1" description = "A flake8 plugin to help you write better list/set/dict comprehensions." category = "main" optional = false @@ -285,6 +302,52 @@ python-versions = ">=3.7" [package.dependencies] gitdb = ">=4.0.1,<5" +[[package]] +name = "h11" +version = "0.14.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +category = "main" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "httpcore" +version = "0.16.1" +description = "A minimal low-level HTTP client." +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +anyio = ">=3.0,<5.0" +certifi = "*" +h11 = ">=0.13,<0.15" +sniffio = ">=1.0.0,<2.0.0" + +[package.extras] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] + +[[package]] +name = "httpx" +version = "0.23.1" +description = "The next generation HTTP client." +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +certifi = "*" +httpcore = ">=0.15.0,<0.17.0" +rfc3986 = {version = ">=1.3,<2", extras = ["idna2008"]} +sniffio = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (>=8.0.0,<9.0.0)", "pygments (>=2.0.0,<3.0.0)", "rich (>=10,<13)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] + [[package]] name = "idna" version = "3.4" @@ -427,6 +490,20 @@ python-versions = "*" [package.dependencies] docutils = ">=0.11,<1.0" +[[package]] +name = "rfc3986" +version = "1.5.0" +description = "Validating URI References per RFC 3986" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +idna = {version = "*", optional = true, markers = "extra == \"idna2008\""} + +[package.extras] +idna2008 = ["idna"] + [[package]] name = "smmap" version = "5.0.0" @@ -435,6 +512,14 @@ category = "main" optional = false python-versions = ">=3.6" +[[package]] +name = "sniffio" +version = "1.3.0" +description = "Sniff out which async library your code is running under" +category = "main" +optional = false +python-versions = ">=3.7" + [[package]] name = "snowballstemmer" version = "2.2.0" @@ -445,7 +530,7 @@ python-versions = "*" [[package]] name = "stevedore" -version = "4.1.0" +version = "4.1.1" description = "Manage dynamic plugins for Python applications" category = "main" optional = false @@ -518,9 +603,13 @@ dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [metadata] lock-version = "1.1" python-versions = "^3.10" -content-hash = "32db271446ad0a1ae8a378422c1709486c4fdbcc4329844fd595a63f963a4304" +content-hash = "f6b798cf013c89838aecdcdd4a5af5b969d7875b189e69fa33df0072d052a2ec" [metadata.files] +anyio = [ + {file = "anyio-3.6.2-py3-none-any.whl", hash = "sha256:fbbe32bd270d2a2ef3ed1c5d45041250284e31fc0a4df4a5a6071842051a51e3"}, + {file = "anyio-3.6.2.tar.gz", hash = "sha256:25ea0d673ae30af41a0c442f81cf3b38c7e79fdc7b60335a4c14e05eb0947421"}, +] astor = [ {file = "astor-0.8.1-py2.py3-none-any.whl", hash = "sha256:070a54e890cefb5b3739d19f30f5a5ec840ffc9c50ffa7d23cc9fc1a38ebbfc5"}, {file = "astor-0.8.1.tar.gz", hash = "sha256:6a6effda93f4e1ce9f618779b2dd1d9d84f1e32812c23a29b3fff6fd7f63fa5e"}, @@ -570,16 +659,16 @@ flake8-broken-line = [ {file = "flake8_broken_line-0.5.0-py3-none-any.whl", hash = "sha256:daafb19b67eead0410ce7ba155d51a15b9d020ebe7630d87de9c2b93cedb6703"}, ] flake8-bugbear = [ - {file = "flake8-bugbear-22.10.25.tar.gz", hash = "sha256:89e51284eb929fbb7f23fbd428491e7427f7cdc8b45a77248daffe86a039d696"}, - {file = "flake8_bugbear-22.10.25-py3-none-any.whl", hash = "sha256:584631b608dc0d7d3f9201046d5840a45502da4732d5e8df6c7ac1694a91cb9e"}, + {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"}, + {file = "flake8-comprehensions-3.10.1.tar.gz", hash = "sha256:412052ac4a947f36b891143430fef4859705af11b2572fbb689f90d372cf26ab"}, + {file = "flake8_comprehensions-3.10.1-py3-none-any.whl", hash = "sha256:d763de3c74bc18a79c039a7ec732e0a1985b0c79309ceb51e56401ad0a2cd44e"}, ] flake8-debugger = [ {file = "flake8-debugger-4.1.2.tar.gz", hash = "sha256:52b002560941e36d9bf806fca2523dc7fb8560a295d5f1a6e15ac2ded7a73840"}, @@ -620,6 +709,18 @@ gitpython = [ {file = "GitPython-3.1.29-py3-none-any.whl", hash = "sha256:41eea0deec2deea139b459ac03656f0dd28fc4a3387240ec1d3c259a2c47850f"}, {file = "GitPython-3.1.29.tar.gz", hash = "sha256:cc36bfc4a3f913e66805a28e84703e419d9c264c1077e537b54f0e1af85dbefd"}, ] +h11 = [ + {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, + {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, +] +httpcore = [ + {file = "httpcore-0.16.1-py3-none-any.whl", hash = "sha256:8d393db683cc8e35cc6ecb02577c5e1abfedde52b38316d038932a84b4875ecb"}, + {file = "httpcore-0.16.1.tar.gz", hash = "sha256:3d3143ff5e1656a5740ea2f0c167e8e9d48c5a9bbd7f00ad1f8cff5711b08543"}, +] +httpx = [ + {file = "httpx-0.23.1-py3-none-any.whl", hash = "sha256:0b9b1f0ee18b9978d637b0776bfd7f54e2ca278e063e3586d8f01cda89e042a8"}, + {file = "httpx-0.23.1.tar.gz", hash = "sha256:202ae15319be24efe9a8bd4ed4360e68fde7b38bcc2ce87088d416f026667d19"}, +] idna = [ {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, @@ -709,17 +810,25 @@ requests = [ restructuredtext-lint = [ {file = "restructuredtext_lint-1.4.0.tar.gz", hash = "sha256:1b235c0c922341ab6c530390892eb9e92f90b9b75046063e047cacfb0f050c45"}, ] +rfc3986 = [ + {file = "rfc3986-1.5.0-py2.py3-none-any.whl", hash = "sha256:a86d6e1f5b1dc238b218b012df0aa79409667bb209e58da56d0b94704e712a97"}, + {file = "rfc3986-1.5.0.tar.gz", hash = "sha256:270aaf10d87d0d4e095063c65bf3ddbc6ee3d0b226328ce21e036f946e421835"}, +] smmap = [ {file = "smmap-5.0.0-py3-none-any.whl", hash = "sha256:2aba19d6a040e78d8b09de5c57e96207b09ed71d8e55ce0959eeee6c8e190d94"}, {file = "smmap-5.0.0.tar.gz", hash = "sha256:c840e62059cd3be204b0c9c9f74be2c09d5648eddd4580d9314c3ecde0b30936"}, ] +sniffio = [ + {file = "sniffio-1.3.0-py3-none-any.whl", hash = "sha256:eecefdce1e5bbfb7ad2eeaabf7c1eeb404d7757c379bd1f7e5cce9d8bf425384"}, + {file = "sniffio-1.3.0.tar.gz", hash = "sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101"}, +] 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"}, + {file = "stevedore-4.1.1-py3-none-any.whl", hash = "sha256:aa6436565c069b2946fe4ebff07f5041e0c8bf18c7376dd29edf80cf7d524e4e"}, + {file = "stevedore-4.1.1.tar.gz", hash = "sha256:7f8aeb6e3f90f96832c301bff21a7eb5eefbe894c88c506483d355565d88cc1a"}, ] typing-extensions = [ {file = "typing_extensions-4.4.0-py3-none-any.whl", hash = "sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e"}, diff --git a/homeworks/Namxobick/6/pyproject.toml b/homeworks/Namxobick/6/pyproject.toml index 2b47c60..ec806fc 100644 --- a/homeworks/Namxobick/6/pyproject.toml +++ b/homeworks/Namxobick/6/pyproject.toml @@ -10,6 +10,7 @@ python = "^3.10" loguru = "^0.6.0" requests = "^2.28.1" wemake-python-styleguide = "^0.17.0" +httpx = "^0.23.1" [build-system] diff --git a/homeworks/Namxobick/6/todo/__main__.py b/homeworks/Namxobick/6/todo/__main__.py index d3cd584..3a99b33 100644 --- a/homeworks/Namxobick/6/todo/__main__.py +++ b/homeworks/Namxobick/6/todo/__main__.py @@ -1,3 +1,4 @@ +from datetime import datetime from typing import Final from basic import basic @@ -6,10 +7,13 @@ def main(): """Main method. Entry point.""" + start_time = datetime.now() try: basic(PATH_EMAIL, PATH_JSON) except Exception as ex: logger.critical('You have done something wrong!', ex) + end_time = datetime.now() + logger.info('Took {0}'.format(end_time - start_time)) if __name__ == '__main__': diff --git a/homeworks/Namxobick/6/todo/basic.py b/homeworks/Namxobick/6/todo/basic.py index 21e163e..3633ebd 100644 --- a/homeworks/Namxobick/6/todo/basic.py +++ b/homeworks/Namxobick/6/todo/basic.py @@ -1,7 +1,7 @@ import re -import json_parsing as scraping -import read_csv_file as csv +import json_parser as scraping +import reader_csv_file as csv from loguru import logger from writer_xml import write_xml diff --git a/homeworks/Namxobick/6/todo/json_parsing.py b/homeworks/Namxobick/6/todo/json_parser.py similarity index 77% rename from homeworks/Namxobick/6/todo/json_parsing.py rename to homeworks/Namxobick/6/todo/json_parser.py index f1ac92d..bdb9e89 100644 --- a/homeworks/Namxobick/6/todo/json_parsing.py +++ b/homeworks/Namxobick/6/todo/json_parser.py @@ -22,23 +22,16 @@ def get_email_id(path: str) -> dict: """ logger.info('The beginning of requests users from the site') user_email_id: dict[str:int] = {} - user = 1 - while True: - response = requests.get(path + '/{0}'.format(user)) - user_info = response.json() - if not user_info: - break - - logger.info(('Request to {0} (ID: {1}) took {2}'.format( - user_info.get('email'), - user_info.get('id'), - response.elapsed, - ))) + response = requests.get(path) + users_info = response.json() + for user_info in users_info: user_email_id[user_info.get('email')] = user_info.get('id') - user += 1 - logger.info('The ending of requests users from the site') + logger.info('The ending of requests users from the site: took {0}'.format( + response.elapsed, + )) + logger.info('Users: {0}'.format(user_email_id)) return user_email_id diff --git a/homeworks/Namxobick/6/todo/read_csv_file.py b/homeworks/Namxobick/6/todo/reader_csv_file.py similarity index 100% rename from homeworks/Namxobick/6/todo/read_csv_file.py rename to homeworks/Namxobick/6/todo/reader_csv_file.py