From 515fdddee7676a3c558e62db36e1d6cc21926348 Mon Sep 17 00:00:00 2001 From: Ivan Miatselski Date: Wed, 20 Apr 2022 17:57:56 +0300 Subject: [PATCH 01/52] added files for session 5 homework --- .DS_Store | Bin 0 -> 6148 bytes Homework-5_Working-with-data.md | 114 ++++ custom.py | 6 + data/lorem_ipsum.txt | 19 + data/students.csv | 1001 +++++++++++++++++++++++++++++++ data/unsorted_names.txt | 199 ++++++ modules/legb.py | 10 + modules/mod_a.py | 8 + modules/mod_b.py | 4 + modules/mod_c.py | 1 + names.txt | 1 + package/__init__.py | 4 + package/__main__.py | 20 + package/skill_c.py | 2 + package/skill_linux.py | 2 + package/skill_nim.py | 2 + package/skill_python.py | 2 + package2/__init__.py | 0 package2/__main__.py | 12 + package2/skill_java.py | 2 + sh.txt | 41 ++ storage.data | Bin 0 -> 51 bytes 22 files changed, 1450 insertions(+) create mode 100644 .DS_Store create mode 100644 Homework-5_Working-with-data.md create mode 100644 custom.py create mode 100644 data/lorem_ipsum.txt create mode 100644 data/students.csv create mode 100644 data/unsorted_names.txt create mode 100644 modules/legb.py create mode 100644 modules/mod_a.py create mode 100644 modules/mod_b.py create mode 100644 modules/mod_c.py create mode 100644 names.txt create mode 100644 package/__init__.py create mode 100644 package/__main__.py create mode 100644 package/skill_c.py create mode 100644 package/skill_linux.py create mode 100644 package/skill_nim.py create mode 100644 package/skill_python.py create mode 100644 package2/__init__.py create mode 100644 package2/__main__.py create mode 100644 package2/skill_java.py create mode 100644 sh.txt create mode 100644 storage.data diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..9bebded487000c0c12182c5a1a5b07a32b03c1cf GIT binary patch literal 6148 zcmeHKJ5Iwu5PbudutbxRa<2dCnFnL%+yecW7;c4tt!jpVr^t9RmXw z^f=-)4}CEIfH&G#9H*fcvk)Gp!S%PuNHUNNBm>DnGVp&GV9!=*ZynPn1Ia)#@WX)K z4~42&14l=@I%sSJAnI?t3D-7D5Q{p9HE?vKhaz4|^iqitL%f{+5_vUnbo6pa3?C9F zOH3$Yr}O#6(jnC`Z8DGy%o(`$?MD0mBXwo|pBLpW8At~H6a&)io_1S)QuNlv$7!!E t)Mx6qFxS#)tQ8Zj6?3Dl_->L{bj^4T938Ekek&*DkAU)$k_`L?17E}FCFTGC literal 0 HcmV?d00001 diff --git a/Homework-5_Working-with-data.md b/Homework-5_Working-with-data.md new file mode 100644 index 00000000..b6a55c93 --- /dev/null +++ b/Homework-5_Working-with-data.md @@ -0,0 +1,114 @@ +# Python Practice - Session 4 + + +### Task 4.1 +Open file `data/unsorted_names.txt` in data folder. Sort the names and write them to a new file called `sorted_names.txt`. Each name should start with a new line as in the following example: + +``` +Adele +Adrienne +... +Willodean +Xavier +``` + +### Task 4.2 +Implement a function which search for most common words in the file. +Use `data/lorem_ipsum.txt` file as a example. + +```python +def most_common_words(filepath, number_of_words=3): + pass + +print(most_common_words('lorem_ipsum.txt')) +>>> ['donec', 'etiam', 'aliquam'] +``` + +> NOTE: Remember about dots, commas, capital letters etc. + +### Task 4.3 +File `data/students.csv` stores information about students in [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) format. +This file contains the student’s names, age and average mark. +1) Implement a function which receives file path and returns names of top performer students +```python +def get_top_performers(file_path, number_of_top_students=5): + pass + +print(get_top_performers("students.csv")) +>>> ['Teresa Jones', 'Richard Snider', 'Jessica Dubose', 'Heather Garcia', 'Joseph Head'] +``` + +2) Implement a function which receives the file path with srudents info and writes CSV student information to the new file in descending order of age. +Result: +``` +student name,age,average mark +Verdell Crawford,30,8.86 +Brenda Silva,30,7.53 +... +Lindsey Cummings,18,6.88 +Raymond Soileau,18,7.27 +``` + +### Task 4.4 +Look through file `modules/legb.py`. + +1) Find a way to call `inner_function` without moving it from inside of `enclosed_function`. + +2.1) Modify ONE LINE in `inner_function` to make it print variable 'a' from global scope. + +2.2) Modify ONE LINE in `inner_function` to make it print variable 'a' form enclosing function. + +### Task 4.5 +Implement a decorator `remember_result` which remembers last result of function it decorates and prints it before next call. + +```python +@remember_result +def sum_list(*args): + result = "" + for item in args: + result += item + print(f"Current result = '{result}'") + return result + +sum_list("a", "b") +>>> "Last result = 'None'" +>>> "Current result = 'ab'" +sum_list("abc", "cde") +>>> "Last result = 'ab'" +>>> "Current result = 'abccde'" +sum_list(3, 4, 5) +>>> "Last result = 'abccde'" +>>> "Current result = '12'" +``` + +### Task 4.6 +Implement a decorator `call_once` which runs a function or method once and caches the result. +All consecutive calls to this function should return cached result no matter the arguments. + +```python +@call_once +def sum_of_numbers(a, b): + return a + b + +print(sum_of_numbers(13, 42)) +>>> 55 +print(sum_of_numbers(999, 100)) +>>> 55 +print(sum_of_numbers(134, 412)) +>>> 55 +print(sum_of_numbers(856, 232)) +>>> 55 +``` + + +### Task 4.7* +Run the module `modules/mod_a.py`. Check its result. Explain why does this happen. +Try to change x to a list `[1,2,3]`. Explain the result. +Try to change import to `from x import *` where x - module names. Explain the result. + + +### Materials +* [Decorators](https://realpython.com/primer-on-python-decorators/) +* [Decorators in python](https://www.geeksforgeeks.org/decorators-in-python/) +* [Python imports](https://pythonworld.ru/osnovy/rabota-s-modulyami-sozdanie-podklyuchenie-instrukciyami-import-i-from.html) +* [Files in python](https://realpython.com/read-write-files-python/) diff --git a/custom.py b/custom.py new file mode 100644 index 00000000..d322fe97 --- /dev/null +++ b/custom.py @@ -0,0 +1,6 @@ +def say_hello(name): + print(f'Hello! I\'m {name}') + + +def say_bye(): + print('Hasta la vista, baby') diff --git a/data/lorem_ipsum.txt b/data/lorem_ipsum.txt new file mode 100644 index 00000000..3c572faf --- /dev/null +++ b/data/lorem_ipsum.txt @@ -0,0 +1,19 @@ +Lorem ipsum suspendisse nostra ullamcorper diam donec etiam nulla sagittis est aliquam, dictum aliquet luctus risus est habitant suspendisse luctus id inceptos lectus, aenean donec maecenas donec aenean fringilla vitae fermentum venenatis enim ultrices per etiam ut aenean odio. + +Habitasse ad sollicitudin arcu senectus enim etiam platea quisque purus odio sociosqu maecenas habitant, quisque laoreet himenaeos elementum consequat auctor ad dictum viverra donec faucibus enim scelerisque eu sodales vel lobortis euismod cubilia, dictum ut consectetur nisi litora ut, blandit vehicula sapien et fames tempor congue tristique urna inceptos neque suspendisse felis venenatis cras metus risus tellus nulla imperdiet maecenas potenti vestibulum id aliquam himenaeos a primis tortor, facilisis ullamcorper donec augue integer euismod habitasse orci vestibulum convallis. + +Augue eget primis sit iaculis placerat viverra conubia class consectetur porttitor luctus aenean, dui hac quis eros vivamus praesent taciti arcu nullam semper ullamcorper, maecenas turpis quis metus fringilla aptent et etiam rutrum viverra integer orci fermentum lacinia risus purus rhoncus torquent aenean augue felis ultricies, donec luctus dui eros pulvinar primis bibendum accumsan purus donec pharetra, eleifend varius lorem fames at viverra praesent justo lectus. + +Ligula tincidunt ultrices et lobortis ultrices mollis quisque egestas bibendum, etiam maecenas consectetur quam non ornare dictum donec nullam, platea aliquet duis aenean cras placerat aliquam integer venenatis interdum gravida est massa faucibus porta arcu, velit urna cursus laoreet vulputate dictumst hendrerit ornare, torquent ultricies metus sed turpis scelerisque suspendisse vulputate cubilia gravida suspendisse neque consequat laoreet, odio faucibus vestibulum cras cursus urna tincidunt, euismod nulla auctor eu diam habitant. + +Faucibus maecenas dapibus hendrerit conubia maecenas eros tempus molestie tincidunt dolor, lacinia himenaeos etiam duis nec felis hac interdum malesuada pharetra praesent, nostra ut donec non id tempus at ultricies sodales dapibus id per magna erat justo phasellus, lorem tellus neque enim quam vivamus, congue ad leo iaculis libero blandit eros interdum nullam rhoncus porta aliquam tristique fringilla, faucibus augue elit quis auctor volutpat imperdiet curabitur, tortor pellentesque vehicula fames venenatis aliquam cursus. + +At volutpat himenaeos eleifend mollis nunc per leo diam per leo mollis, sagittis etiam tortor arcu suscipit egestas et ullamcorper mollis commodo at ornare at ante sociosqu sed in, elementum primis curae enim suspendisse volutpat condimentum, id in ad eu maecenas aliquam proin erat magna vivamus fermentum blandit nec faucibus, viverra torquent massa tortor adipiscing ad consectetur interdum aptent, magna accumsan egestas magna ut iaculis est. + +Dictum aenean integer interdum sed potenti tincidunt sem aptent, gravida nunc malesuada bibendum class quam taciti duis a, ipsum orci proin mollis lorem in himenaeos. + +Sed tincidunt lectus ad pharetra vel proin massa aliquam molestie, lectus vel primis facilisis aliquam lacinia ultricies fames feugiat, eleifend tempus sodales volutpat congue dolor primis pulvinar tellus lorem risus porttitor morbi vivamus turpis scelerisque habitant cursus, vivamus morbi quisque class eget aliquet suspendisse laoreet faucibus, pulvinar vulputate at cursus morbi ac euismod lectus aenean potenti pellentesque conubia etiam porttitor tincidunt quisque adipiscing laoreet lobortis nulla sociosqu lobortis consectetur lobortis iaculis ad blandit donec sapien in vehicula tellus est vivamus taciti ultrices fermentum viverra turpis volutpat ligula. + +Vehicula nullam hac lacinia nunc pulvinar nullam quam leo proin, in tristique donec pretium vestibulum consectetur pulvinar bibendum egestas, pharetra habitasse class vitae quisque phasellus turpis non eleifend arcu ultricies blandit curabitur venenatis rutrum vivamus a, primis urna viverra accumsan tristique mi vulputate. + +Netus enim eros sed duis nostra vestibulum nulla, urna eleifend curabitur lobortis aliquet cursus himenaeos primis, quam pharetra cursus urna quisque a ipsum nibh dapibus diam ante proin convallis venenatis accumsan lorem est tortor inceptos lacinia vestibulum lobortis metus praesent leo eget in ante volutpat consectetur diam. \ No newline at end of file diff --git a/data/students.csv b/data/students.csv new file mode 100644 index 00000000..ee7209a3 --- /dev/null +++ b/data/students.csv @@ -0,0 +1,1001 @@ +student name,age,average mark +Willie Gray,22,8.6 +Phyllis Deloach,25,6.09 +Dewey Killingsworth,20,9.31 +Patricia Daniels,29,8.39 +Anne Mandrell,19,9.63 +Verdell Crawford,30,8.86 +Mario Lilley,24,5.78 +Francisco Jones,25,9.01 +Donald Laurent,29,4.34 +Denise Via,27,8.11 +Scott Lange,19,6.65 +Brenda Silva,30,7.53 +James Ross,29,6.72 +Kimberly Brown,18,7.05 +Heather Winnike,25,4.25 +Benjamin Getty,25,7.85 +Linda Crider,26,9.52 +Garrett Mitchell,18,4.01 +Thomas Roberts,28,5.28 +Pauline Montoya,29,9.09 +Georgia Wilson,27,6.52 +Roberta Kelly,23,8.09 +Johnny Jennings,22,7.54 +Sherry Grant,28,4.43 +Andrew Schmidt,29,7.55 +Carole Tewani,20,6.49 +Linda Miller,23,6.79 +Mary Glasser,30,9.77 +Ruby Greig,21,7.59 +Rosie Watkins,26,4.08 +Wilma Dominguez,26,6.94 +Daniel Youd,20,9.67 +Tamara Harris,24,9.92 +Arnoldo Ewert,24,9.54 +John Velazquez,18,8.5 +Audrey Camille,30,4.15 +Helen Klein,18,6.5 +Eric Ruegg,22,8.48 +Vera Charles,22,5.81 +Annie Sudbeck,28,9.85 +Michael Clark,20,5.8 +Rosa Thomas,30,4.17 +Daisy Granados,22,4.12 +Betty Mabry,18,5.74 +Bertha Gary,26,8.26 +Vickie Laigo,21,8.89 +Richard Grant,24,9.07 +Linda Harrison,27,9.96 +Phyllis Cole,18,5.31 +Devin Spencer,25,7.79 +George Guest,28,9.94 +Kim Pyles,30,9.87 +Kristin Dean,18,9.75 +Clarence Cantu,21,9.19 +Kenneth Evans,21,4.86 +Frank Borgeson,24,9.65 +Richard Grossman,24,8.42 +Ann White,29,4.26 +Virginia Harris,22,9.29 +Maria Benear,28,9.12 +George Leno,30,9.47 +Richard Hamrick,21,8.86 +Tony Engel,21,9.61 +Scott Miller,25,8.95 +Bridget Cotter,29,7.8 +Terry Major,30,8.45 +Maria Boswell,29,8.39 +Ronald Oliver,27,4.15 +Delilah Howard,20,5.64 +Jose Paul,22,5.41 +Francisco Miller,26,8.81 +Josephine Perkins,25,9.58 +Gerald Murray,28,7.04 +Randy Hord,21,8.42 +Janee Bailey,22,6.79 +Martha Pitcher,30,7.6 +Renee Pagan,24,4.62 +Kenneth Rummel,28,6.6 +Doretha Ferguson,30,8.18 +Donald Luevano,24,5.15 +Valerie Mondragon,27,9.54 +Gladys Gomez,19,6.36 +Christin Cross,22,4.4 +Robert Birmingham,22,5.73 +Willie Eskridge,27,6.52 +Josephina Medina,23,10.0 +Burl Navarro,27,7.61 +Lila Hill,29,9.83 +David Roberts,20,9.41 +Travis Rhyne,23,8.16 +Robert Kirkland,21,4.99 +John Torres,24,8.33 +Cindy Nilson,23,8.16 +Steven Lawson,21,4.37 +Sylvia Kuhn,23,8.91 +Richard Crawford,28,7.76 +Fred Maestas,28,5.83 +Janie Waterman,22,8.49 +Paula Morales,28,7.51 +Lawrence Bentson,27,8.47 +Hattie Bramer,18,9.71 +Cynthia Beegle,20,5.79 +Sarah Martindale,26,7.16 +Shawn Bonifacio,26,6.26 +Lena Weston,29,8.01 +Joyce Beatty,23,9.65 +Juan Dunn,22,8.26 +Barry Mckenzie,20,9.63 +Joyce Foley,18,6.57 +Doris Kuck,21,5.73 +Kim Cohran,21,5.0 +Robert Martin,25,7.14 +George Jackson,25,9.67 +David Hayden,19,7.08 +David Barnas,20,4.7 +Amada Duncan,30,9.22 +Kathryn Harryman,28,6.82 +Janette Law,26,7.02 +Tonja Bull,21,5.36 +Alissa Belyoussian,25,6.54 +Lou Bible,26,8.37 +Marc Bibbs,18,6.26 +Arthur Kuhl,18,6.48 +Martha Woods,23,6.83 +Jeffrey Petty,20,6.36 +Harry Dampeer,21,7.81 +Wesley Wolf,18,9.2 +Elizabeth Lowe,28,7.42 +Marvin Silvas,26,6.27 +Donald Hardnett,19,7.21 +Michael Mcdonald,27,9.36 +Edna Mahoney,23,5.24 +Deborah Penn,18,7.98 +Ethel Disher,22,4.28 +Michael Jackson,23,4.31 +Kevin Houston,19,6.53 +Margaret Branstetter,28,6.57 +Billy Henry,27,7.35 +Christopher Mcintire,25,8.54 +Amy Martin,21,7.13 +Stephanie Grose,27,5.11 +Deanna Kathan,30,8.9 +Ann Arteaga,26,8.33 +David Goins,29,6.27 +Paul Alexander,21,5.24 +Robert Parker,18,8.88 +Patricia York,27,6.87 +Donna Baker,21,4.17 +Carla Morris,21,5.92 +John Hubbard,27,6.59 +Oscar Linahan,28,4.68 +David Cain,30,6.75 +Cindy Oconnor,22,4.74 +Nicholas Richter,20,6.46 +Faye Roberge,18,8.49 +Jessica Keenan,21,9.9 +Rebecca Garcia,22,4.22 +Esther Simmering,28,9.31 +Lou Houston,22,9.91 +Rebecca Gillies,19,4.09 +Philip Urbanski,21,8.87 +Teresa Perkins,24,5.85 +Mary Holley,25,6.74 +Tricia Davanzo,19,5.17 +Bridget Mcneal,26,5.46 +Douglas Holland,27,6.25 +Justin Whitmer,22,5.62 +David Davis,18,6.81 +Frances Kerr,27,8.3 +Kim Ellis,24,8.32 +Brian Brown,21,6.25 +Monica Lubrano,22,8.02 +Joyce Skaggs,29,8.43 +Penelope Fries,18,6.81 +Alice Randolph,26,8.1 +Jeffrey Ermitanio,28,9.5 +Stephanie Davis,27,9.36 +John Snow,30,8.67 +Barbara Gott,23,8.69 +Sharon Deleon,19,7.66 +Rigoberto Wilenkin,28,7.71 +Mathew Embree,24,5.97 +Bobby Walker,27,4.85 +Jacqueline Macias,27,8.76 +Benjamin Beck,27,8.8 +Steve Williams,22,6.99 +James Elick,29,9.68 +Elva Diaz,20,7.79 +Terrance Bruce,25,6.96 +Mark Pearson,24,8.49 +Arthur Lowrey,28,8.1 +Scott Lopez,18,4.67 +Hilario Lewis,24,8.95 +Esther Urbancic,18,8.93 +Eric Long,20,4.9 +Matthew Perry,18,4.48 +Lois Alexander,18,5.42 +James Brokaw,28,6.26 +Donald Lewis,27,8.64 +Amanda Gunderson,22,4.73 +Ryan Henricks,29,8.58 +Michelle Mori,25,5.38 +Stacy Erickson,22,5.69 +Kevin Hadley,30,4.64 +Daniel Lopez,23,4.66 +Jose Perez,22,4.53 +Nina Earp,21,9.88 +Richard Stellhorn,21,7.53 +Travis Sanchez,22,5.92 +Earl Anderson,29,4.2 +Antonio Watts,21,7.73 +Katia Cowan,19,7.55 +Michael Routzahn,29,5.97 +Teresa Baridon,26,8.05 +Bertram Eilerman,18,6.18 +Dianne Lucero,22,8.73 +Barbara Fine,28,4.7 +Betty Ferreira,25,6.18 +Charles Jimeson,24,4.34 +Marta Wang,27,4.33 +Travis Stanphill,29,8.21 +John Ashley,24,6.39 +John Merkel,28,7.08 +Josephine Zechman,20,9.64 +Mark Haven,27,8.27 +Carlos London,28,7.19 +Annemarie Keller,30,7.62 +Robert Mccollough,24,5.85 +Harold Slater,21,8.63 +Benjamin Sykes,30,6.9 +Vickie Potter,23,4.77 +Susan Chavis,29,5.89 +Patricia Robinson,18,5.61 +Florence Smith,21,9.62 +Olimpia Connolly,26,6.06 +Robert Stehlik,22,8.79 +Harry Mckenzie,24,4.15 +Kelly Friel,23,4.44 +Therese Butts,29,8.26 +Brian Cole,28,8.75 +Michael Zable,30,5.07 +Otis Bubar,27,6.14 +John Valdez,25,4.97 +Denise Tanner,28,8.19 +Catherine Wagner,30,4.32 +Lorenzo Dayton,22,9.9 +Shelby Martinez,26,5.74 +Nina Berner,25,9.67 +Rachel Bapties,26,8.1 +Wesley Byron,18,8.03 +Gregory Mccollum,30,9.8 +Diane Brady,29,9.86 +Christopher Hahn,21,5.22 +Dennis Rogers,19,4.47 +Gerald Hartley,21,5.9 +Barbara Pagan,23,4.32 +Trevor Hansen,30,6.03 +Pamela Alexander,30,6.6 +Don Smith,28,7.32 +Thomas Hill,26,6.0 +Catina Burgin,29,8.47 +James Moore,23,7.56 +Dorothy Laudat,24,7.63 +Eloise Griner,26,9.36 +Edna Huey,26,7.15 +Cheryl Bennett,24,9.01 +George Woodard,29,7.87 +Louis French,28,7.63 +Ruth Campbell,22,5.99 +Anna Johansson,26,5.47 +Cindy Christiansen,30,6.47 +Buck Buban,23,8.28 +Maria Wolfson,29,9.3 +Joyce Abernathy,21,8.27 +Adam Campbell,20,4.88 +Astrid Denoon,25,6.89 +Vera Mcdaniel,28,6.77 +Teresa Triplett,20,7.02 +Stacy Dingle,27,5.94 +Peter Hutchins,30,4.16 +Emma Garfield,23,4.24 +George Ober,19,9.47 +Linda Estrada,21,6.84 +Jimmy Gee,24,9.77 +Juanita Kimple,26,5.07 +Morris Todd,24,7.88 +Ruth Minor,30,4.32 +Hilda Kofford,29,6.36 +Jennifer Loftus,27,5.67 +Kristy Gilbert,28,6.41 +Juan Wall,22,8.08 +Brandy Crockett,29,5.63 +Stanley Guerrero,27,5.92 +Kelly Baker,18,5.7 +Thomas Phelan,29,4.34 +Sarah Dye,22,7.13 +Denise Myers,22,8.26 +Wallace Lafleur,30,7.25 +Esther Yother,18,9.38 +Nicole Bussman,20,6.86 +Edgar Meacham,24,5.6 +Michael Dorland,27,7.83 +Brenda Baumgartner,25,8.59 +Loretta Bonsall,30,9.93 +Arturo Orange,18,4.08 +Larry Sims,22,7.41 +Christopher Greene,28,4.63 +Teresa Owings,28,9.74 +Linda Herrington,26,5.62 +Dora Hass,28,5.83 +Joan Bodo,27,5.42 +Thomas Steel,21,7.04 +Walter Musick,28,4.47 +Suzy Williams,18,4.62 +Reginald Wilke,20,5.84 +Anthony Gunter,30,4.74 +Carlyn Harris,18,5.63 +Elizabeth Scharf,28,8.47 +Arlinda Kierzewski,26,5.12 +Glenn Herren,24,8.62 +Carolyn Weiss,20,6.36 +Evelyn Curles,24,6.1 +Kenneth Chase,25,6.73 +Sue Carlock,19,6.6 +Terry Chandler,30,5.21 +Margaret Fahnestock,26,7.08 +Terry Dale,18,7.86 +Dorothy Burke,27,5.06 +John Holm,30,9.92 +Frederick Teel,22,8.66 +Randy Wylie,22,4.58 +Charles Miller,18,6.7 +Leslie Johnson,26,6.99 +Charlotte Leftwich,30,7.96 +Donald Colantuono,30,4.91 +Gina Rice,21,7.39 +Ethel Freeman,19,4.38 +Paul Thrasher,19,5.78 +Marci Trimble,21,8.43 +Lenny Castoe,29,4.36 +Melissa Wozniak,20,9.13 +Jan Cunningham,30,8.83 +Daniel Hoobler,23,5.17 +Anna Dixon,21,9.46 +Xavier Bishop,28,6.34 +William Nighman,26,5.07 +Reinaldo Varrone,28,9.89 +Gregory Schick,21,5.9 +Kenneth Water,25,4.68 +Ruby Winkler,24,5.61 +Michael Weaver,21,7.59 +Mark Jewell,21,9.15 +Mary Buchanon,23,4.51 +Michelle Mayhugh,25,6.19 +Edna Avery,28,4.73 +James Jenkins,23,5.79 +Alex Heefner,21,5.12 +Karen Denny,21,4.58 +Matthew Gonzales,22,7.54 +Linda Quella,24,8.31 +Lynn Jones,30,5.8 +Darryl Sutton,30,4.43 +Marietta Ward,28,5.78 +Gregory Knight,18,9.64 +Terri Kelly,26,5.45 +Peter Nevills,23,8.13 +Christopher Ouzts,19,9.8 +Maxine Zirin,20,6.1 +Ruth Young,20,5.34 +David Phillies,30,6.85 +Lisa Sullivan,25,5.55 +David Bourque,25,8.96 +Adrianne Ali,20,6.84 +Ernest Sommerville,27,4.16 +Virginia Price,21,8.39 +Leon Morgan,24,5.34 +William Johnson,25,9.86 +Nicholas Mathes,18,4.47 +Alisa Smith,25,7.21 +Yolanda Mays,27,5.57 +Edith Shaffner,24,5.91 +William Gonzales,30,6.71 +Krista Henley,23,8.14 +Yvonne King,19,6.73 +Laura Hoffmann,29,6.1 +Raymond Brooks,27,9.49 +Arthur Loveless,30,5.47 +Louis Jones,30,5.97 +Sabine Smith,26,7.87 +David Hill,21,8.02 +John Gary,21,6.78 +Johnny Huffman,18,5.98 +Audrey Williams,18,6.78 +Kelly Rodriguez,19,8.71 +Keneth Burch,26,5.8 +Sean Fox,24,7.69 +Jan Leclair,22,8.35 +Eric Feagin,22,8.85 +Armanda Horgan,28,8.4 +Kenneth Joyce,18,9.62 +Maria Breton,22,7.93 +David Parr,21,5.87 +Logan Bartolet,24,7.59 +Hubert Williams,29,6.88 +Linda Foulkes,20,9.25 +Phyllis Thomas,25,9.08 +Lucille Berry,25,8.68 +Frank Beauchesne,24,5.55 +Kathryn Brown,19,6.24 +Marilyn Mathews,29,6.05 +Tim Moscoso,30,8.25 +William Milligan,20,8.15 +Nicholas Hahn,22,7.67 +Melinda Ludgate,19,9.48 +Theodore Yates,27,7.25 +Ester Leis,21,6.43 +Francis Robinson,27,4.19 +Tina Bath,26,8.4 +Mandy Hambric,29,8.22 +Jose Martin,21,4.07 +Helen Shoemake,24,8.07 +Richard Castro,19,4.91 +Willie Lowell,19,9.54 +Jennie Ramlall,21,4.5 +Karen Gavin,26,7.41 +Michael Mckinnon,28,4.23 +Priscilla Roper,20,6.69 +Jonathan Newsome,18,4.97 +Anthony Branch,25,6.3 +Robert Gibson,30,6.59 +Thomas Schade,23,4.16 +Kirby Green,27,7.6 +Brian Edwards,18,4.79 +Debra Flores,21,6.25 +David Macleod,21,9.12 +Lois Nelsen,30,5.88 +Wanda Jones,21,6.75 +Marsha Robinson,18,8.76 +Nicole Jeffries,28,9.94 +Ann Turner,24,6.25 +Agnes Warnock,25,9.38 +Darlene Wertman,21,9.53 +Leo Fleming,27,5.88 +Nicholas Maldonado,26,9.73 +Lanny Mccrary,27,7.31 +Lee Walburn,19,5.99 +Grace Souphom,20,4.33 +Thomas Mason,19,8.88 +Dudley Peterson,23,8.5 +Jennifer Guerrero,27,5.02 +Christopher Rash,23,7.76 +Tracey Kelty,18,7.89 +Patrick Hickman,22,9.87 +Roland Charleston,26,9.45 +Lucia Sherrill,23,8.46 +Barbara Buck,27,8.09 +Warren Pereira,26,6.42 +Heather Peterson,28,6.67 +Jasper Gonzalez,24,6.24 +Diane Stclair,29,4.53 +Dorothy Gosnell,22,7.31 +Charles Childress,24,9.34 +Linda Simmons,23,6.11 +Todd Netterville,29,5.38 +Rebecca Lamb,25,6.83 +Tiffany Erkkila,23,4.52 +Charles Hooper,20,5.09 +Raymond Brickey,19,5.27 +William Sheehan,22,4.54 +Margaret Miller,26,6.83 +Peggy Rael,27,9.0 +Barbara Roy,22,7.19 +Bernice Adams,29,6.98 +Michael Hamel,23,8.97 +Paul Swasey,23,4.92 +Johanna Chavez,28,4.36 +Gloria Gutierrez,29,6.63 +Harry Rusher,27,7.69 +Carlos Mcreynolds,19,6.85 +Susan Peschel,26,9.74 +Margaret Mcguire,19,7.17 +John Peralta,22,9.95 +Barbara Brown,25,4.94 +Dustin Patrick,23,7.01 +Brian Vargas,28,8.21 +Rick Capizzi,25,8.9 +Lisa Palmieri,29,6.59 +Brenda Sumter,24,7.63 +Laverne Radford,23,4.97 +Heather Lish,21,4.08 +Jeffrey Deane,18,5.5 +Valerie Woode,27,7.79 +Benjamin Brown,25,6.53 +Timothy Armstrong,24,6.16 +Krystal Janssen,24,7.73 +Daniel Bell,30,5.16 +George Basil,19,6.28 +Lilian Rocha,26,8.72 +Stanley Jackson,26,5.33 +Christine Franks,30,7.31 +Janelle Vecker,18,7.08 +Grace Robbins,19,5.24 +Joshua Ream,18,8.18 +Georgia Calaf,20,9.18 +Rhonda Leona,29,9.24 +Charles Schueller,28,5.49 +Leonor Adams,26,6.95 +John Bond,28,9.29 +Deirdre Marthe,24,7.48 +Gene Utley,25,9.94 +Lisa Wilson,20,9.13 +Catherine Kim,22,9.36 +Randolph Martin,24,8.77 +Velma Jobe,30,4.22 +Naomi Mendosa,21,4.03 +William Grove,29,7.01 +Sandra Hackney,29,5.68 +Jennifer Higdon,28,9.61 +Tina Tidwell,29,9.4 +Emily Simpson,30,4.06 +Frank Rasmussen,24,4.51 +Lisa Strause,19,6.06 +Donald Skinner,30,4.61 +Robert Jordan,22,8.48 +Enedina Mcneil,24,5.83 +Nathaniel Boyd,18,5.46 +Clyde Huelskamp,25,4.46 +Lorena Harris,22,6.29 +Walter Ham,25,7.2 +Brian Lee,22,8.08 +Jason Page,28,9.64 +Deborah Watt,22,5.58 +Christopher Zupancic,28,5.5 +Helen Perkins,22,7.12 +Nina Aber,23,7.79 +Dwight Johnson,30,4.06 +Allyson Gay,25,8.9 +David Propes,24,7.61 +Sheldon Johnson,29,4.64 +Elana Bergeron,19,7.27 +Lisa Rowe,19,7.85 +William Filmore,18,4.56 +Angela Stultz,24,7.6 +John Collins,26,5.52 +Thomas Meade,25,4.62 +Ann Lorenz,20,9.85 +Delphia Clarke,30,9.3 +Richard Allen,21,4.44 +Amelia Costain,29,6.9 +Anisha Bridges,18,6.99 +Marcus Denson,20,6.42 +Almeda Stamey,25,5.29 +Cindy Chapman,26,6.77 +Jadwiga Truocchio,25,6.37 +Ricky Bergman,18,5.26 +Jennifer Franz,29,4.82 +Brenda Painter,29,8.07 +Robert Hawkins,26,4.92 +Johnny Alvidrez,30,6.61 +Meredith Spears,22,8.29 +Kevin Walton,22,5.85 +Dave White,20,7.53 +Timothy Wagner,24,4.7 +Billie Hodge,29,7.17 +Angela Sangi,21,5.22 +Paula Moore,23,6.74 +Harold Aguilar,19,5.67 +Rocky Brooks,19,6.56 +Rachel Smith,29,9.5 +Barbara Harry,18,4.24 +Vicki Ricker,25,5.95 +Terry Carlyle,19,7.24 +Leslie Hamlin,30,6.67 +Eugene Bunting,20,7.1 +Bryan Hickerson,25,4.02 +Amanda James,19,8.13 +Steven Ball,21,7.25 +George Surratt,26,6.42 +Adriana Johnson,22,7.11 +Rachel Russell,27,6.51 +Rebecca Cully,18,4.83 +Nancy Landrum,29,7.16 +Elizabeth Howard,25,9.4 +Clifford Perkins,18,5.68 +Jonathan Koester,24,4.9 +Dona Chambers,27,9.43 +Sandra Schmiedeskamp,26,7.83 +Viola Bailey,22,5.75 +Joseph Head,24,9.97 +Wesley Bouyer,30,9.94 +Teresa Jones,19,9.99 +Michael Ginn,24,8.54 +Rebecca Imfeld,21,4.34 +Cynthia Tippins,29,7.96 +Inez Johnson,22,7.49 +Beverly Hertzler,18,4.41 +Helen Gloor,21,9.21 +Gail Monahan,21,7.26 +Marla Dodson,20,5.77 +Adele Deemer,22,4.37 +Jim Smith,20,8.18 +Julian Gutierrez,22,4.23 +Anna Payne,29,6.15 +James Pratka,29,4.13 +Sheila Linn,26,9.64 +Delphine Yousef,18,8.84 +Gwendolyn Alvarez,25,4.35 +Howard Holloway,19,9.64 +Harry Hanson,19,7.58 +Bobby Shelton,22,4.72 +Sara Wood,22,5.16 +Michael Toller,29,5.24 +Lisa Glover,18,7.62 +Robert Figueroa,24,6.02 +Margery Turner,21,6.98 +Ladonna Guinyard,23,8.56 +Anthony Sobus,25,9.43 +Patrick Ruiz,28,5.32 +Victor Santiago,20,6.31 +Harry Wages,30,4.19 +Celeste Pope,24,8.33 +Royce Hale,28,8.83 +Marie Powell,21,6.3 +Eva Buske,26,5.29 +Mary Ortiz,26,7.25 +Edward Williams,21,8.56 +William Moore,27,5.99 +Robert Jackson,30,7.9 +Jocelyn Jensen,20,6.64 +Clayton Williams,26,5.82 +Melinda Bass,19,9.45 +Salvador Kinney,18,5.83 +Patrick Rios,27,5.74 +Janice Smith,23,6.43 +Wilhelmina Collins,26,9.55 +Mary Skeesick,25,6.26 +David Diaz,22,9.11 +Maritza Evans,27,9.8 +Samuel Regan,30,8.45 +Richard Madden,24,8.58 +Bertha Boyd,21,6.67 +Travis Gutierrez,19,5.88 +Lisa Bernier,20,7.74 +Willie Keith,24,7.21 +Micheal Scott,21,5.54 +Norma Dixon,19,5.9 +Angel Rhoades,22,6.66 +May Avent,27,4.22 +Thad Banks,25,4.44 +Marlene Leonard,22,5.2 +Cora Fahey,23,7.37 +Bessie Trivedi,26,8.6 +Harold Delgado,30,6.31 +Brenda Jackson,27,8.89 +Nicole Larkin,22,8.27 +Henry Ferrell,20,6.99 +Holly White,27,7.29 +Ryan Digeorgio,26,5.82 +Floyd Anderson,20,7.22 +Robert Cahill,28,4.58 +Lori Villegas,24,9.77 +Jennifer Maxie,30,6.87 +Cindy Frazier,30,7.0 +Jerome Harper,18,7.09 +Christopher Luna,19,9.31 +David Valdez,20,8.7 +Ted Anderson,28,4.15 +Marie Marn,18,4.53 +James Doyle,18,5.98 +Jerry Pinner,29,5.0 +Eileen Fata,19,8.18 +Gary Simmons,21,8.49 +Willie Haven,29,5.16 +John Meyer,29,8.28 +Leola Murphy,25,8.96 +Nina Baker,23,5.73 +Edwin Zeger,30,7.64 +Mildred Perkins,24,6.81 +Yong Reaid,26,8.31 +Lynn Walker,28,8.42 +Jason Yates,19,7.55 +Cedric Wallace,29,4.08 +Anne Reedy,21,4.15 +Ricky Tetreault,26,6.0 +Gary Littleton,22,6.69 +Brian Deubler,28,6.52 +Adrian Colvin,29,6.69 +Eleanor Schroder,21,7.5 +Jean Gethers,28,6.89 +Matthew Kim,23,8.1 +Jennifer Mclean,19,4.71 +Jesus Weckerly,25,9.68 +Michael Boyd,20,4.94 +Michael Chavarria,28,6.47 +Sydney Anderson,30,7.15 +William Julius,28,6.29 +Richard Meza,19,6.99 +Katherine Roche,28,7.13 +Jacob Figgs,22,6.28 +Thomas Weimer,29,4.32 +Willie Mcgurk,19,5.99 +Minnie Cook,28,7.51 +Loretta Molina,21,8.69 +James Harris,24,4.44 +John Lyons,21,5.78 +Annie Krings,21,7.61 +Carrie Ontiveros,19,4.73 +Marie Clausen,24,4.55 +Robert Hung,23,5.55 +Wesley Shah,23,6.91 +Frank Lopez,30,6.66 +Albert Coral,25,7.12 +Kristine Harvey,22,4.83 +Arlene Bauer,29,8.29 +Connie Figueroa,23,9.86 +Tom Bishop,27,4.48 +James Harrison,19,5.6 +Sheila Stier,30,5.88 +Pearl Mckenna,26,9.45 +Casey Williams,25,7.92 +Yvette Heard,26,4.48 +Paul Paneto,28,4.97 +Christopher Iniguez,18,7.78 +Sheila Hudson,29,5.37 +Marilyn Sexton,21,5.97 +Eric Marchetti,28,5.47 +Veronica Benz,26,7.59 +Mackenzie Horta,24,8.8 +Nellie Cunningham,23,7.64 +Teresa Valiente,28,8.89 +Kate Pospicil,29,8.75 +Lawrence Mccullough,27,5.51 +Robert Hannan,23,7.27 +Paul Miyoshi,18,5.05 +Rebekah Leonardo,18,7.68 +Lillian Sanders,26,4.7 +Russell Tran,21,5.76 +Charles Fletcher,30,6.28 +Sibyl Barthelemy,18,7.47 +Trena Head,23,4.02 +Tracy Hogan,25,4.2 +Christopher Scott,24,5.07 +Peter Langenfeld,19,6.97 +Sara Miller,21,7.37 +Flora Allen,20,9.37 +Sarah Figueiredo,27,8.94 +Ronald Gotay,21,9.74 +Maryanne White,22,8.68 +Bettie Illsley,28,6.84 +Margaret Eychaner,19,5.1 +Frank Stevens,22,5.81 +Anthony Huie,19,5.69 +Jason Wainwright,20,7.13 +Kenneth Robles,18,9.21 +Chad Barnes,27,7.81 +Kelly Holcomb,29,4.03 +Ruby Astin,28,4.1 +Laurie Marshall,20,5.71 +Melanie Kath,20,8.14 +Jessica Dubose,26,9.98 +George Wofford,25,9.36 +Elizabeth Hollyday,23,4.1 +Gloria Gilreath,29,5.5 +Kathleen Pruitt,24,4.43 +James Bohman,20,6.95 +John Ferreira,28,4.88 +Everett Mccollough,28,5.82 +Phyliss Wood,21,4.47 +Jamie Wood,22,5.31 +Ralph Finwall,30,8.17 +Florence Lile,30,6.29 +Geraldine Nelson,22,9.52 +Robin Santiago,27,9.74 +Maureen Daugherty,18,9.49 +Matthew Grogan,28,7.05 +James Ryan,25,9.54 +Brian Christiansen,24,4.82 +Sondra Bui,21,9.7 +Janice Luna,21,7.6 +Roger Felton,20,9.08 +Gregory Harris,28,9.96 +Jewell Pate,22,5.3 +Antionette Blaydes,22,8.9 +Lisa Harrison,23,8.22 +Avery Chestnut,24,4.15 +Alfred Mendez,29,9.9 +Loretta Sullivan,20,7.7 +Matthew Fischer,22,6.28 +Fred Mckane,19,5.32 +Aaron Netolicky,30,9.48 +Mark Phillips,22,6.4 +Curtis Aiello,19,5.2 +Karen Spalding,29,9.24 +Angelita Williamson,18,7.66 +Rita Peterson,22,5.52 +William Childs,18,9.05 +Jackie Hummel,26,5.33 +Lance Cainne,28,6.21 +James Moore,22,7.15 +Bambi Sholders,22,5.03 +Pamela Collins,24,6.44 +John Gray,26,5.99 +Cynthia Greene,30,4.37 +Lori Hennemann,20,6.25 +Thomas Scruggs,23,4.82 +Hattie Dougherty,20,4.15 +Justin Mckenney,28,7.39 +Mark Shippey,28,9.87 +George Berti,19,4.11 +Sheila Miranda,29,9.19 +Gloria Kline,19,5.55 +Ardith Thomas,18,4.24 +Raymond Gagnon,24,6.08 +Pamela Goehner,20,6.97 +Julia Jackson,27,5.56 +Jan Arndt,29,5.03 +James Rivera,29,6.2 +Jennifer Dullea,24,4.31 +Laura Norris,21,9.02 +Amy Marshall,19,9.72 +Todd Wayman,26,6.5 +Louis Parson,29,8.36 +Charles Hawley,24,4.08 +Tammy Munday,25,5.14 +Dawn Oconor,20,9.64 +Ila Tobin,27,5.46 +Gloria Gaffney,22,9.37 +Francis Fletcher,20,4.38 +Tammy Perry,29,9.07 +Robert Carrera,26,5.26 +Sharron Ellis,24,4.94 +Sheila Taylor,26,9.59 +Richard Eaddy,22,7.86 +Billy Chrisman,28,7.46 +Dorothy Daugherty,23,9.13 +Paul Colon,29,7.21 +Justin Mann,30,4.81 +Michelle Torres,29,6.33 +Timothy Mercado,28,6.59 +Christopher Frank,25,8.15 +Johnnie Evans,18,8.86 +Jean Carter,18,7.11 +Matthew Mcdearmont,22,6.88 +Dorothy Yeager,30,4.86 +Ruth Rhodes,24,6.86 +James Powers,25,6.07 +Nell Dyson,29,5.27 +Edward Bailey,27,6.71 +Diana Patton,23,6.92 +Barbara Copeland,19,9.27 +Clarence Cerverizzo,30,4.0 +Daniel Lloyd,20,6.62 +Jeffrey Maxcy,24,4.25 +Brian Heidinger,20,7.28 +Howard Haitz,23,6.78 +Barbara Leroy,27,8.85 +Doris Scantling,26,5.97 +Richard Caruthers,24,5.54 +Mabel Dorch,27,4.56 +Yolanda Conner,27,9.08 +Susan Haley,26,7.99 +Brenda Scott,22,4.09 +George Lawless,24,9.48 +Richard Snider,18,9.99 +Florence Sooter,29,7.92 +Ann Sorensen,19,5.1 +Debbie Feazel,24,7.95 +Blaine Gust,22,5.42 +Gerald Gomez,21,9.62 +Daniel Wilson,25,9.46 +George Lapointe,28,5.96 +Brian Darrow,28,5.92 +Edward Jarvie,27,5.1 +John Paolucci,26,7.67 +Don Dryden,20,5.94 +Tonya Sculley,29,4.54 +William Erling,27,5.14 +Annie Maddox,26,9.59 +James Purcell,19,7.58 +Theresa Morgan,26,9.03 +Sean Dieteman,27,5.96 +Joyce Robison,19,5.89 +Larissa Stalling,23,7.82 +Thomas Ramos,23,6.96 +Kimberly Tarver,29,4.65 +Louie Unrein,30,4.43 +Miguel Bertalan,27,8.19 +Brian Perkins,29,6.69 +Brittney Muller,24,8.6 +Terry Gillikin,19,6.92 +Lela Sanders,25,4.36 +Herman Mcavoy,30,8.17 +Robert Ange,21,6.82 +Stephanie Ramirez,21,6.33 +Noah Minton,25,9.62 +Cynthia Wood,24,6.47 +Sue Mahon,28,6.82 +Lisa Robards,25,5.33 +John Jones,28,8.42 +Roger Williams,26,9.39 +Thomas Black,20,9.29 +Leonore Mcmillian,23,5.66 +Betty Mccoy,19,7.76 +Janice Sousa,21,5.0 +Emma Mottillo,24,8.7 +Kristi Swanson,19,6.24 +Ann Eaton,27,8.44 +Olive Williams,28,6.54 +Paul Rio,27,8.65 +Earl Horan,26,6.6 +Linda Mckoy,25,8.06 +Kevin Brown,23,5.38 +Jack Meza,26,7.07 +Joe Smith,28,7.27 +Don Knox,19,8.12 +Teresa Robotham,26,6.3 +Maryjane Shafer,21,7.26 +Estella Neubauer,24,5.14 +Cassandra Maldonado,25,9.95 +Sherry Bean,26,4.03 +Leonard Jackson,23,8.03 +James Mills,19,5.35 +Kristen Keri,19,6.44 +Jerry Kirk,20,8.95 +Angelo Landrum,28,4.93 +Dora Swarr,22,4.18 +Diane Laird,20,6.12 +Darren Charbonneau,27,4.84 +Barbara Lambert,28,5.43 +Mark Waits,30,5.81 +Ann Mondragon,19,5.76 +Michelle Oneal,23,5.51 +Carl Campbell,25,9.82 +Alice Digangi,27,4.55 +Frances Nez,30,9.64 +Amber Wilson,24,8.96 +Maria Ceraos,27,4.26 +Jennifer Turner,29,4.33 +Larry Smith,29,5.43 +Daniel Dumar,28,9.07 +Mary Macdonald,22,6.04 +Johnnie Yepez,29,6.35 +Stella Hallmark,20,7.76 +Jimmy Dunnaway,27,4.87 +Hilda Bohlke,23,7.34 +Robert Maines,18,8.81 +Richard Shackleford,19,8.86 +Shane Machesky,24,8.83 +Rodolfo Maldonado,18,7.97 +Connie Butler,29,4.52 +Michael Kath,19,9.28 +Josephine Newbury,21,7.71 +Martha Burton,24,8.0 +Evelyn Johnson,24,8.18 +Renee Munn,27,8.84 +Brenna Szymansky,29,7.99 +Luz Roseboro,29,8.46 +Heather Garcia,28,9.98 +Anita Tudor,26,5.05 +Eddie Shiels,30,9.1 +Edwin Broadwell,24,7.35 +Corinne Hamblin,22,8.88 +Connie Berry,24,7.87 +Larry Fields,22,4.37 +Amber Wallin,18,9.29 +Richard Somers,27,4.48 +Steve Williams,27,7.52 +Lee Davis,30,9.91 +Alice Hudson,21,9.25 +Elissa Sinclair,29,7.02 +Anita Mcpherson,21,5.13 +Jackie Johnson,30,9.15 +Howard Smoot,30,7.52 +Robert Gonzalez,28,7.91 +Leticia Wright,21,5.72 +Carl Olson,24,6.19 +Evelyn Daniels,19,4.54 +Robert Hatley,25,4.39 +Kelly Stewart,29,4.5 +Logan Pruitt,18,7.63 +Tammy Wong,30,6.13 +Henry Quinton,24,9.51 +Stanley Monteleone,30,4.76 +Harry Neher,28,9.4 +Jason Rossetti,23,7.23 +Emma Marcus,26,5.36 +Lindsey Cummings,18,6.88 +Miguel Guinn,25,5.41 +James Herring,27,5.65 +Glenda Cisneros,21,7.86 +Gladys Purdom,29,9.43 +Marjorie Rapelyea,25,6.85 +Malcolm Smith,30,6.78 +Erica Broussard,19,8.73 +Emma Mcbride,19,7.36 +Raymond Soileau,18,7.27 +Rikki Gomes,30,7.19 +Thomas Spaur,29,6.4 +Gabrielle Szmidt,29,8.41 +Justin Gonzales,24,7.66 \ No newline at end of file diff --git a/data/unsorted_names.txt b/data/unsorted_names.txt new file mode 100644 index 00000000..4c9ca1f9 --- /dev/null +++ b/data/unsorted_names.txt @@ -0,0 +1,199 @@ +Erminia +Elisa +Ricarda +Royce +Amelia +Mariah +Kendal +Karl +Eustolia +Clay +Erma +Vita +Corrin +Sanjuanita +Shavonda +Donnetta +Adrienne +Ching +Leonie +Wan +Cheyenne +Sharon +Milissa +Marlon +Lena +Adele +Amee +Lolita +Junita +Agueda +Maggie +Herma +Major +Tyler +Ka +Dannette +Carlotta +Donald +Ramiro +Norman +Columbus +Detra +Maximina +Cindi +Elke +Tammie +Claudia +Irving +Jeane +Susanna +Michele +Chet +Kirstie +Blanca +Dorothea +Octavia +Randa +Louis +Penny +Twanna +Darryl +Mignon +Myrl +Lavern +Christa +Brooks +Samella +Roberto +Fredia +Raquel +Darrick +Willodean +Denisse +Idalia +Alda +Lashanda +Shea +Treasa +Rosetta +Charleen +Marisol +Matt +Keisha +Len +Tena +Mervin +Regina +Loan +Starla +Julian +Roberta +Long +Mei +Felton +Merrill +Lisha +Lydia +Toya +Katharyn +Fatimah +Cristal +Mathilda +Merideth +Carson +Marcelina +Floyd +Demetrice +Luz +Cheryll +Saundra +Vernell +Sheila +Quentin +Oliva +Victoria +Sage +Emanuel +Gwyneth +Buck +Patsy +Jeanine +Gaylene +Noelia +Dorene +Petrina +Chrissy +Kelsie +Marla +Antonio +Kiley +Katerine +Rina +Bettina +Charlie +Dino +Meda +Sherry +Gracia +Maisha +Hiroko +Margareta +Caroll +Sharie +Ciera +Lindy +Dierdre +Alejandrina +Jannette +Marco +Hwa +Exie +Jed +Rena +Rebeca +Luisa +Jasmine +Elinore +Tashia +GuillerminaAlaine +Ronda +Kasha +Joelle +Antony +Bari +Nicolas +Johnie +Ninfa +Sebastian +Catalina +Nicky +Justina +Danuta +Morris +Jaimee +Erik +Jenifer +Cecille +Lynne +Sharleen +Valentin +Elayne +Kayce +Karyl +Catherin +Craig +Marline +Ilda +Xavier +Genesis +Corrie +Elmira +Ericka +Carisa +Dwana +Randy +Marquetta +Dagmar +Williams +Oma diff --git a/modules/legb.py b/modules/legb.py new file mode 100644 index 00000000..722f941d --- /dev/null +++ b/modules/legb.py @@ -0,0 +1,10 @@ +a = "I am global variable!" + + +def enclosing_funcion(): + a = "I am variable from enclosed function!" + + def inner_function(): + + a = "I am local variable!" + print(a) diff --git a/modules/mod_a.py b/modules/mod_a.py new file mode 100644 index 00000000..848c3a5c --- /dev/null +++ b/modules/mod_a.py @@ -0,0 +1,8 @@ + +from mod_b import * +from mod_c import * + +print(x) + + + diff --git a/modules/mod_b.py b/modules/mod_b.py new file mode 100644 index 00000000..d981daa7 --- /dev/null +++ b/modules/mod_b.py @@ -0,0 +1,4 @@ +import mod_c + + +mod_c.x = 1000 diff --git a/modules/mod_c.py b/modules/mod_c.py new file mode 100644 index 00000000..e080e1ab --- /dev/null +++ b/modules/mod_c.py @@ -0,0 +1 @@ +x = 6 diff --git a/names.txt b/names.txt new file mode 100644 index 00000000..25f2e741 --- /dev/null +++ b/names.txt @@ -0,0 +1 @@ +Bob, Alex, Naruto, Peter diff --git a/package/__init__.py b/package/__init__.py new file mode 100644 index 00000000..b8732cd7 --- /dev/null +++ b/package/__init__.py @@ -0,0 +1,4 @@ +from .skill_python import python +from .skill_c import c +from .skill_nim import nim +from .skill_linux import linux diff --git a/package/__main__.py b/package/__main__.py new file mode 100644 index 00000000..01ca8883 --- /dev/null +++ b/package/__main__.py @@ -0,0 +1,20 @@ +import sys + +from .skill_python import python +from .skill_c import c +from .skill_nim import nim +from .skill_linux import linux + +print('#--------------') +print(sys.path) +print('#--------------') + +def learn_all(): + python() + c() + nim() + linux() + + +if __name__ == '__main__': + learn_all() diff --git a/package/skill_c.py b/package/skill_c.py new file mode 100644 index 00000000..f25365b7 --- /dev/null +++ b/package/skill_c.py @@ -0,0 +1,2 @@ +def c(): + print('Skill c') diff --git a/package/skill_linux.py b/package/skill_linux.py new file mode 100644 index 00000000..1638cdaf --- /dev/null +++ b/package/skill_linux.py @@ -0,0 +1,2 @@ +def linux(): + print('Skill linux') diff --git a/package/skill_nim.py b/package/skill_nim.py new file mode 100644 index 00000000..4a381418 --- /dev/null +++ b/package/skill_nim.py @@ -0,0 +1,2 @@ +def nim(): + print('Skill nim') diff --git a/package/skill_python.py b/package/skill_python.py new file mode 100644 index 00000000..2baef533 --- /dev/null +++ b/package/skill_python.py @@ -0,0 +1,2 @@ +def python(): + print('Skill python') diff --git a/package2/__init__.py b/package2/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/package2/__main__.py b/package2/__main__.py new file mode 100644 index 00000000..a5143a0a --- /dev/null +++ b/package2/__main__.py @@ -0,0 +1,12 @@ +import sys + +from skill_java import java + + +print('#--------------') +print(sys.path) +print('#--------------') + + +if __name__ == '__main__': + java() diff --git a/package2/skill_java.py b/package2/skill_java.py new file mode 100644 index 00000000..dfc45f99 --- /dev/null +++ b/package2/skill_java.py @@ -0,0 +1,2 @@ +def java(): + print('Skill Java') diff --git a/sh.txt b/sh.txt new file mode 100644 index 00000000..937576fd --- /dev/null +++ b/sh.txt @@ -0,0 +1,41 @@ +A Scandal in Bohemia +Chapter I. +To Sherlock Holmes she is always the woman. I have seldom heard him mention her under any other name. In his eyes she eclipses and predominates the whole of her sex. It was not that he felt any emotion akin to love for Irene Adler. All emotions, and that one particularly, were abhorrent to his cold, precise but admirably balanced mind. He was, I take it, the most perfect reasoning and observing machine that the world has seen, but as a lover he would have placed himself in a false position. He never spoke of the softer passions, save with a gibe and a sneer. They were admirable things for the observer—excellent for drawing the veil from men's motives and actions. But for the trained reasoner to admit such intrusions into his own delicate and finely adjusted temperament was to introduce a distracting factor which might throw a doubt upon all his mental results. Grit in a sensitive instrument, or a crack in one of his own high-power lenses, would not be more disturbing than a strong emotion in a nature such as his. And yet there was but one woman to him, and that woman was the late Irene Adler, of dubious and questionable memory. + +I had seen little of Holmes lately. My marriage had drifted us away from each other. My own complete happiness, and the home-centred interests which rise up around the man who first finds himself master of his own establishment, were sufficient to absorb all my attention, while Holmes, who loathed every form of society with his whole Bohemian soul, remained in our lodgings in Baker Street, buried among his old books, and alternating from week to week between cocaine and ambition, the drowsiness of the drug, and the fierce energy of his own keen nature. He was still, as ever, deeply attracted by the study of crime, and occupied his immense faculties and extraordinary powers of observation in following out those clues, and clearing up those mysteries which had been abandoned as hopeless by the official police. From time to time I heard some vague account of his doings: of his summons to Odessa in the case of the Trepoff murder, of his clearing up of the singular tragedy of the Atkinson brothers at Trincomalee, and finally of the mission which he had accomplished so delicately and successfully for the reigning family of Holland. Beyond these signs of his activity, however, which I merely shared with all the readers of the daily press, I knew little of my former friend and companion. + +One night—it was on the twentieth of March, 1888—I was returning from a journey to a patient (for I had now returned to civil practice), when my way led me through Baker Street. As I passed the well-remembered door, which must always be associated in my mind with my wooing, and with the dark incidents of the Study in Scarlet, I was seized with a keen desire to see Holmes again, and to know how he was employing his extraordinary powers. His rooms were brilliantly lit, and, even as I looked up, I saw his tall, spare figure pass twice in a dark silhouette against the blind. He was pacing the room swiftly, eagerly, with his head sunk upon his chest and his hands clasped behind him. To me, who knew his every mood and habit, his attitude and manner told their own story. He was at work again. He had risen out of his drug-created dreams and was hot upon the scent of some new problem. I rang the bell and was shown up to the chamber which had formerly been in part my own. + +His manner was not effusive. It seldom was; but he was glad, I think, to see me. With hardly a word spoken, but with a kindly eye, he waved me to an armchair, threw across his case of cigars, and indicated a spirit case and a gasogene in the corner. Then he stood before the fire and looked me over in his singular introspective fashion. + +“Wedlock suits you,” he remarked. “I think, Watson, that you have put on seven and a half pounds since I saw you.” + +“Seven!” I answered. + +“Indeed, I should have thought a little more. Just a trifle more, I fancy, Watson. And in practice again, I observe. You did not tell me that you intended to go into harness.” + +“Then, how do you know?” + +“I see it, I deduce it. How do I know that you have been getting yourself very wet lately, and that you have a most clumsy and careless servant girl?” + +“My dear Holmes,” said I, “this is too much. You would certainly have been burned, had you lived a few centuries ago. It is true that I had a country walk on Thursday and came home in a dreadful mess, but as I have changed my clothes I can't imagine how you deduce it. As to Mary Jane, she is incorrigible, and my wife has given her notice, but there, again, I fail to see how you work it out.” + +He chuckled to himself and rubbed his long, nervous hands together. + +“It is simplicity itself,” said he; “my eyes tell me that on the inside of your left shoe, just where the firelight strikes it, the leather is scored by six almost parallel cuts. Obviously they have been caused by someone who has very carelessly scraped round the edges of the sole in order to remove crusted mud from it. Hence, you see, my double deduction that you had been out in vile weather, and that you had a particularly malignant boot-slitting specimen of the London slavey. As to your practice, if a gentleman walks into my rooms smelling of iodoform, with a black mark of nitrate of silver upon his right forefinger, and a bulge on the right side of his top-hat to show where he has secreted his stethoscope, I must be dull, indeed, if I do not pronounce him to be an active member of the medical profession.” + +I could not help laughing at the ease with which he explained his process of deduction. “When I hear you give your reasons,” I remarked, “the thing always appears to me to be so ridiculously simple that I could easily do it myself, though at each successive instance of your reasoning I am baffled until you explain your process. And yet I believe that my eyes are as good as yours.” + +“Quite so,” he answered, lighting a cigarette, and throwing himself down into an armchair. “You see, but you do not observe. The distinction is clear. For example, you have frequently seen the steps which lead up from the hall to this room.” + +“Frequently.” + +“How often?” + +“Well, some hundreds of times.” + +“Then how many are there?” + +“How many? I don't know.” + +“Quite so! You have not observed. And yet you have seen. That is just my point. Now, I know that there are seventeen steps, because I have both seen and observed. By-the-way, since you are interested in these little problems, and since you are good enough to chronicle one or two of my trifling experiences, you may be interested in this.” He threw over a sheet of thick, pink-tinted note-paper which had been lying open upon the table. “It came by the last post,” said he. “Read it aloud.” \ No newline at end of file diff --git a/storage.data b/storage.data new file mode 100644 index 0000000000000000000000000000000000000000..2b23711380703133e8d45d0ef75b150acb688eeb GIT binary patch literal 51 zcmZo*nX1760kKmwdYBWFlBalAyF1kM%->gbVoU9m9+s5M Date: Tue, 24 May 2022 18:57:26 +0500 Subject: [PATCH 02/52] Add final task --- Final_Task.md | 195 ++++++++++++++++++++++++++++++++++++++++++++++++++ RULES.md | 12 ++++ 2 files changed, 207 insertions(+) create mode 100644 Final_Task.md create mode 100644 RULES.md diff --git a/Final_Task.md b/Final_Task.md new file mode 100644 index 00000000..2e2e618a --- /dev/null +++ b/Final_Task.md @@ -0,0 +1,195 @@ +# Introduction to Python. Final task. +You are proposed to implement Python RSS-reader using **python 3.9**. + +The task consists of few iterations. Do not start new iteration if the previous one is not implemented yet. + +## Common requirements. +* It is mandatory to use `argparse` module. +* Codebase must be covered with unit tests with at least 50% coverage. It's a mandatory requirement. +* Yor script should **not** require installation of other services such as mysql server, +postgresql and etc. (except Iteration 6). If it does require such programs, +they should be installed automatically by your script, without user doing anything. +* In case of any mistakes utility should print human-readable. +error explanation. Exception tracebacks in stdout are prohibited in final version of application. +* Docstrings are mandatory for all methods, classes, functions and modules. +* Code must correspond to `pep8` (use `pycodestyle` utility for self-check). + * You can set line length up to 120 symbols. +* Commit messages should provide correct and helpful information about changes in commit. Messages like `Fix bug`, +`Tried to make workable`, `Temp commit` and `Finally works` are prohibited. +* All used third-party packages should be written in the `requirements.txt` file and in installation files (`setup.py`, `setup.cfg`, etc.). +* You have to write a file with documentation. Everything must be documented: how to run scripts, how to run tests, how to install the library and etc. + +## [Iteration 1] One-shot command-line RSS reader. +RSS reader should be a command-line utility which receives [RSS](wikipedia.org/wiki/RSS) URL and prints results in human-readable format. + +You are free to choose format of the news console output. The textbox below provides an example of how it can be implemented: + +```shell +$ rss_reader.py "https://news.yahoo.com/rss/" --limit 1 + +Feed: Yahoo News - Latest News & Headlines + +Title: Nestor heads into Georgia after tornados damage Florida +Date: Sun, 20 Oct 2019 04:21:44 +0300 +Link: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html + +[image 2: Nestor heads into Georgia after tornados damage Florida][2]Nestor raced across Georgia as a post-tropical cyclone late Saturday, hours after the former tropical storm spawned a tornado that damaged +homes and a school in central Florida while sparing areas of the Florida Panhandle devastated one year earlier by Hurricane Michael. The storm made landfall Saturday on St. Vincent Island, a nature preserve +off Florida's northern Gulf Coast in a lightly populated area of the state, the National Hurricane Center said. Nestor was expected to bring 1 to 3 inches of rain to drought-stricken inland areas on its +march across a swath of the U.S. Southeast. + + +Links: +[1]: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html (link) +[2]: http://l2.yimg.com/uu/api/res/1.2/Liyq2kH4HqlYHaS5BmZWpw--/YXBwaWQ9eXRhY2h5b247aD04Njt3PTEzMDs-/https://media.zenfs.com/en/ap.org/5ecc06358726cabef94585f99050f4f0 (image) + +``` + +Utility should provide the following interface: +```shell +usage: rss_reader.py [-h] [--version] [--json] [--verbose] [--limit LIMIT] + source + +Pure Python command-line RSS reader. + +positional arguments: + source RSS URL + +optional arguments: + -h, --help show this help message and exit + --version Print version info + --json Print result as JSON in stdout + --verbose Outputs verbose status messages + --limit LIMIT Limit news topics if this parameter provided + +``` + +In case of using `--json` argument your utility should convert the news into [JSON](https://en.wikipedia.org/wiki/JSON) format. +You should come up with the JSON structure on you own and describe it in the README.md file for your repository or in a separate documentation file. + + + +With the argument `--verbose` your program should print all logs in stdout. + +### Task clarification (I) + +1) If `--version` option is specified app should _just print its version_ and stop. +2) User should be able to use `--version` option without specifying RSS URL. For example: +``` +> python rss_reader.py --version +"Version 1.4" +``` +3) The version is supposed to change with every iteration. +4) If `--limit` is not specified, then user should get _all_ available feed. +5) If `--limit` is larger than feed size then user should get _all_ available news. +6) `--verbose` should print logs _in the process_ of application running, _not after everything is done_. +7) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout_. +8) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout in JSON format_. +9) It is preferrable to have different custom exceptions for different situations(If needed). +10) The `--limit` argument should also affect JSON generation. + + +## [Iteration 2] Distribution. + +* Utility should be wrapped into distribution package with `setuptools`. +* This package should export CLI utility named `rss-reader`. + + +### Task clarification (II) + +1) User should be able to run your application _both_ with and without installation of CLI utility, +meaning that this should work: + +``` +> python rss_reader.py ... +``` + +as well as this: + +``` +> rss_reader ... +``` +2) Make sure your second iteration works on a clean machie with python 3.9. (!) +3) Keep in mind that installed CLI utility should have the same functionality, so do not forget to update dependencies and packages. + + +## [Iteration 3] News caching. +The RSS news should be stored in a local storage while reading. The way and format of this storage you can choose yourself. +Please describe it in a separate section of README.md or in the documentation. + +New optional argument `--date` must be added to your utility. It should take a date in `%Y%m%d` format. +For example: `--date 20191020` +Here date means actual *publishing date* not the date when you fetched the news. + +The cashed news can be read with it. The new from the specified day will be printed out. +If the news are not found return an error. + +If the `--date` argument is not provided, the utility should work like in the previous iterations. + +### Task clarification (III) +1) Try to make your application crossplatform, meaning that it should work on both Linux and Windows. +For example when working with filesystem, try to use `os.path` lib instead of manually concatenating file paths. +2) `--date` should **not** require internet connection to fetch news from local cache. +3) User should be able to use `--date` without specifying RSS source. For example: +``` +> python rss_reader.py --date 20191206 +...... +``` +Or for second iteration (when installed using setuptools): +``` +> rss_reader --date 20191206 +...... +``` +4) If `--date` specified _together with RSS source_, then app should get news _for this date_ from local cache that _were fetched from specified source_. +5) `--date` should work correctly with both `--json`, `--limit`, `--verbose` and their different combinations. + +## [Iteration 4] Format converter. + +You should implement the conversion of news in at least two of the suggested format: `.mobi`, `.epub`, `.fb2`, `.html`, `.pdf` + +New optional argument must be added to your utility. This argument receives the path where new file will be saved. The arguments should represents which format will be generated. + +For example: `--to-mobi` or `--to-fb2` or `--to-epub` + +You can choose yourself the way in which the news will be displayed, but the final text result should contain pictures and links, if they exist in the original article and if the format permits to store this type of data. + +### Task clarification (IV) + +Convertation options should work correctly together with all arguments that were implemented in Iterations 1-3. For example: +* Format convertation process should be influenced by `--limit`. +* If `--json` is specified together with convertation options, then JSON news should +be printed to stdout, and converted file should contain news in normal format. +* Logs from `--verbose` should be printed in stdout and not added to the resulting file. +* `--date` should also work correctly with format converter and to not require internet access. + +## * [Iteration 5] Output colorization. +> Note: An optional iteration, it is not necessary to implement it. You can move on with it only if all the previous iterations (from 1 to 4) are completely implemented. + +You should add new optional argument `--colorize`, that will print the result of the utility in colorized mode. + +*If the argument is not provided, the utility should work like in the previous iterations.* + +> Note: Take a look at the [colorize](https://pypi.org/project/colorize/) library + +## * [Iteration 6] Web-server. +> Note: An optional iteration, it is not necessary to implement it. You can move on with it only if all the previous iterations (from 1 to 4) are completely implemented. Introduction to Python course does not cover the topics that are needed for the implementation of this part. + +There are several mandatory requirements in this iteration: +* `Docker` + `docker-compose` usage (at least 2 containers: one for web-application, one for DB) +* Web application should provide all the implemented in the previous parts of the task functionality, using the REST API: + * One-shot conversion from RSS to Human readable format + * Server-side news caching + * Conversion in epub, mobi, fb2 or other formats + +Feel free to choose the way of implementation, libraries and frameworks. (We suggest you `Django Rest Framework` + `PostgreSQL` combination) + +You can implement any functionality that you want. The only requirement is to add the description into README file or update project documentation, for example: +* authorization/authentication +* automatic scheduled news update +* adding new RSS sources using API + +--- +Implementations will be checked with the latest cPython interpreter of 3.9 branch. +--- + +> Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Code for readability. **John F. Woods** diff --git a/RULES.md b/RULES.md new file mode 100644 index 00000000..9a72034f --- /dev/null +++ b/RULES.md @@ -0,0 +1,12 @@ +# Final task +Final task (`FT`) for EPAM Python Training 2022.03 + +## Rules +* All work has to be implemented in the `master` branch in forked repository. If you think that `FT` is ready, please open a pull request (`PR`) to our repo. +* When a `PR` will be ready, please mark it with the `final_task` label. +* You have one month to finish `FT`. Commits commited after deadline will be ignored. +* At least the first 4 iterations must be done. +* `FT` you can find in the `Final_Task.md` file. + +### Good luck! + From 494bf419ebf33b84b29dc4d0f6f361263f48f5f9 Mon Sep 17 00:00:00 2001 From: fcumay Date: Sun, 26 Jun 2022 23:24:12 +0300 Subject: [PATCH 03/52] added empty file .py --- final_task.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 final_task.py diff --git a/final_task.py b/final_task.py new file mode 100644 index 00000000..e69de29b From 647255c601b81b61d00df16041c14e440768243a Mon Sep 17 00:00:00 2001 From: fcumay Date: Sun, 26 Jun 2022 23:35:08 +0300 Subject: [PATCH 04/52] ss --- final_task.py | 1 + 1 file changed, 1 insertion(+) diff --git a/final_task.py b/final_task.py index e69de29b..157a46f6 100644 --- a/final_task.py +++ b/final_task.py @@ -0,0 +1 @@ + z \ No newline at end of file From 17ff39eaaaf2e801fe3b4a82a6bc2b58b3e14532 Mon Sep 17 00:00:00 2001 From: fcumay Date: Sun, 26 Jun 2022 23:37:45 +0300 Subject: [PATCH 05/52] added empty file --- final_task.py | 1 - 1 file changed, 1 deletion(-) diff --git a/final_task.py b/final_task.py index 157a46f6..e69de29b 100644 --- a/final_task.py +++ b/final_task.py @@ -1 +0,0 @@ - z \ No newline at end of file From 859b0293f5834c6777841389146ccaf842e0f6cb Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 15:58:33 +0300 Subject: [PATCH 06/52] add: class Reader --- reader.py | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 reader.py diff --git a/reader.py b/reader.py new file mode 100644 index 00000000..5e218a5d --- /dev/null +++ b/reader.py @@ -0,0 +1,70 @@ +from loguru import logger +import requests +from bs4 import BeautifulSoup +import re +import sys + + +class Reader: + """Parse data from URL""" + + def __init__(self, source: str, limit=-1) -> None: + self.version = '4.0' + self.source = source + self.name = self.get_acces()[0] + self.items = self.get_acces()[1] + logger.info("Acces is available (info)!") + self.limit = len(self.items) if limit == -1 or limit > len(self.items) else limit + self.title = self.get_title() + logger.info("Title is available (info)!") + self.pubDate = self.get_pubDate() + logger.info("PubDate is available (info)!") + self.link = self.get_link() + logger.info("Link is available (info)!") + self.clear_description = list() + self.description = self.get_description() + logger.info("Description is available (info)!") + + def get_acces(self) -> list: + logger.debug("Get access (debug)!") + try: + url = requests.get(self.source) + except Exception: + logger.info(f"Invalid url.{self.source}(info)!") + print('Could not fetch the URL. Input valid URL.') + sys.exit() + try: + soup = BeautifulSoup(url.content, 'xml') + name = soup.find().title.text + items = soup.find_all('item') + if len(items) == 0: + raise Exception + except Exception as e: + logger.info(f"Invalid url.{self.source}(info)!") + print('Could not read feed. Input xml-format URL.') + sys.exit() + return name, items + + def get_title(self) -> list: + logger.debug("Get title from xml (debug)!") + return [self.items[i].title.text for i in range(self.limit)] + + def get_pubDate(self) -> list: + logger.debug("Get pubDate from xml (debug)!") + return [self.items[i].pubDate.text for i in range(self.limit)] + + def get_link(self) -> list: + logger.debug("Get link from xml (debug)!") + return [self.items[i].link.text for i in range(self.limit)] + + def get_description(self) -> list: + logger.debug("Get description from xml (debug)!") + des = [] + for i in range(self.limit): + if self.items[i].description: + des.append(self.items[i].description.text) + self.clear_description.append(re.sub(r'\<[^>]*\>|(&rsaquo)', '', self.items[i].description.text)) + else: + des.append('No description here') + self.clear_description.append('No description here') + return des From 9cf149eeb0c66ba6b0c525b489dab24878eaa426 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 15:59:57 +0300 Subject: [PATCH 07/52] add: class Printer --- printer.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 printer.py diff --git a/printer.py b/printer.py new file mode 100644 index 00000000..7a38ec58 --- /dev/null +++ b/printer.py @@ -0,0 +1,16 @@ +from loguru import logger + + +class Printer: + """Print result in stdout""" + + def __init__(self, data: dict) -> None: + logger.debug("Data is available (debug)!") + self.data = data + + def __str__(self) -> str: + return self.data["name"] + '\n' + ''.join([(f'{self.data["title"][i]}\n' + f'{self.data["pubDate"][i]}\n\n' + f'{self.data["description"][i]}\n\n' + f'{self.data["link"][i]}\n\n---------------\n\n') for i in + range(self.data["size"])]) From 1534dfd0cddfed839b75a2cb573a56c272b9d4e4 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:05:12 +0300 Subject: [PATCH 08/52] add: class Converter --- converter.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 converter.py diff --git a/converter.py b/converter.py new file mode 100644 index 00000000..8db216a1 --- /dev/null +++ b/converter.py @@ -0,0 +1,46 @@ +from loguru import logger +import json +from json2html import * + +class Converter: + """ + Convert from: object to dict + json to dict + dict to json + json to HTML + + """ + def __init__(self, my_reader=None)->None: + self.my_reader = my_reader + + def to_dict(self)->dict: + logger.debug("Convert data to dictionary (debug)!") + dict = {"name": self.my_reader.name, + "size": self.my_reader.limit, + "title": self.my_reader.title, + "pubDate": self.my_reader.pubDate, + "description": self.my_reader.clear_description, + "link": self.my_reader.link} + return dict + + def from_json(self)->dict: + logger.debug("Read data from json(debug)!") + with open('data.json') as json_file: + data = json.load(json_file) + return data + + def to_JSON(self, dict=False)->None: + if not dict: + dict = self.to_dict() + logger.debug("Convert data to json (debug)!") + with open('data.json', 'w+') as outfile: + json.dump(dict, outfile, indent=4) + + def to_HTML(self): + with open("data.json") as f: + d = json.load(f) + scanOutput = json2html.convert(json=d) + htmlReportFile = "output.html" + with open(htmlReportFile, 'w') as htmlfile: + htmlfile.write(str(scanOutput)) + print("Data save in output.html") \ No newline at end of file From e6215fad7ef25b9d488ef16b029194b28baa2dca Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:07:20 +0300 Subject: [PATCH 09/52] fix: utf-8 --- converter.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/converter.py b/converter.py index 8db216a1..080c549b 100644 --- a/converter.py +++ b/converter.py @@ -2,6 +2,7 @@ import json from json2html import * + class Converter: """ Convert from: object to dict @@ -10,10 +11,11 @@ class Converter: json to HTML """ - def __init__(self, my_reader=None)->None: + + def __init__(self, my_reader=None) -> None: self.my_reader = my_reader - def to_dict(self)->dict: + def to_dict(self) -> dict: logger.debug("Convert data to dictionary (debug)!") dict = {"name": self.my_reader.name, "size": self.my_reader.limit, @@ -23,13 +25,13 @@ def to_dict(self)->dict: "link": self.my_reader.link} return dict - def from_json(self)->dict: + def from_json(self) -> dict: logger.debug("Read data from json(debug)!") with open('data.json') as json_file: data = json.load(json_file) return data - def to_JSON(self, dict=False)->None: + def to_JSON(self, dict=False) -> None: if not dict: dict = self.to_dict() logger.debug("Convert data to json (debug)!") @@ -43,4 +45,4 @@ def to_HTML(self): htmlReportFile = "output.html" with open(htmlReportFile, 'w') as htmlfile: htmlfile.write(str(scanOutput)) - print("Data save in output.html") \ No newline at end of file + print("Data save in output.html") From edd5abe24e513828efd3e48581467bc9e27f520a Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:22:36 +0300 Subject: [PATCH 10/52] feat: move exception --- rss_reader.py | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 rss_reader.py diff --git a/rss_reader.py b/rss_reader.py new file mode 100644 index 00000000..8b2dd13f --- /dev/null +++ b/rss_reader.py @@ -0,0 +1,130 @@ +import argparse +import sys +from loguru import logger + +from reader import Reader +from printer import Printer +from converter import Converter + +VERSION = '4.0' + +logger.add("debug.log", format="{time} {level} {message}", level="DEBUG") + + +def args() -> argparse.Namespace: + parser = argparse.ArgumentParser(description="Choose type of the interface") + parser.add_argument("-v", "--version", action="store_true", help="Print version info") + parser.add_argument("--json", action="store_true", help="Print result as JSON") + parser.add_argument("--verbose", action="store_true", help="Outputs verbose status messages.Print logs.") + parser.add_argument("--limit", type=int, + help="Limit news topics. If it's not specified, then you get all available feed") + parser.add_argument("--date", type=str, + help="It should take a date in Ymd format.The new from the specified day will be printed out.") + parser.add_argument("--html", action="store_true", help="It convert data to HTML-format in file output.html.") + parser.add_argument("source", nargs="?", type=str, help="RSS URL") + args = parser.parse_args() + return args + + +def date_search(data: dict, date: str) -> dict: + if len(date) < 7 or not (date.isdigit()): + logger.info(f"Invalid date.{date}!") + print(f"Invalid date.{date}. Use pattern YMD!") + raise sys.exit() + + logger.debug("Start data searching (debug)!") + new_dates = [] + month = {"Jan": "01", "Feb": "02", "Mar": "03", "Apr": "04", "May": "05", "Jun": "06", "Jul": "07", "Aug": "08", + "Sep": "09", "Oct": "10", "Nov": "11", "Dec": "12"} + for d in data["pubDate"]: + for key in month.keys(): + if key in d: + new_dates.append(d.replace(key, month[key])) + new_date = date[6::] + ' ' + date[4:6:] + ' ' + date[:4:] + list_of_index = [] + + for i in range(len(new_dates)): + if new_date in new_dates[i]: + list_of_index.append(i) + if len(list_of_index) == 0: + logger.info(f"No information found.{date}!") + print(f"No information found.{date}.") + raise sys.exit() + new_data = {"name": data["name"], + "size": len(list_of_index), + "title": [data["title"][i] for i in list_of_index], + "pubDate": [data["pubDate"][i] for i in list_of_index], + "description": [data["description"][i] for i in list_of_index], + "link": [data["link"][i] for i in list_of_index] + } + return new_data + + +def main(): + if not args().verbose: + logger.remove() + if args().version: + logger.debug("Version call (debug)!") + print('Version:' + VERSION) + logger.info("Print version (info)!") + sys.exit() + elif args().date and args().source == None: + converter = Converter() + logger.debug("Convert to json call (debug)!") + converter.to_JSON(date_search(converter.from_json(), args().date)) + logger.info("Succesful data search (info)!") + logger.info("Save to json file (info)!") + printer = Printer(converter.from_json()) + print(printer) + else: + logger.debug("Reader call (debug)!") + my_reader = Reader(args().source, args().limit) if args().limit else Reader(args().source) + converter = Converter(my_reader) + logger.debug("Convert to json call (debug)!") + converter.to_JSON() + logger.info("Save to json file (info)!") + if args().date: + date_search(converter.from_json(), args().date) + converter.to_JSON(date_search(converter.from_json(), args().date)) + logger.info("Succesful data search (info)!") + else: + converter.to_JSON() + logger.info("Save to json file (info)!") + logger.debug("Printer call (debug)!") + printer = Printer(converter.from_json()) + print(printer) + logger.info("Print information (info)!") + + if args().json: + logger.debug("Json-style call (debug)!") + print("Json style:\n") + print(converter.from_json()) + logger.info("Print json-style information (info)!") + + if args().html: + try: + converter.to_HTML() + except Exception: + logger.error(f"Error with HTML-file(error)!") + print('Error: convert to HTML-file does not work with this URL ') + + +if __name__ == '__main__': + try: + main() + except Exception: + logger.error(f"Unexpected error (error)!") + print(f"Unexpected error") + raise sys.exit() + +# python f.py "https://www.onliner.by/feed" --limit 1 + +# python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 2 --json --verbose + +# python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 3 +# python rss_reader.py "https://feeds.fireside.fm/bibleinayear/rss" --limit 3 + +# python rss_reader.py "https://feeds.simplecast.com/qm_9xx0g" --limit 1 + + + +# python rss_reader.py "https://realpython.com/atom.xml" --limit 3 +# python rss_reader.py --date 20220620 +# python rss_reader.py --json \ No newline at end of file From fcc9dc94662167eb4b68cf31530a1fcd9cd08e7d Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:23:27 +0300 Subject: [PATCH 11/52] add: files for store data --- data.json | 16 ++++++++++++++++ output.html | 1 + 2 files changed, 17 insertions(+) create mode 100644 data.json create mode 100644 output.html diff --git a/data.json b/data.json new file mode 100644 index 00000000..4060f166 --- /dev/null +++ b/data.json @@ -0,0 +1,16 @@ +{ + "name": "BuzzFeed - Quizzes", + "size": 1, + "title": [ + "Pick Lots Of Dogs And I Bet You That I Won't Get Your Eye Color Right" + ], + "pubDate": [ + "Sun, 26 Jun 2022 00:40:18 -0400" + ], + "description": [ + "I WANT to get it wrong...View Entire Post ;" + ], + "link": [ + "https://www.buzzfeed.com/turtleo/dog-eye-color-guessing-quiz" + ] +} \ No newline at end of file diff --git a/output.html b/output.html new file mode 100644 index 00000000..576aff25 --- /dev/null +++ b/output.html @@ -0,0 +1 @@ +
nameBuzzFeed - Quizzes
size1
title
  • Pick Lots Of Dogs And I Bet You That I Won't Get Your Eye Color Right
pubDate
  • Sun, 26 Jun 2022 00:40:18 -0400
description
  • I WANT to get it wrong...View Entire Post ;
link
  • https://www.buzzfeed.com/turtleo/dog-eye-color-guessing-quiz
\ No newline at end of file From d4fef95751228255d8a873f5e91e25ac4f012bc7 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:32:23 +0300 Subject: [PATCH 12/52] add: debug.log --- debug.log | 256 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 debug.log diff --git a/debug.log b/debug.log new file mode 100644 index 00000000..6ac67165 --- /dev/null +++ b/debug.log @@ -0,0 +1,256 @@ +2022-06-30T03:02:18.187727+0300 DEBUG Convert to json call (debug)! +2022-06-30T03:02:18.191716+0300 DEBUG Read data from json(debug)! +2022-06-30T03:02:18.199064+0300 INFO Invalid date.12! +2022-06-30T03:11:13.840117+0300 DEBUG Convert to json call (debug)! +2022-06-30T03:11:13.842375+0300 DEBUG Read data from json(debug)! +2022-06-30T03:11:13.844956+0300 DEBUG Start data searching (debug)! +2022-06-30T03:11:13.845957+0300 DEBUG Convert data to json (debug)! +2022-06-30T03:11:13.848139+0300 INFO Succesful data search (info)! +2022-06-30T03:11:13.849176+0300 INFO Save to json file (info)! +2022-06-30T03:22:37.532486+0300 DEBUG Reader call (debug)! +2022-06-30T03:22:37.540589+0300 DEBUG Get access (debug)! +2022-06-30T03:22:38.514206+0300 DEBUG Get access (debug)! +2022-06-30T03:22:38.844512+0300 INFO Acces is available (info)! +2022-06-30T03:22:38.850225+0300 DEBUG Get title from xml (debug)! +2022-06-30T03:22:38.855341+0300 INFO Title is available (info)! +2022-06-30T03:22:38.867370+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T03:22:38.872953+0300 INFO PubDate is available (info)! +2022-06-30T03:22:38.880131+0300 DEBUG Get link from xml (debug)! +2022-06-30T03:22:38.886188+0300 INFO Link is available (info)! +2022-06-30T03:22:38.894052+0300 DEBUG Get description from xml (debug)! +2022-06-30T03:22:38.900805+0300 INFO Description is available (info)! +2022-06-30T03:22:38.906346+0300 DEBUG Convert to json call (debug)! +2022-06-30T03:22:38.919651+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T03:22:38.932401+0300 DEBUG Convert data to json (debug)! +2022-06-30T03:22:38.940350+0300 INFO Save to json file (info)! +2022-06-30T03:22:38.951201+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T03:22:38.958168+0300 DEBUG Convert data to json (debug)! +2022-06-30T03:22:38.967175+0300 INFO Save to json file (info)! +2022-06-30T03:22:38.972942+0300 DEBUG Printer call (debug)! +2022-06-30T03:22:38.980110+0300 DEBUG Read data from json(debug)! +2022-06-30T03:22:38.986679+0300 DEBUG Data is available (debug)! +2022-06-30T03:22:38.993616+0300 INFO Print information (info)! +2022-06-30T03:22:39.002501+0300 DEBUG Json-style call (debug)! +2022-06-30T03:22:39.016814+0300 DEBUG Read data from json(debug)! +2022-06-30T03:22:39.024253+0300 INFO Print json-style information (info)! +2022-06-30T03:23:17.045754+0300 DEBUG Version call (debug)! +2022-06-30T03:23:17.051827+0300 INFO Print version (info)! +2022-06-30T03:23:17.057973+0300 DEBUG Json-style call (debug)! +2022-06-30T03:23:17.067590+0300 ERROR Unexpected error (error)! +2022-06-30T03:23:52.100284+0300 DEBUG Version call (debug)! +2022-06-30T03:23:52.103679+0300 INFO Print version (info)! +2022-06-30T14:11:41.309447+0300 DEBUG Reader call (debug)! +2022-06-30T14:11:41.314282+0300 DEBUG Get access (debug)! +2022-06-30T14:11:42.239843+0300 DEBUG Get access (debug)! +2022-06-30T14:11:42.503458+0300 INFO Acces is available (info)! +2022-06-30T14:11:42.505613+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:11:42.507447+0300 INFO Title is available (info)! +2022-06-30T14:11:42.508444+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:11:42.510439+0300 INFO PubDate is available (info)! +2022-06-30T14:11:42.511435+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:11:42.513430+0300 INFO Link is available (info)! +2022-06-30T14:11:42.515555+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:11:42.517421+0300 INFO Description is available (info)! +2022-06-30T14:11:42.519415+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:11:42.520412+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:11:42.522407+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:11:42.526397+0300 INFO Save to json file (info)! +2022-06-30T14:11:42.529388+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:11:42.531383+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:11:42.582247+0300 INFO Save to json file (info)! +2022-06-30T14:11:42.586747+0300 DEBUG Printer call (debug)! +2022-06-30T14:11:42.588748+0300 DEBUG Read data from json(debug)! +2022-06-30T14:11:42.590743+0300 DEBUG Data is available (debug)! +2022-06-30T14:11:42.592737+0300 INFO Print information (info)! +2022-06-30T14:11:42.602713+0300 DEBUG Json-style call (debug)! +2022-06-30T14:11:42.610691+0300 DEBUG Read data from json(debug)! +2022-06-30T14:11:42.613745+0300 INFO Print json-style information (info)! +2022-06-30T14:11:42.616674+0300 ERROR Unexpected error (error)! +2022-06-30T14:14:16.206220+0300 DEBUG Reader call (debug)! +2022-06-30T14:14:16.209181+0300 DEBUG Get access (debug)! +2022-06-30T14:14:17.054766+0300 DEBUG Get access (debug)! +2022-06-30T14:14:17.244215+0300 INFO Acces is available (info)! +2022-06-30T14:14:17.247684+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:14:17.248681+0300 INFO Title is available (info)! +2022-06-30T14:14:17.249951+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:14:17.251672+0300 INFO PubDate is available (info)! +2022-06-30T14:14:17.252741+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:14:17.254667+0300 INFO Link is available (info)! +2022-06-30T14:14:17.255662+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:14:17.256660+0300 INFO Description is available (info)! +2022-06-30T14:14:17.257658+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:14:17.259830+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:14:17.260650+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:14:17.262645+0300 INFO Save to json file (info)! +2022-06-30T14:14:17.264639+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:14:17.265637+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:14:17.267632+0300 INFO Save to json file (info)! +2022-06-30T14:14:17.271620+0300 DEBUG Printer call (debug)! +2022-06-30T14:14:17.274614+0300 DEBUG Read data from json(debug)! +2022-06-30T14:14:17.279602+0300 DEBUG Data is available (debug)! +2022-06-30T14:14:17.283590+0300 INFO Print information (info)! +2022-06-30T14:14:17.288577+0300 DEBUG Json-style call (debug)! +2022-06-30T14:14:17.290571+0300 DEBUG Read data from json(debug)! +2022-06-30T14:14:17.292765+0300 INFO Print json-style information (info)! +2022-06-30T14:14:17.294746+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:14:17.296209+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:14:17.298952+0300 ERROR Unexpected error (error)! +2022-06-30T14:14:35.037139+0300 DEBUG Reader call (debug)! +2022-06-30T14:14:35.043143+0300 DEBUG Get access (debug)! +2022-06-30T14:14:35.233215+0300 DEBUG Get access (debug)! +2022-06-30T14:14:35.437977+0300 INFO Acces is available (info)! +2022-06-30T14:14:35.439971+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:14:35.441966+0300 INFO Title is available (info)! +2022-06-30T14:14:35.444770+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:14:35.446481+0300 INFO PubDate is available (info)! +2022-06-30T14:14:35.448476+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:14:35.449474+0300 INFO Link is available (info)! +2022-06-30T14:14:35.451717+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:14:35.453464+0300 INFO Description is available (info)! +2022-06-30T14:14:35.455457+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:14:35.460445+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:14:35.461441+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:14:35.464555+0300 INFO Save to json file (info)! +2022-06-30T14:14:35.466430+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:14:35.468425+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:14:35.471416+0300 INFO Save to json file (info)! +2022-06-30T14:14:35.472415+0300 DEBUG Printer call (debug)! +2022-06-30T14:14:35.478396+0300 DEBUG Read data from json(debug)! +2022-06-30T14:14:35.485633+0300 DEBUG Data is available (debug)! +2022-06-30T14:14:35.487534+0300 INFO Print information (info)! +2022-06-30T14:14:35.494355+0300 DEBUG Json-style call (debug)! +2022-06-30T14:14:35.496648+0300 DEBUG Read data from json(debug)! +2022-06-30T14:14:35.498344+0300 INFO Print json-style information (info)! +2022-06-30T14:26:40.306919+0300 DEBUG Reader call (debug)! +2022-06-30T14:26:40.312903+0300 DEBUG Get access (debug)! +2022-06-30T14:26:40.598959+0300 DEBUG Get access (debug)! +2022-06-30T14:26:40.771652+0300 INFO Acces is available (info)! +2022-06-30T14:26:40.773647+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:26:40.774647+0300 INFO Title is available (info)! +2022-06-30T14:26:40.775644+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:26:40.777638+0300 INFO PubDate is available (info)! +2022-06-30T14:26:40.778637+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:26:40.779632+0300 INFO Link is available (info)! +2022-06-30T14:26:40.781979+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:26:40.783622+0300 INFO Description is available (info)! +2022-06-30T14:26:40.785616+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:26:40.786614+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:26:40.787613+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:26:40.789607+0300 INFO Save to json file (info)! +2022-06-30T14:26:40.791603+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:26:40.792596+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:26:40.794665+0300 INFO Save to json file (info)! +2022-06-30T14:26:40.795691+0300 DEBUG Printer call (debug)! +2022-06-30T14:26:40.796587+0300 DEBUG Read data from json(debug)! +2022-06-30T14:26:40.798583+0300 DEBUG Data is available (debug)! +2022-06-30T14:26:40.800577+0300 INFO Print information (info)! +2022-06-30T14:26:40.802663+0300 DEBUG Json-style call (debug)! +2022-06-30T14:26:40.803597+0300 DEBUG Read data from json(debug)! +2022-06-30T14:26:40.805591+0300 INFO Print json-style information (info)! +2022-06-30T14:26:46.083582+0300 DEBUG Reader call (debug)! +2022-06-30T14:26:46.090564+0300 DEBUG Get access (debug)! +2022-06-30T14:26:46.289349+0300 DEBUG Get access (debug)! +2022-06-30T14:26:46.509778+0300 INFO Acces is available (info)! +2022-06-30T14:26:46.511772+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:26:46.512770+0300 INFO Title is available (info)! +2022-06-30T14:26:46.513767+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:26:46.515762+0300 INFO PubDate is available (info)! +2022-06-30T14:26:46.516759+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:26:46.518754+0300 INFO Link is available (info)! +2022-06-30T14:26:46.519752+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:26:46.522744+0300 INFO Description is available (info)! +2022-06-30T14:26:46.524809+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:26:46.526733+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:26:46.527730+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:26:46.529725+0300 INFO Save to json file (info)! +2022-06-30T14:26:46.531719+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:26:46.533714+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:26:46.535709+0300 INFO Save to json file (info)! +2022-06-30T14:26:46.538000+0300 DEBUG Printer call (debug)! +2022-06-30T14:26:46.540695+0300 DEBUG Read data from json(debug)! +2022-06-30T14:26:46.545682+0300 DEBUG Data is available (debug)! +2022-06-30T14:26:46.548021+0300 INFO Print information (info)! +2022-06-30T14:26:46.550668+0300 DEBUG Json-style call (debug)! +2022-06-30T14:26:46.555657+0300 DEBUG Read data from json(debug)! +2022-06-30T14:26:46.563271+0300 INFO Print json-style information (info)! +2022-06-30T14:26:46.566626+0300 ERROR Error with PDF-file(error)! +2022-06-30T14:29:22.976074+0300 DEBUG Reader call (debug)! +2022-06-30T14:29:22.980788+0300 DEBUG Get access (debug)! +2022-06-30T14:29:23.209324+0300 DEBUG Get access (debug)! +2022-06-30T14:29:23.393193+0300 INFO Acces is available (info)! +2022-06-30T14:29:23.395184+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:29:23.397326+0300 INFO Title is available (info)! +2022-06-30T14:29:23.398176+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:29:23.400171+0300 INFO PubDate is available (info)! +2022-06-30T14:29:23.401168+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:29:23.409820+0300 INFO Link is available (info)! +2022-06-30T14:29:23.410824+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:29:23.412819+0300 INFO Description is available (info)! +2022-06-30T14:29:23.413815+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:29:23.414906+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:29:23.415809+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:29:23.417805+0300 INFO Save to json file (info)! +2022-06-30T14:29:23.419798+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:29:23.420798+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:29:23.423132+0300 INFO Save to json file (info)! +2022-06-30T14:29:23.423790+0300 DEBUG Printer call (debug)! +2022-06-30T14:29:23.424785+0300 DEBUG Read data from json(debug)! +2022-06-30T14:29:23.426781+0300 DEBUG Data is available (debug)! +2022-06-30T14:29:23.428776+0300 INFO Print information (info)! +2022-06-30T14:29:23.430771+0300 DEBUG Json-style call (debug)! +2022-06-30T14:29:23.431768+0300 DEBUG Read data from json(debug)! +2022-06-30T14:29:23.433764+0300 INFO Print json-style information (info)! +2022-06-30T14:29:23.435756+0300 ERROR Error with HTML-file(error)! +2022-06-30T15:50:56.864827+0300 DEBUG Reader call (debug)! +2022-06-30T15:50:56.870964+0300 DEBUG Get access (debug)! +2022-06-30T15:50:57.224111+0300 DEBUG Get access (debug)! +2022-06-30T15:50:57.411757+0300 INFO Acces is available (info)! +2022-06-30T15:50:57.413751+0300 DEBUG Get title from xml (debug)! +2022-06-30T15:50:57.415746+0300 INFO Title is available (info)! +2022-06-30T15:50:57.417741+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T15:50:57.418736+0300 INFO PubDate is available (info)! +2022-06-30T15:50:57.419733+0300 DEBUG Get link from xml (debug)! +2022-06-30T15:50:57.420732+0300 INFO Link is available (info)! +2022-06-30T15:50:57.422725+0300 DEBUG Get description from xml (debug)! +2022-06-30T15:50:57.423727+0300 INFO Description is available (info)! +2022-06-30T15:50:57.425722+0300 DEBUG Convert to json call (debug)! +2022-06-30T15:50:57.426717+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T15:50:57.428710+0300 DEBUG Convert data to json (debug)! +2022-06-30T15:50:57.438834+0300 INFO Save to json file (info)! +2022-06-30T15:50:57.441825+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T15:50:57.444024+0300 DEBUG Convert data to json (debug)! +2022-06-30T15:50:57.448809+0300 INFO Save to json file (info)! +2022-06-30T15:50:57.450802+0300 DEBUG Printer call (debug)! +2022-06-30T15:50:57.452796+0300 DEBUG Read data from json(debug)! +2022-06-30T15:50:57.454908+0300 DEBUG Data is available (debug)! +2022-06-30T15:50:57.458780+0300 INFO Print information (info)! +2022-06-30T15:50:57.461771+0300 DEBUG Json-style call (debug)! +2022-06-30T15:50:57.467756+0300 DEBUG Read data from json(debug)! +2022-06-30T15:50:57.471744+0300 INFO Print json-style information (info)! +2022-06-30T16:14:35.944886+0300 DEBUG Reader call (debug)! +2022-06-30T16:14:35.950869+0300 DEBUG Get access (debug)! +2022-06-30T16:14:36.249776+0300 DEBUG Get access (debug)! +2022-06-30T16:14:36.421162+0300 INFO Acces is available (info)! +2022-06-30T16:14:36.423224+0300 DEBUG Get title from xml (debug)! +2022-06-30T16:14:36.424285+0300 INFO Title is available (info)! +2022-06-30T16:14:36.426150+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T16:14:36.427145+0300 INFO PubDate is available (info)! +2022-06-30T16:14:36.428143+0300 DEBUG Get link from xml (debug)! +2022-06-30T16:14:36.430137+0300 INFO Link is available (info)! +2022-06-30T16:14:36.431136+0300 DEBUG Get description from xml (debug)! +2022-06-30T16:14:36.433130+0300 INFO Description is available (info)! +2022-06-30T16:14:36.434128+0300 DEBUG Convert to json call (debug)! +2022-06-30T16:14:36.436121+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T16:14:36.437119+0300 DEBUG Convert data to json (debug)! +2022-06-30T16:14:36.439115+0300 INFO Save to json file (info)! +2022-06-30T16:14:36.441418+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T16:14:36.443104+0300 DEBUG Convert data to json (debug)! +2022-06-30T16:14:36.445332+0300 INFO Save to json file (info)! +2022-06-30T16:14:36.446097+0300 DEBUG Printer call (debug)! +2022-06-30T16:14:36.448090+0300 DEBUG Read data from json(debug)! +2022-06-30T16:14:36.449086+0300 DEBUG Data is available (debug)! +2022-06-30T16:14:36.452079+0300 INFO Print information (info)! +2022-06-30T16:14:36.457182+0300 DEBUG Json-style call (debug)! +2022-06-30T16:14:36.463050+0300 DEBUG Read data from json(debug)! +2022-06-30T16:14:36.470032+0300 INFO Print json-style information (info)! +2022-06-30T16:14:36.474020+0300 ERROR Error with HTML-file(error)! From 0ebcb076001e107eadcb83ac623c9c477e90f3b2 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:51:22 +0300 Subject: [PATCH 13/52] add: requirements.txt --- requirements.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..055ff375 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,10 @@ +beautifulsoup4==4.11.1 +charset-normalizer==2.0.12 +idna==3.3 +lxml==4.9.0 +soupsieve==2.3.2.post1 +urllib3==1.26.9 +python-dateutil==2.8.2 +reportlab==3.6.10 +json2html==1.3.0 +requests==2.27.1 \ No newline at end of file From 32bb08ad7438f710c66b428b570e7df5fc3aa291 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 17:20:33 +0300 Subject: [PATCH 14/52] add: parser_README.md --- parser_README.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 parser_README.md diff --git a/parser_README.md b/parser_README.md new file mode 100644 index 00000000..1c03adc0 --- /dev/null +++ b/parser_README.md @@ -0,0 +1,72 @@ +RSS reader +========= + +This is RSS reader version 4.0. + +rss_reader.py is a python script intended to get RSS feed from given source URL +and write its content to standart output also it's can convert content to .json and .html files. + + +To use this script you should install all required packages from requirements.txt +```shell +pip install {name of package} +``` + + + +How to execute after installation +------ + +Specifying the script file. Run from directory with rss_reader.py file the following command + + +Windows +```shell +python rss_reader.py ... +``` + +Linux +```bash + +python3 rss_reader.py ... +``` + +Command line format +------- + + usage: rss_reader.py [-h] [-v] [--json] [--verbose] [--limit LIMIT] [--date DATE] [--to-html ] + source + + Pure Python command-line RSS reader. + + positional arguments: + source RSS URL + + optional arguments: + -h, --help show this help message and exit + --version Print version info + --json Print result as JSON + --verbose Outputs verbose status messages. Prints logs. + --limit LIMIT Limit news topics. If it's not specified, then you get all available feed. + + --date DATE It should take a date in Ymd format.The new from the specified day will be printed out. + --html It convert data to HTML-format in file output.html. + +JSON representation +------- + +```json +{ + "name": Name of the feed, + "size": Number of available news, + "title": [Names of available news], + "pubDate": [Dates of publication news], + "description": [Summary description], + "link": [Link of source] +} +``` + +Cache storage format +------ + +News cache is stored in file data.json in current working directory. From 601aad5dc2ac21acb9493165f568944690be45de Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 17:21:44 +0300 Subject: [PATCH 15/52] fix: execute --- parser_README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser_README.md b/parser_README.md index 1c03adc0..a3f912bf 100644 --- a/parser_README.md +++ b/parser_README.md @@ -34,7 +34,7 @@ python3 rss_reader.py ... Command line format ------- - usage: rss_reader.py [-h] [-v] [--json] [--verbose] [--limit LIMIT] [--date DATE] [--to-html ] + usage: python rss_reader.py [-h] [-v] [--json] [--verbose] [--limit LIMIT] [--date DATE] [--to-html ] source Pure Python command-line RSS reader. From b8db765a159ce8b19b186ff19040b02e7daacaa3 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 17:31:02 +0300 Subject: [PATCH 16/52] fix: Console representation --- parser_README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/parser_README.md b/parser_README.md index a3f912bf..7b9c0eb0 100644 --- a/parser_README.md +++ b/parser_README.md @@ -49,9 +49,29 @@ Command line format --verbose Outputs verbose status messages. Prints logs. --limit LIMIT Limit news topics. If it's not specified, then you get all available feed. - --date DATE It should take a date in Ymd format.The new from the specified day will be printed out. + --date DATE It should take a date in %Y%m%d format.The new from the specified day will be printed out. --html It convert data to HTML-format in file output.html. +Сonsole representation +------- + +```json +Name of the feed +Title from news +PubDate + +Summary description + +Source link + +------------ +Title from news +PubDate +... +..... + + +``` JSON representation ------- From 027af4f7ce01e97570c1a594e28b035906a50a64 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:25:54 +0300 Subject: [PATCH 17/52] fix: Command exampke --- parser_README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/parser_README.md b/parser_README.md index 7b9c0eb0..c741736f 100644 --- a/parser_README.md +++ b/parser_README.md @@ -90,3 +90,20 @@ Cache storage format ------ News cache is stored in file data.json in current working directory. + + +Command example +------ + + +```shell +python rss_reader.py "https://www.onliner.by/feed" --limit 1 --html + +python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 2 --json --verbose + +python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 3 + +python rss_reader.py "https://feeds.fireside.fm/bibleinayear/rss" --limit 3 --verbose + +python rss_reader.py --date 20220620 +``` \ No newline at end of file From 2a1c153991251639b81d1d8c380bd55ba5a18f57 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:26:49 +0300 Subject: [PATCH 18/52] add: test Reader Converter Printer --- test.py | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 00000000..c1b03022 --- /dev/null +++ b/test.py @@ -0,0 +1,62 @@ +import unittest + +from reader import Reader +from converter import Converter +from printer import Printer + + +class TestReader(unittest.TestCase): + + def setUp(self): + self.reader1 = Reader("https://www.onliner.by/feed", 1) + self.reader2 = Reader("https://www.onliner.by/feed", 2) + + def test_get_acces(self): + self.assertEqual(type(self.reader1.get_title()), list) + + def test_get_title(self): + self.assertEqual(len(self.reader1.get_title()), 1) + + def test_get_pubDate(self): + self.assertEqual(len(self.reader2.get_pubDate()), 2) + + def test_get_link(self): + self.assertEqual(len(self.reader2.get_pubDate()), 2) + + def test_get_descriprion(self): + self.assertEqual(len(self.reader1.get_pubDate()), 1) + + def test_get_acces(self): + self.assertEqual(type(self.reader1.get_title()), list) + + +class TestConverter(unittest.TestCase): + def setUp(self): + self.converter1 = Converter(Reader("https://feeds.fireside.fm/bibleinayear/rss", 3)) + self.converter2 = Converter() + + def test_to_dict(self): + self.assertEqual(len(self.converter1.to_dict()), 6) + + def test_from_json(self): + self.assertEqual(len(self.converter1.from_json()), 6) + + def test_from_json2(self): + self.assertEqual(type(self.converter2.from_json()), dict) + + def test_to_HTML(self): + self.assertEqual(self.converter1.to_HTML(), True) + + +class TestPrinter(unittest.TestCase): + def setUp(self): + self.converter1 = Converter(Reader("https://feeds.fireside.fm/bibleinayear/rss", 3)) + self.printer = Printer(self.converter1.from_json()) + + def test_print(self): + print(self.printer) + + +if __name__ == "__main__": + unittest.main() + From a7764c22562e084c1af482fc9e1e6d805c9f8c2a Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:27:55 +0300 Subject: [PATCH 19/52] add: unsuccessful setup. maybe you can tell me how to fix it? :c --- setup.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..51d89817 --- /dev/null +++ b/setup.py @@ -0,0 +1,30 @@ +import os +from setuptools import find_packages, setup + + +def read(file_name): + with open(os.path.join(os.path.dirname(__file__), file_name)) as file: + return file.read() +setup( + name="rss_reader", + version="4.0", + author="Maya Voyshnis", + author_email="vvvoyshnism@gmail.com", + description='Python RSS Parser', + # long_description=open('README.txt').read(), + packages=find_packages(), + install_requires=[ + "wheel", + "setuptools", + "argparse", + "requests", + "beautifulsoup4", + "python-dateutil", + "loguru" + ], + entry_points={ + 'console_scripts': [ + 'rss_reader=rss_reader.main:main' + ], + } +) From 489b7a2425d90dd4affa4e76a22d75b3fcacc376 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:31:25 +0300 Subject: [PATCH 20/52] fix: utf-8 --- rss_reader.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/rss_reader.py b/rss_reader.py index 8b2dd13f..0addbddb 100644 --- a/rss_reader.py +++ b/rss_reader.py @@ -116,15 +116,3 @@ def main(): logger.error(f"Unexpected error (error)!") print(f"Unexpected error") raise sys.exit() - -# python f.py "https://www.onliner.by/feed" --limit 1 + -# python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 2 --json --verbose - -# python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 3 -# python rss_reader.py "https://feeds.fireside.fm/bibleinayear/rss" --limit 3 + -# python rss_reader.py "https://feeds.simplecast.com/qm_9xx0g" --limit 1 + - - -# python rss_reader.py "https://realpython.com/atom.xml" --limit 3 -# python rss_reader.py --date 20220620 -# python rss_reader.py --json \ No newline at end of file From 4584a9434a6c91cacce4ccd0e97b952b6371fc9a Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:31:45 +0300 Subject: [PATCH 21/52] fix: utf-8 --- reader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/reader.py b/reader.py index 5e218a5d..fb61345a 100644 --- a/reader.py +++ b/reader.py @@ -51,6 +51,7 @@ def get_title(self) -> list: def get_pubDate(self) -> list: logger.debug("Get pubDate from xml (debug)!") + print([self.items[i].pubDate.text for i in range(self.limit)]) return [self.items[i].pubDate.text for i in range(self.limit)] def get_link(self) -> list: From 88238f8d68092647720a889286a269b8dd2e6192 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:33:45 +0300 Subject: [PATCH 22/52] add: additional files --- .idea/.gitignore | 3 +++ .idea/HomeTask.iml | 8 ++++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ 6 files changed, 35 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/HomeTask.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/HomeTask.iml b/.idea/HomeTask.iml new file mode 100644 index 00000000..8437fe66 --- /dev/null +++ b/.idea/HomeTask.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 00000000..105ce2da --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..dc9ea490 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..ac775c34 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From cdd6fe63196c683d8a1937c7805543c70db96110 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 21:02:37 +0300 Subject: [PATCH 23/52] add: utf-8 --- Final_Task.md | 76 ++++++++++++++++++++++++++------------------------- converter.py | 1 + final_task.py | 0 3 files changed, 40 insertions(+), 37 deletions(-) delete mode 100644 final_task.py diff --git a/Final_Task.md b/Final_Task.md index 2e2e618a..71b0025a 100644 --- a/Final_Task.md +++ b/Final_Task.md @@ -4,20 +4,21 @@ You are proposed to implement Python RSS-reader using **python 3.9**. The task consists of few iterations. Do not start new iteration if the previous one is not implemented yet. ## Common requirements. -* It is mandatory to use `argparse` module. -* Codebase must be covered with unit tests with at least 50% coverage. It's a mandatory requirement. -* Yor script should **not** require installation of other services such as mysql server, +* ✅It is mandatory to use `argparse` module. +* ❗Codebase must be covered with unit tests with at least 50% coverage. It's a mandatory requirement. +* ✅Yor script should **not** require installation of other services such as mysql server, postgresql and etc. (except Iteration 6). If it does require such programs, they should be installed automatically by your script, without user doing anything. -* In case of any mistakes utility should print human-readable. +* ✅In case of any mistakes utility should print human-readable. error explanation. Exception tracebacks in stdout are prohibited in final version of application. -* Docstrings are mandatory for all methods, classes, functions and modules. -* Code must correspond to `pep8` (use `pycodestyle` utility for self-check). +*✅Docstrings are mandatory for all methods, classes, functions and modules. +*✅ Code must correspond to `pep8` (use `pycodestyle` utility for self-check). * You can set line length up to 120 symbols. -* Commit messages should provide correct and helpful information about changes in commit. Messages like `Fix bug`, + +*✅ Commit messages should provide correct and helpful information about changes in commit. Messages like `Fix bug`, `Tried to make workable`, `Temp commit` and `Finally works` are prohibited. -* All used third-party packages should be written in the `requirements.txt` file and in installation files (`setup.py`, `setup.cfg`, etc.). -* You have to write a file with documentation. Everything must be documented: how to run scripts, how to run tests, how to install the library and etc. +* ✅All used third-party packages should be written in the `requirements.txt` file and in installation files (`setup.py`, `setup.cfg`, etc.). +* ✅You have to write a file with documentation. Everything must be documented: how to run scripts, how to run tests, how to install the library and etc. ## [Iteration 1] One-shot command-line RSS reader. RSS reader should be a command-line utility which receives [RSS](wikipedia.org/wiki/RSS) URL and prints results in human-readable format. @@ -27,19 +28,19 @@ You are free to choose format of the news console output. The textbox below prov ```shell $ rss_reader.py "https://news.yahoo.com/rss/" --limit 1 -Feed: Yahoo News - Latest News & Headlines +✅Feed: Yahoo News - Latest News & Headlines -Title: Nestor heads into Georgia after tornados damage Florida -Date: Sun, 20 Oct 2019 04:21:44 +0300 -Link: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html +✅Title: Nestor heads into Georgia after tornados damage Florida +✅Date: Sun, 20 Oct 2019 04:21:44 +0300 +✅Link: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html -[image 2: Nestor heads into Georgia after tornados damage Florida][2]Nestor raced across Georgia as a post-tropical cyclone late Saturday, hours after the former tropical storm spawned a tornado that damaged +✅[image 2: Nestor heads into Georgia after tornados damage Florida][2]Nestor raced across Georgia as a post-tropical cyclone late Saturday, hours after the former tropical storm spawned a tornado that damaged homes and a school in central Florida while sparing areas of the Florida Panhandle devastated one year earlier by Hurricane Michael. The storm made landfall Saturday on St. Vincent Island, a nature preserve off Florida's northern Gulf Coast in a lightly populated area of the state, the National Hurricane Center said. Nestor was expected to bring 1 to 3 inches of rain to drought-stricken inland areas on its march across a swath of the U.S. Southeast. -Links: +❗Links: [1]: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html (link) [2]: http://l2.yimg.com/uu/api/res/1.2/Liyq2kH4HqlYHaS5BmZWpw--/YXBwaWQ9eXRhY2h5b247aD04Njt3PTEzMDs-/https://media.zenfs.com/en/ap.org/5ecc06358726cabef94585f99050f4f0 (image) @@ -52,10 +53,10 @@ usage: rss_reader.py [-h] [--version] [--json] [--verbose] [--limit LIMIT] Pure Python command-line RSS reader. -positional arguments: +✅positional arguments: source RSS URL -optional arguments: +✅optional arguments: -h, --help show this help message and exit --version Print version info --json Print result as JSON in stdout @@ -64,32 +65,32 @@ optional arguments: ``` -In case of using `--json` argument your utility should convert the news into [JSON](https://en.wikipedia.org/wiki/JSON) format. +✅In case of using `--json` argument your utility should convert the news into [JSON](https://en.wikipedia.org/wiki/JSON) format. You should come up with the JSON structure on you own and describe it in the README.md file for your repository or in a separate documentation file. -With the argument `--verbose` your program should print all logs in stdout. +✅With the argument `--verbose` your program should print all logs in stdout. ### Task clarification (I) -1) If `--version` option is specified app should _just print its version_ and stop. -2) User should be able to use `--version` option without specifying RSS URL. For example: +✅1) If `--version` option is specified app should _just print its version_ and stop. +✅2) User should be able to use `--version` option without specifying RSS URL. For example: ``` > python rss_reader.py --version "Version 1.4" ``` 3) The version is supposed to change with every iteration. -4) If `--limit` is not specified, then user should get _all_ available feed. -5) If `--limit` is larger than feed size then user should get _all_ available news. -6) `--verbose` should print logs _in the process_ of application running, _not after everything is done_. -7) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout_. -8) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout in JSON format_. +✅4) If `--limit` is not specified, then user should get _all_ available feed. +✅5) If `--limit` is larger than feed size then user should get _all_ available news. +✅6) `--verbose` should print logs _in the process_ of application running, _not after everything is done_. +✅7) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout_. +✅8) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout in JSON format_. 9) It is preferrable to have different custom exceptions for different situations(If needed). -10) The `--limit` argument should also affect JSON generation. +✅10) The `--limit` argument should also affect JSON generation. -## [Iteration 2] Distribution. +## ❗[Iteration 2] Distribution. * Utility should be wrapped into distribution package with `setuptools`. * This package should export CLI utility named `rss-reader`. @@ -114,23 +115,23 @@ as well as this: ## [Iteration 3] News caching. -The RSS news should be stored in a local storage while reading. The way and format of this storage you can choose yourself. -Please describe it in a separate section of README.md or in the documentation. +✅The RSS news should be stored in a local storage while reading. The way and format of this storage you can choose yourself. +❗Please describe it in a separate section of README.md or in the documentation. New optional argument `--date` must be added to your utility. It should take a date in `%Y%m%d` format. For example: `--date 20191020` Here date means actual *publishing date* not the date when you fetched the news. -The cashed news can be read with it. The new from the specified day will be printed out. +✅The cashed news can be read with it. The new from the specified day will be printed out. If the news are not found return an error. -If the `--date` argument is not provided, the utility should work like in the previous iterations. +✅If the `--date` argument is not provided, the utility should work like in the previous iterations. ### Task clarification (III) -1) Try to make your application crossplatform, meaning that it should work on both Linux and Windows. +❗1) Try to make your application crossplatform, meaning that it should work on both Linux and Windows. For example when working with filesystem, try to use `os.path` lib instead of manually concatenating file paths. -2) `--date` should **not** require internet connection to fetch news from local cache. -3) User should be able to use `--date` without specifying RSS source. For example: +✅2) `--date` should **not** require internet connection to fetch news from local cache. +✅3) User should be able to use `--date` without specifying RSS source. For example: ``` > python rss_reader.py --date 20191206 ...... @@ -140,8 +141,9 @@ Or for second iteration (when installed using setuptools): > rss_reader --date 20191206 ...... ``` -4) If `--date` specified _together with RSS source_, then app should get news _for this date_ from local cache that _were fetched from specified source_. -5) `--date` should work correctly with both `--json`, `--limit`, `--verbose` and their different combinations. +❗4) If `--date` specified _together with RSS source_, then app should get news _for this date_ from local cache that _were fetched from specified source_. + +✅5) `--date` should work correctly with both `--json`, `--limit`, `--verbose` and their different combinations. ## [Iteration 4] Format converter. diff --git a/converter.py b/converter.py index 080c549b..8ce589dd 100644 --- a/converter.py +++ b/converter.py @@ -46,3 +46,4 @@ def to_HTML(self): with open(htmlReportFile, 'w') as htmlfile: htmlfile.write(str(scanOutput)) print("Data save in output.html") + return True diff --git a/final_task.py b/final_task.py deleted file mode 100644 index e69de29b..00000000 From 78315fab1ddf0da402f4d84121bdc39e301787f1 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 21:11:01 +0300 Subject: [PATCH 24/52] update --- data.json | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/data.json b/data.json index 4060f166..915a42bf 100644 --- a/data.json +++ b/data.json @@ -1,16 +1,24 @@ { "name": "BuzzFeed - Quizzes", - "size": 1, + "size": 3, "title": [ - "Pick Lots Of Dogs And I Bet You That I Won't Get Your Eye Color Right" + "Okay, But For Real \u2014 Do These Celebs Deserve More Or Less Time In The Limelight?", + "Roll Up A Suuuper Fat Burrito To Reveal The Musical Instrument You Were Born To Play", + "Order Off The Kids Menu And We'll Tell You How Many Children You're Gonna Have" ], "pubDate": [ - "Sun, 26 Jun 2022 00:40:18 -0400" + "Wed, 29 Jun 2022 23:46:02 -0400", + "Mon, 27 Jun 2022 21:32:03 -0400", + "Wed, 29 Jun 2022 15:16:58 -0400" ], "description": [ - "I WANT to get it wrong...View Entire Post ;" + "When I see certain celebrity names trending on Twitter, my fight or flight kicks in. \ud83d\udc40View Entire Post ;", + "I personally wouldn't mind tickling some ivories...View Entire Post ;", + "Happy Meals still slap.View Entire Post ;" ], "link": [ - "https://www.buzzfeed.com/turtleo/dog-eye-color-guessing-quiz" + "https://www.buzzfeed.com/hannahdobro/celebrities-in-the-news-poll", + "https://www.buzzfeed.com/benjaminyp/your-burrito-reveals-the-instrument-you-should-play", + "https://www.buzzfeed.com/blackwidow888/kids-menu-number-of-kids-quiz" ] } \ No newline at end of file From 9b211453c47b5b6470251fb9bc0d48341af66623 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 21:15:47 +0300 Subject: [PATCH 25/52] delete --- README.md | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index c86d1e65..00000000 --- a/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# How to create a PR with a homework task - -1. Create fork from the following repo: https://github.com/E-P-T/Homework. (Docs: https://docs.github.com/en/get-started/quickstart/fork-a-repo ) -2. Clone your forked repo in your local folder. -3. Create separate branches for each session.Example(`session_2`, `session_3` and so on) -4. Create folder with you First and Last name in you forked repo in the created session. -5. Add your task into created folder -6. Push finished session task in the appropriate branch in accordance with written above. - You should get the structure that looks something like that - -``` - Branch: Session_2 - DzmitryKolb - |___Task1.py - |___Task2.py - Branch: Session_3 - DzmitryKolb - |___Task1.py - |___Task2.py -``` - -7. When you finish your work on task you should create Pull request to the appropriate branch of the main repo https://github.com/E-P-T/Homework (Docs: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork). -Please use the following instructions to prepare good description of the pull request: - - Pull request header should be: `Session - `. - Example: `Session 2 - Dzmitry Kolb` - - Pull request body: You should write here what tasks were implemented. - Example: `Finished: Task 1.2, Task 1.3, Task 1.6` - From bf4485e5b6f1ca5559c06adccbbe0e87519d3dd7 Mon Sep 17 00:00:00 2001 From: Valery Litskevich Date: Tue, 24 May 2022 18:57:26 +0500 Subject: [PATCH 26/52] Add final task --- Final_Task.md | 195 ++++++++++++++++++++++++++++++++++++++++++++++++++ RULES.md | 12 ++++ 2 files changed, 207 insertions(+) create mode 100644 Final_Task.md create mode 100644 RULES.md diff --git a/Final_Task.md b/Final_Task.md new file mode 100644 index 00000000..2e2e618a --- /dev/null +++ b/Final_Task.md @@ -0,0 +1,195 @@ +# Introduction to Python. Final task. +You are proposed to implement Python RSS-reader using **python 3.9**. + +The task consists of few iterations. Do not start new iteration if the previous one is not implemented yet. + +## Common requirements. +* It is mandatory to use `argparse` module. +* Codebase must be covered with unit tests with at least 50% coverage. It's a mandatory requirement. +* Yor script should **not** require installation of other services such as mysql server, +postgresql and etc. (except Iteration 6). If it does require such programs, +they should be installed automatically by your script, without user doing anything. +* In case of any mistakes utility should print human-readable. +error explanation. Exception tracebacks in stdout are prohibited in final version of application. +* Docstrings are mandatory for all methods, classes, functions and modules. +* Code must correspond to `pep8` (use `pycodestyle` utility for self-check). + * You can set line length up to 120 symbols. +* Commit messages should provide correct and helpful information about changes in commit. Messages like `Fix bug`, +`Tried to make workable`, `Temp commit` and `Finally works` are prohibited. +* All used third-party packages should be written in the `requirements.txt` file and in installation files (`setup.py`, `setup.cfg`, etc.). +* You have to write a file with documentation. Everything must be documented: how to run scripts, how to run tests, how to install the library and etc. + +## [Iteration 1] One-shot command-line RSS reader. +RSS reader should be a command-line utility which receives [RSS](wikipedia.org/wiki/RSS) URL and prints results in human-readable format. + +You are free to choose format of the news console output. The textbox below provides an example of how it can be implemented: + +```shell +$ rss_reader.py "https://news.yahoo.com/rss/" --limit 1 + +Feed: Yahoo News - Latest News & Headlines + +Title: Nestor heads into Georgia after tornados damage Florida +Date: Sun, 20 Oct 2019 04:21:44 +0300 +Link: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html + +[image 2: Nestor heads into Georgia after tornados damage Florida][2]Nestor raced across Georgia as a post-tropical cyclone late Saturday, hours after the former tropical storm spawned a tornado that damaged +homes and a school in central Florida while sparing areas of the Florida Panhandle devastated one year earlier by Hurricane Michael. The storm made landfall Saturday on St. Vincent Island, a nature preserve +off Florida's northern Gulf Coast in a lightly populated area of the state, the National Hurricane Center said. Nestor was expected to bring 1 to 3 inches of rain to drought-stricken inland areas on its +march across a swath of the U.S. Southeast. + + +Links: +[1]: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html (link) +[2]: http://l2.yimg.com/uu/api/res/1.2/Liyq2kH4HqlYHaS5BmZWpw--/YXBwaWQ9eXRhY2h5b247aD04Njt3PTEzMDs-/https://media.zenfs.com/en/ap.org/5ecc06358726cabef94585f99050f4f0 (image) + +``` + +Utility should provide the following interface: +```shell +usage: rss_reader.py [-h] [--version] [--json] [--verbose] [--limit LIMIT] + source + +Pure Python command-line RSS reader. + +positional arguments: + source RSS URL + +optional arguments: + -h, --help show this help message and exit + --version Print version info + --json Print result as JSON in stdout + --verbose Outputs verbose status messages + --limit LIMIT Limit news topics if this parameter provided + +``` + +In case of using `--json` argument your utility should convert the news into [JSON](https://en.wikipedia.org/wiki/JSON) format. +You should come up with the JSON structure on you own and describe it in the README.md file for your repository or in a separate documentation file. + + + +With the argument `--verbose` your program should print all logs in stdout. + +### Task clarification (I) + +1) If `--version` option is specified app should _just print its version_ and stop. +2) User should be able to use `--version` option without specifying RSS URL. For example: +``` +> python rss_reader.py --version +"Version 1.4" +``` +3) The version is supposed to change with every iteration. +4) If `--limit` is not specified, then user should get _all_ available feed. +5) If `--limit` is larger than feed size then user should get _all_ available news. +6) `--verbose` should print logs _in the process_ of application running, _not after everything is done_. +7) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout_. +8) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout in JSON format_. +9) It is preferrable to have different custom exceptions for different situations(If needed). +10) The `--limit` argument should also affect JSON generation. + + +## [Iteration 2] Distribution. + +* Utility should be wrapped into distribution package with `setuptools`. +* This package should export CLI utility named `rss-reader`. + + +### Task clarification (II) + +1) User should be able to run your application _both_ with and without installation of CLI utility, +meaning that this should work: + +``` +> python rss_reader.py ... +``` + +as well as this: + +``` +> rss_reader ... +``` +2) Make sure your second iteration works on a clean machie with python 3.9. (!) +3) Keep in mind that installed CLI utility should have the same functionality, so do not forget to update dependencies and packages. + + +## [Iteration 3] News caching. +The RSS news should be stored in a local storage while reading. The way and format of this storage you can choose yourself. +Please describe it in a separate section of README.md or in the documentation. + +New optional argument `--date` must be added to your utility. It should take a date in `%Y%m%d` format. +For example: `--date 20191020` +Here date means actual *publishing date* not the date when you fetched the news. + +The cashed news can be read with it. The new from the specified day will be printed out. +If the news are not found return an error. + +If the `--date` argument is not provided, the utility should work like in the previous iterations. + +### Task clarification (III) +1) Try to make your application crossplatform, meaning that it should work on both Linux and Windows. +For example when working with filesystem, try to use `os.path` lib instead of manually concatenating file paths. +2) `--date` should **not** require internet connection to fetch news from local cache. +3) User should be able to use `--date` without specifying RSS source. For example: +``` +> python rss_reader.py --date 20191206 +...... +``` +Or for second iteration (when installed using setuptools): +``` +> rss_reader --date 20191206 +...... +``` +4) If `--date` specified _together with RSS source_, then app should get news _for this date_ from local cache that _were fetched from specified source_. +5) `--date` should work correctly with both `--json`, `--limit`, `--verbose` and their different combinations. + +## [Iteration 4] Format converter. + +You should implement the conversion of news in at least two of the suggested format: `.mobi`, `.epub`, `.fb2`, `.html`, `.pdf` + +New optional argument must be added to your utility. This argument receives the path where new file will be saved. The arguments should represents which format will be generated. + +For example: `--to-mobi` or `--to-fb2` or `--to-epub` + +You can choose yourself the way in which the news will be displayed, but the final text result should contain pictures and links, if they exist in the original article and if the format permits to store this type of data. + +### Task clarification (IV) + +Convertation options should work correctly together with all arguments that were implemented in Iterations 1-3. For example: +* Format convertation process should be influenced by `--limit`. +* If `--json` is specified together with convertation options, then JSON news should +be printed to stdout, and converted file should contain news in normal format. +* Logs from `--verbose` should be printed in stdout and not added to the resulting file. +* `--date` should also work correctly with format converter and to not require internet access. + +## * [Iteration 5] Output colorization. +> Note: An optional iteration, it is not necessary to implement it. You can move on with it only if all the previous iterations (from 1 to 4) are completely implemented. + +You should add new optional argument `--colorize`, that will print the result of the utility in colorized mode. + +*If the argument is not provided, the utility should work like in the previous iterations.* + +> Note: Take a look at the [colorize](https://pypi.org/project/colorize/) library + +## * [Iteration 6] Web-server. +> Note: An optional iteration, it is not necessary to implement it. You can move on with it only if all the previous iterations (from 1 to 4) are completely implemented. Introduction to Python course does not cover the topics that are needed for the implementation of this part. + +There are several mandatory requirements in this iteration: +* `Docker` + `docker-compose` usage (at least 2 containers: one for web-application, one for DB) +* Web application should provide all the implemented in the previous parts of the task functionality, using the REST API: + * One-shot conversion from RSS to Human readable format + * Server-side news caching + * Conversion in epub, mobi, fb2 or other formats + +Feel free to choose the way of implementation, libraries and frameworks. (We suggest you `Django Rest Framework` + `PostgreSQL` combination) + +You can implement any functionality that you want. The only requirement is to add the description into README file or update project documentation, for example: +* authorization/authentication +* automatic scheduled news update +* adding new RSS sources using API + +--- +Implementations will be checked with the latest cPython interpreter of 3.9 branch. +--- + +> Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Code for readability. **John F. Woods** diff --git a/RULES.md b/RULES.md new file mode 100644 index 00000000..9a72034f --- /dev/null +++ b/RULES.md @@ -0,0 +1,12 @@ +# Final task +Final task (`FT`) for EPAM Python Training 2022.03 + +## Rules +* All work has to be implemented in the `master` branch in forked repository. If you think that `FT` is ready, please open a pull request (`PR`) to our repo. +* When a `PR` will be ready, please mark it with the `final_task` label. +* You have one month to finish `FT`. Commits commited after deadline will be ignored. +* At least the first 4 iterations must be done. +* `FT` you can find in the `Final_Task.md` file. + +### Good luck! + From a741c21a5f9b3e9be18f604c9a6193f7ee6285b7 Mon Sep 17 00:00:00 2001 From: fcumay Date: Sun, 26 Jun 2022 23:24:12 +0300 Subject: [PATCH 27/52] added empty file .py --- final_task.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 final_task.py diff --git a/final_task.py b/final_task.py new file mode 100644 index 00000000..e69de29b From a57996a24aaa7a721e6eb62db53fddb1b4e3e39e Mon Sep 17 00:00:00 2001 From: fcumay Date: Sun, 26 Jun 2022 23:35:08 +0300 Subject: [PATCH 28/52] ss --- final_task.py | 1 + 1 file changed, 1 insertion(+) diff --git a/final_task.py b/final_task.py index e69de29b..157a46f6 100644 --- a/final_task.py +++ b/final_task.py @@ -0,0 +1 @@ + z \ No newline at end of file From 2ffa8852aa2505525cef7e5cc8d1d9dad9a80975 Mon Sep 17 00:00:00 2001 From: fcumay Date: Sun, 26 Jun 2022 23:37:45 +0300 Subject: [PATCH 29/52] added empty file --- final_task.py | 1 - 1 file changed, 1 deletion(-) diff --git a/final_task.py b/final_task.py index 157a46f6..e69de29b 100644 --- a/final_task.py +++ b/final_task.py @@ -1 +0,0 @@ - z \ No newline at end of file From fae00f6f6dc837473ad38e27abe5548aa2e4b84b Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 15:58:33 +0300 Subject: [PATCH 30/52] add: class Reader --- reader.py | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 reader.py diff --git a/reader.py b/reader.py new file mode 100644 index 00000000..5e218a5d --- /dev/null +++ b/reader.py @@ -0,0 +1,70 @@ +from loguru import logger +import requests +from bs4 import BeautifulSoup +import re +import sys + + +class Reader: + """Parse data from URL""" + + def __init__(self, source: str, limit=-1) -> None: + self.version = '4.0' + self.source = source + self.name = self.get_acces()[0] + self.items = self.get_acces()[1] + logger.info("Acces is available (info)!") + self.limit = len(self.items) if limit == -1 or limit > len(self.items) else limit + self.title = self.get_title() + logger.info("Title is available (info)!") + self.pubDate = self.get_pubDate() + logger.info("PubDate is available (info)!") + self.link = self.get_link() + logger.info("Link is available (info)!") + self.clear_description = list() + self.description = self.get_description() + logger.info("Description is available (info)!") + + def get_acces(self) -> list: + logger.debug("Get access (debug)!") + try: + url = requests.get(self.source) + except Exception: + logger.info(f"Invalid url.{self.source}(info)!") + print('Could not fetch the URL. Input valid URL.') + sys.exit() + try: + soup = BeautifulSoup(url.content, 'xml') + name = soup.find().title.text + items = soup.find_all('item') + if len(items) == 0: + raise Exception + except Exception as e: + logger.info(f"Invalid url.{self.source}(info)!") + print('Could not read feed. Input xml-format URL.') + sys.exit() + return name, items + + def get_title(self) -> list: + logger.debug("Get title from xml (debug)!") + return [self.items[i].title.text for i in range(self.limit)] + + def get_pubDate(self) -> list: + logger.debug("Get pubDate from xml (debug)!") + return [self.items[i].pubDate.text for i in range(self.limit)] + + def get_link(self) -> list: + logger.debug("Get link from xml (debug)!") + return [self.items[i].link.text for i in range(self.limit)] + + def get_description(self) -> list: + logger.debug("Get description from xml (debug)!") + des = [] + for i in range(self.limit): + if self.items[i].description: + des.append(self.items[i].description.text) + self.clear_description.append(re.sub(r'\<[^>]*\>|(&rsaquo)', '', self.items[i].description.text)) + else: + des.append('No description here') + self.clear_description.append('No description here') + return des From 7c00a577d05b7387385848490a79ad59d65cc29b Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 15:59:57 +0300 Subject: [PATCH 31/52] add: class Printer --- printer.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 printer.py diff --git a/printer.py b/printer.py new file mode 100644 index 00000000..7a38ec58 --- /dev/null +++ b/printer.py @@ -0,0 +1,16 @@ +from loguru import logger + + +class Printer: + """Print result in stdout""" + + def __init__(self, data: dict) -> None: + logger.debug("Data is available (debug)!") + self.data = data + + def __str__(self) -> str: + return self.data["name"] + '\n' + ''.join([(f'{self.data["title"][i]}\n' + f'{self.data["pubDate"][i]}\n\n' + f'{self.data["description"][i]}\n\n' + f'{self.data["link"][i]}\n\n---------------\n\n') for i in + range(self.data["size"])]) From fc25a535a8be835244fffb686bebec9adfd00644 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:05:12 +0300 Subject: [PATCH 32/52] add: class Converter --- converter.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 converter.py diff --git a/converter.py b/converter.py new file mode 100644 index 00000000..8db216a1 --- /dev/null +++ b/converter.py @@ -0,0 +1,46 @@ +from loguru import logger +import json +from json2html import * + +class Converter: + """ + Convert from: object to dict + json to dict + dict to json + json to HTML + + """ + def __init__(self, my_reader=None)->None: + self.my_reader = my_reader + + def to_dict(self)->dict: + logger.debug("Convert data to dictionary (debug)!") + dict = {"name": self.my_reader.name, + "size": self.my_reader.limit, + "title": self.my_reader.title, + "pubDate": self.my_reader.pubDate, + "description": self.my_reader.clear_description, + "link": self.my_reader.link} + return dict + + def from_json(self)->dict: + logger.debug("Read data from json(debug)!") + with open('data.json') as json_file: + data = json.load(json_file) + return data + + def to_JSON(self, dict=False)->None: + if not dict: + dict = self.to_dict() + logger.debug("Convert data to json (debug)!") + with open('data.json', 'w+') as outfile: + json.dump(dict, outfile, indent=4) + + def to_HTML(self): + with open("data.json") as f: + d = json.load(f) + scanOutput = json2html.convert(json=d) + htmlReportFile = "output.html" + with open(htmlReportFile, 'w') as htmlfile: + htmlfile.write(str(scanOutput)) + print("Data save in output.html") \ No newline at end of file From bf4d3c84f400982e6c707c5c60bae2d13154c745 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:07:20 +0300 Subject: [PATCH 33/52] fix: utf-8 --- converter.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/converter.py b/converter.py index 8db216a1..080c549b 100644 --- a/converter.py +++ b/converter.py @@ -2,6 +2,7 @@ import json from json2html import * + class Converter: """ Convert from: object to dict @@ -10,10 +11,11 @@ class Converter: json to HTML """ - def __init__(self, my_reader=None)->None: + + def __init__(self, my_reader=None) -> None: self.my_reader = my_reader - def to_dict(self)->dict: + def to_dict(self) -> dict: logger.debug("Convert data to dictionary (debug)!") dict = {"name": self.my_reader.name, "size": self.my_reader.limit, @@ -23,13 +25,13 @@ def to_dict(self)->dict: "link": self.my_reader.link} return dict - def from_json(self)->dict: + def from_json(self) -> dict: logger.debug("Read data from json(debug)!") with open('data.json') as json_file: data = json.load(json_file) return data - def to_JSON(self, dict=False)->None: + def to_JSON(self, dict=False) -> None: if not dict: dict = self.to_dict() logger.debug("Convert data to json (debug)!") @@ -43,4 +45,4 @@ def to_HTML(self): htmlReportFile = "output.html" with open(htmlReportFile, 'w') as htmlfile: htmlfile.write(str(scanOutput)) - print("Data save in output.html") \ No newline at end of file + print("Data save in output.html") From ed88eb1c12ac92eaf63a3efff507266239cb7777 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:22:36 +0300 Subject: [PATCH 34/52] feat: move exception --- rss_reader.py | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 rss_reader.py diff --git a/rss_reader.py b/rss_reader.py new file mode 100644 index 00000000..8b2dd13f --- /dev/null +++ b/rss_reader.py @@ -0,0 +1,130 @@ +import argparse +import sys +from loguru import logger + +from reader import Reader +from printer import Printer +from converter import Converter + +VERSION = '4.0' + +logger.add("debug.log", format="{time} {level} {message}", level="DEBUG") + + +def args() -> argparse.Namespace: + parser = argparse.ArgumentParser(description="Choose type of the interface") + parser.add_argument("-v", "--version", action="store_true", help="Print version info") + parser.add_argument("--json", action="store_true", help="Print result as JSON") + parser.add_argument("--verbose", action="store_true", help="Outputs verbose status messages.Print logs.") + parser.add_argument("--limit", type=int, + help="Limit news topics. If it's not specified, then you get all available feed") + parser.add_argument("--date", type=str, + help="It should take a date in Ymd format.The new from the specified day will be printed out.") + parser.add_argument("--html", action="store_true", help="It convert data to HTML-format in file output.html.") + parser.add_argument("source", nargs="?", type=str, help="RSS URL") + args = parser.parse_args() + return args + + +def date_search(data: dict, date: str) -> dict: + if len(date) < 7 or not (date.isdigit()): + logger.info(f"Invalid date.{date}!") + print(f"Invalid date.{date}. Use pattern YMD!") + raise sys.exit() + + logger.debug("Start data searching (debug)!") + new_dates = [] + month = {"Jan": "01", "Feb": "02", "Mar": "03", "Apr": "04", "May": "05", "Jun": "06", "Jul": "07", "Aug": "08", + "Sep": "09", "Oct": "10", "Nov": "11", "Dec": "12"} + for d in data["pubDate"]: + for key in month.keys(): + if key in d: + new_dates.append(d.replace(key, month[key])) + new_date = date[6::] + ' ' + date[4:6:] + ' ' + date[:4:] + list_of_index = [] + + for i in range(len(new_dates)): + if new_date in new_dates[i]: + list_of_index.append(i) + if len(list_of_index) == 0: + logger.info(f"No information found.{date}!") + print(f"No information found.{date}.") + raise sys.exit() + new_data = {"name": data["name"], + "size": len(list_of_index), + "title": [data["title"][i] for i in list_of_index], + "pubDate": [data["pubDate"][i] for i in list_of_index], + "description": [data["description"][i] for i in list_of_index], + "link": [data["link"][i] for i in list_of_index] + } + return new_data + + +def main(): + if not args().verbose: + logger.remove() + if args().version: + logger.debug("Version call (debug)!") + print('Version:' + VERSION) + logger.info("Print version (info)!") + sys.exit() + elif args().date and args().source == None: + converter = Converter() + logger.debug("Convert to json call (debug)!") + converter.to_JSON(date_search(converter.from_json(), args().date)) + logger.info("Succesful data search (info)!") + logger.info("Save to json file (info)!") + printer = Printer(converter.from_json()) + print(printer) + else: + logger.debug("Reader call (debug)!") + my_reader = Reader(args().source, args().limit) if args().limit else Reader(args().source) + converter = Converter(my_reader) + logger.debug("Convert to json call (debug)!") + converter.to_JSON() + logger.info("Save to json file (info)!") + if args().date: + date_search(converter.from_json(), args().date) + converter.to_JSON(date_search(converter.from_json(), args().date)) + logger.info("Succesful data search (info)!") + else: + converter.to_JSON() + logger.info("Save to json file (info)!") + logger.debug("Printer call (debug)!") + printer = Printer(converter.from_json()) + print(printer) + logger.info("Print information (info)!") + + if args().json: + logger.debug("Json-style call (debug)!") + print("Json style:\n") + print(converter.from_json()) + logger.info("Print json-style information (info)!") + + if args().html: + try: + converter.to_HTML() + except Exception: + logger.error(f"Error with HTML-file(error)!") + print('Error: convert to HTML-file does not work with this URL ') + + +if __name__ == '__main__': + try: + main() + except Exception: + logger.error(f"Unexpected error (error)!") + print(f"Unexpected error") + raise sys.exit() + +# python f.py "https://www.onliner.by/feed" --limit 1 + +# python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 2 --json --verbose + +# python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 3 +# python rss_reader.py "https://feeds.fireside.fm/bibleinayear/rss" --limit 3 + +# python rss_reader.py "https://feeds.simplecast.com/qm_9xx0g" --limit 1 + + + +# python rss_reader.py "https://realpython.com/atom.xml" --limit 3 +# python rss_reader.py --date 20220620 +# python rss_reader.py --json \ No newline at end of file From 2a992f702b34350d5b153250a486ffc02603e883 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:23:27 +0300 Subject: [PATCH 35/52] add: files for store data --- data.json | 16 ++++++++++++++++ output.html | 1 + 2 files changed, 17 insertions(+) create mode 100644 data.json create mode 100644 output.html diff --git a/data.json b/data.json new file mode 100644 index 00000000..4060f166 --- /dev/null +++ b/data.json @@ -0,0 +1,16 @@ +{ + "name": "BuzzFeed - Quizzes", + "size": 1, + "title": [ + "Pick Lots Of Dogs And I Bet You That I Won't Get Your Eye Color Right" + ], + "pubDate": [ + "Sun, 26 Jun 2022 00:40:18 -0400" + ], + "description": [ + "I WANT to get it wrong...View Entire Post ;" + ], + "link": [ + "https://www.buzzfeed.com/turtleo/dog-eye-color-guessing-quiz" + ] +} \ No newline at end of file diff --git a/output.html b/output.html new file mode 100644 index 00000000..576aff25 --- /dev/null +++ b/output.html @@ -0,0 +1 @@ +
nameBuzzFeed - Quizzes
size1
title
  • Pick Lots Of Dogs And I Bet You That I Won't Get Your Eye Color Right
pubDate
  • Sun, 26 Jun 2022 00:40:18 -0400
description
  • I WANT to get it wrong...View Entire Post ;
link
  • https://www.buzzfeed.com/turtleo/dog-eye-color-guessing-quiz
\ No newline at end of file From fd952b94c2cc3e981356721d234ac93925c7512d Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:32:23 +0300 Subject: [PATCH 36/52] add: debug.log --- debug.log | 256 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 debug.log diff --git a/debug.log b/debug.log new file mode 100644 index 00000000..6ac67165 --- /dev/null +++ b/debug.log @@ -0,0 +1,256 @@ +2022-06-30T03:02:18.187727+0300 DEBUG Convert to json call (debug)! +2022-06-30T03:02:18.191716+0300 DEBUG Read data from json(debug)! +2022-06-30T03:02:18.199064+0300 INFO Invalid date.12! +2022-06-30T03:11:13.840117+0300 DEBUG Convert to json call (debug)! +2022-06-30T03:11:13.842375+0300 DEBUG Read data from json(debug)! +2022-06-30T03:11:13.844956+0300 DEBUG Start data searching (debug)! +2022-06-30T03:11:13.845957+0300 DEBUG Convert data to json (debug)! +2022-06-30T03:11:13.848139+0300 INFO Succesful data search (info)! +2022-06-30T03:11:13.849176+0300 INFO Save to json file (info)! +2022-06-30T03:22:37.532486+0300 DEBUG Reader call (debug)! +2022-06-30T03:22:37.540589+0300 DEBUG Get access (debug)! +2022-06-30T03:22:38.514206+0300 DEBUG Get access (debug)! +2022-06-30T03:22:38.844512+0300 INFO Acces is available (info)! +2022-06-30T03:22:38.850225+0300 DEBUG Get title from xml (debug)! +2022-06-30T03:22:38.855341+0300 INFO Title is available (info)! +2022-06-30T03:22:38.867370+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T03:22:38.872953+0300 INFO PubDate is available (info)! +2022-06-30T03:22:38.880131+0300 DEBUG Get link from xml (debug)! +2022-06-30T03:22:38.886188+0300 INFO Link is available (info)! +2022-06-30T03:22:38.894052+0300 DEBUG Get description from xml (debug)! +2022-06-30T03:22:38.900805+0300 INFO Description is available (info)! +2022-06-30T03:22:38.906346+0300 DEBUG Convert to json call (debug)! +2022-06-30T03:22:38.919651+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T03:22:38.932401+0300 DEBUG Convert data to json (debug)! +2022-06-30T03:22:38.940350+0300 INFO Save to json file (info)! +2022-06-30T03:22:38.951201+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T03:22:38.958168+0300 DEBUG Convert data to json (debug)! +2022-06-30T03:22:38.967175+0300 INFO Save to json file (info)! +2022-06-30T03:22:38.972942+0300 DEBUG Printer call (debug)! +2022-06-30T03:22:38.980110+0300 DEBUG Read data from json(debug)! +2022-06-30T03:22:38.986679+0300 DEBUG Data is available (debug)! +2022-06-30T03:22:38.993616+0300 INFO Print information (info)! +2022-06-30T03:22:39.002501+0300 DEBUG Json-style call (debug)! +2022-06-30T03:22:39.016814+0300 DEBUG Read data from json(debug)! +2022-06-30T03:22:39.024253+0300 INFO Print json-style information (info)! +2022-06-30T03:23:17.045754+0300 DEBUG Version call (debug)! +2022-06-30T03:23:17.051827+0300 INFO Print version (info)! +2022-06-30T03:23:17.057973+0300 DEBUG Json-style call (debug)! +2022-06-30T03:23:17.067590+0300 ERROR Unexpected error (error)! +2022-06-30T03:23:52.100284+0300 DEBUG Version call (debug)! +2022-06-30T03:23:52.103679+0300 INFO Print version (info)! +2022-06-30T14:11:41.309447+0300 DEBUG Reader call (debug)! +2022-06-30T14:11:41.314282+0300 DEBUG Get access (debug)! +2022-06-30T14:11:42.239843+0300 DEBUG Get access (debug)! +2022-06-30T14:11:42.503458+0300 INFO Acces is available (info)! +2022-06-30T14:11:42.505613+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:11:42.507447+0300 INFO Title is available (info)! +2022-06-30T14:11:42.508444+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:11:42.510439+0300 INFO PubDate is available (info)! +2022-06-30T14:11:42.511435+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:11:42.513430+0300 INFO Link is available (info)! +2022-06-30T14:11:42.515555+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:11:42.517421+0300 INFO Description is available (info)! +2022-06-30T14:11:42.519415+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:11:42.520412+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:11:42.522407+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:11:42.526397+0300 INFO Save to json file (info)! +2022-06-30T14:11:42.529388+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:11:42.531383+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:11:42.582247+0300 INFO Save to json file (info)! +2022-06-30T14:11:42.586747+0300 DEBUG Printer call (debug)! +2022-06-30T14:11:42.588748+0300 DEBUG Read data from json(debug)! +2022-06-30T14:11:42.590743+0300 DEBUG Data is available (debug)! +2022-06-30T14:11:42.592737+0300 INFO Print information (info)! +2022-06-30T14:11:42.602713+0300 DEBUG Json-style call (debug)! +2022-06-30T14:11:42.610691+0300 DEBUG Read data from json(debug)! +2022-06-30T14:11:42.613745+0300 INFO Print json-style information (info)! +2022-06-30T14:11:42.616674+0300 ERROR Unexpected error (error)! +2022-06-30T14:14:16.206220+0300 DEBUG Reader call (debug)! +2022-06-30T14:14:16.209181+0300 DEBUG Get access (debug)! +2022-06-30T14:14:17.054766+0300 DEBUG Get access (debug)! +2022-06-30T14:14:17.244215+0300 INFO Acces is available (info)! +2022-06-30T14:14:17.247684+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:14:17.248681+0300 INFO Title is available (info)! +2022-06-30T14:14:17.249951+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:14:17.251672+0300 INFO PubDate is available (info)! +2022-06-30T14:14:17.252741+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:14:17.254667+0300 INFO Link is available (info)! +2022-06-30T14:14:17.255662+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:14:17.256660+0300 INFO Description is available (info)! +2022-06-30T14:14:17.257658+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:14:17.259830+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:14:17.260650+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:14:17.262645+0300 INFO Save to json file (info)! +2022-06-30T14:14:17.264639+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:14:17.265637+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:14:17.267632+0300 INFO Save to json file (info)! +2022-06-30T14:14:17.271620+0300 DEBUG Printer call (debug)! +2022-06-30T14:14:17.274614+0300 DEBUG Read data from json(debug)! +2022-06-30T14:14:17.279602+0300 DEBUG Data is available (debug)! +2022-06-30T14:14:17.283590+0300 INFO Print information (info)! +2022-06-30T14:14:17.288577+0300 DEBUG Json-style call (debug)! +2022-06-30T14:14:17.290571+0300 DEBUG Read data from json(debug)! +2022-06-30T14:14:17.292765+0300 INFO Print json-style information (info)! +2022-06-30T14:14:17.294746+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:14:17.296209+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:14:17.298952+0300 ERROR Unexpected error (error)! +2022-06-30T14:14:35.037139+0300 DEBUG Reader call (debug)! +2022-06-30T14:14:35.043143+0300 DEBUG Get access (debug)! +2022-06-30T14:14:35.233215+0300 DEBUG Get access (debug)! +2022-06-30T14:14:35.437977+0300 INFO Acces is available (info)! +2022-06-30T14:14:35.439971+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:14:35.441966+0300 INFO Title is available (info)! +2022-06-30T14:14:35.444770+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:14:35.446481+0300 INFO PubDate is available (info)! +2022-06-30T14:14:35.448476+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:14:35.449474+0300 INFO Link is available (info)! +2022-06-30T14:14:35.451717+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:14:35.453464+0300 INFO Description is available (info)! +2022-06-30T14:14:35.455457+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:14:35.460445+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:14:35.461441+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:14:35.464555+0300 INFO Save to json file (info)! +2022-06-30T14:14:35.466430+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:14:35.468425+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:14:35.471416+0300 INFO Save to json file (info)! +2022-06-30T14:14:35.472415+0300 DEBUG Printer call (debug)! +2022-06-30T14:14:35.478396+0300 DEBUG Read data from json(debug)! +2022-06-30T14:14:35.485633+0300 DEBUG Data is available (debug)! +2022-06-30T14:14:35.487534+0300 INFO Print information (info)! +2022-06-30T14:14:35.494355+0300 DEBUG Json-style call (debug)! +2022-06-30T14:14:35.496648+0300 DEBUG Read data from json(debug)! +2022-06-30T14:14:35.498344+0300 INFO Print json-style information (info)! +2022-06-30T14:26:40.306919+0300 DEBUG Reader call (debug)! +2022-06-30T14:26:40.312903+0300 DEBUG Get access (debug)! +2022-06-30T14:26:40.598959+0300 DEBUG Get access (debug)! +2022-06-30T14:26:40.771652+0300 INFO Acces is available (info)! +2022-06-30T14:26:40.773647+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:26:40.774647+0300 INFO Title is available (info)! +2022-06-30T14:26:40.775644+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:26:40.777638+0300 INFO PubDate is available (info)! +2022-06-30T14:26:40.778637+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:26:40.779632+0300 INFO Link is available (info)! +2022-06-30T14:26:40.781979+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:26:40.783622+0300 INFO Description is available (info)! +2022-06-30T14:26:40.785616+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:26:40.786614+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:26:40.787613+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:26:40.789607+0300 INFO Save to json file (info)! +2022-06-30T14:26:40.791603+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:26:40.792596+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:26:40.794665+0300 INFO Save to json file (info)! +2022-06-30T14:26:40.795691+0300 DEBUG Printer call (debug)! +2022-06-30T14:26:40.796587+0300 DEBUG Read data from json(debug)! +2022-06-30T14:26:40.798583+0300 DEBUG Data is available (debug)! +2022-06-30T14:26:40.800577+0300 INFO Print information (info)! +2022-06-30T14:26:40.802663+0300 DEBUG Json-style call (debug)! +2022-06-30T14:26:40.803597+0300 DEBUG Read data from json(debug)! +2022-06-30T14:26:40.805591+0300 INFO Print json-style information (info)! +2022-06-30T14:26:46.083582+0300 DEBUG Reader call (debug)! +2022-06-30T14:26:46.090564+0300 DEBUG Get access (debug)! +2022-06-30T14:26:46.289349+0300 DEBUG Get access (debug)! +2022-06-30T14:26:46.509778+0300 INFO Acces is available (info)! +2022-06-30T14:26:46.511772+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:26:46.512770+0300 INFO Title is available (info)! +2022-06-30T14:26:46.513767+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:26:46.515762+0300 INFO PubDate is available (info)! +2022-06-30T14:26:46.516759+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:26:46.518754+0300 INFO Link is available (info)! +2022-06-30T14:26:46.519752+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:26:46.522744+0300 INFO Description is available (info)! +2022-06-30T14:26:46.524809+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:26:46.526733+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:26:46.527730+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:26:46.529725+0300 INFO Save to json file (info)! +2022-06-30T14:26:46.531719+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:26:46.533714+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:26:46.535709+0300 INFO Save to json file (info)! +2022-06-30T14:26:46.538000+0300 DEBUG Printer call (debug)! +2022-06-30T14:26:46.540695+0300 DEBUG Read data from json(debug)! +2022-06-30T14:26:46.545682+0300 DEBUG Data is available (debug)! +2022-06-30T14:26:46.548021+0300 INFO Print information (info)! +2022-06-30T14:26:46.550668+0300 DEBUG Json-style call (debug)! +2022-06-30T14:26:46.555657+0300 DEBUG Read data from json(debug)! +2022-06-30T14:26:46.563271+0300 INFO Print json-style information (info)! +2022-06-30T14:26:46.566626+0300 ERROR Error with PDF-file(error)! +2022-06-30T14:29:22.976074+0300 DEBUG Reader call (debug)! +2022-06-30T14:29:22.980788+0300 DEBUG Get access (debug)! +2022-06-30T14:29:23.209324+0300 DEBUG Get access (debug)! +2022-06-30T14:29:23.393193+0300 INFO Acces is available (info)! +2022-06-30T14:29:23.395184+0300 DEBUG Get title from xml (debug)! +2022-06-30T14:29:23.397326+0300 INFO Title is available (info)! +2022-06-30T14:29:23.398176+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T14:29:23.400171+0300 INFO PubDate is available (info)! +2022-06-30T14:29:23.401168+0300 DEBUG Get link from xml (debug)! +2022-06-30T14:29:23.409820+0300 INFO Link is available (info)! +2022-06-30T14:29:23.410824+0300 DEBUG Get description from xml (debug)! +2022-06-30T14:29:23.412819+0300 INFO Description is available (info)! +2022-06-30T14:29:23.413815+0300 DEBUG Convert to json call (debug)! +2022-06-30T14:29:23.414906+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:29:23.415809+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:29:23.417805+0300 INFO Save to json file (info)! +2022-06-30T14:29:23.419798+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T14:29:23.420798+0300 DEBUG Convert data to json (debug)! +2022-06-30T14:29:23.423132+0300 INFO Save to json file (info)! +2022-06-30T14:29:23.423790+0300 DEBUG Printer call (debug)! +2022-06-30T14:29:23.424785+0300 DEBUG Read data from json(debug)! +2022-06-30T14:29:23.426781+0300 DEBUG Data is available (debug)! +2022-06-30T14:29:23.428776+0300 INFO Print information (info)! +2022-06-30T14:29:23.430771+0300 DEBUG Json-style call (debug)! +2022-06-30T14:29:23.431768+0300 DEBUG Read data from json(debug)! +2022-06-30T14:29:23.433764+0300 INFO Print json-style information (info)! +2022-06-30T14:29:23.435756+0300 ERROR Error with HTML-file(error)! +2022-06-30T15:50:56.864827+0300 DEBUG Reader call (debug)! +2022-06-30T15:50:56.870964+0300 DEBUG Get access (debug)! +2022-06-30T15:50:57.224111+0300 DEBUG Get access (debug)! +2022-06-30T15:50:57.411757+0300 INFO Acces is available (info)! +2022-06-30T15:50:57.413751+0300 DEBUG Get title from xml (debug)! +2022-06-30T15:50:57.415746+0300 INFO Title is available (info)! +2022-06-30T15:50:57.417741+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T15:50:57.418736+0300 INFO PubDate is available (info)! +2022-06-30T15:50:57.419733+0300 DEBUG Get link from xml (debug)! +2022-06-30T15:50:57.420732+0300 INFO Link is available (info)! +2022-06-30T15:50:57.422725+0300 DEBUG Get description from xml (debug)! +2022-06-30T15:50:57.423727+0300 INFO Description is available (info)! +2022-06-30T15:50:57.425722+0300 DEBUG Convert to json call (debug)! +2022-06-30T15:50:57.426717+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T15:50:57.428710+0300 DEBUG Convert data to json (debug)! +2022-06-30T15:50:57.438834+0300 INFO Save to json file (info)! +2022-06-30T15:50:57.441825+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T15:50:57.444024+0300 DEBUG Convert data to json (debug)! +2022-06-30T15:50:57.448809+0300 INFO Save to json file (info)! +2022-06-30T15:50:57.450802+0300 DEBUG Printer call (debug)! +2022-06-30T15:50:57.452796+0300 DEBUG Read data from json(debug)! +2022-06-30T15:50:57.454908+0300 DEBUG Data is available (debug)! +2022-06-30T15:50:57.458780+0300 INFO Print information (info)! +2022-06-30T15:50:57.461771+0300 DEBUG Json-style call (debug)! +2022-06-30T15:50:57.467756+0300 DEBUG Read data from json(debug)! +2022-06-30T15:50:57.471744+0300 INFO Print json-style information (info)! +2022-06-30T16:14:35.944886+0300 DEBUG Reader call (debug)! +2022-06-30T16:14:35.950869+0300 DEBUG Get access (debug)! +2022-06-30T16:14:36.249776+0300 DEBUG Get access (debug)! +2022-06-30T16:14:36.421162+0300 INFO Acces is available (info)! +2022-06-30T16:14:36.423224+0300 DEBUG Get title from xml (debug)! +2022-06-30T16:14:36.424285+0300 INFO Title is available (info)! +2022-06-30T16:14:36.426150+0300 DEBUG Get pubDate from xml (debug)! +2022-06-30T16:14:36.427145+0300 INFO PubDate is available (info)! +2022-06-30T16:14:36.428143+0300 DEBUG Get link from xml (debug)! +2022-06-30T16:14:36.430137+0300 INFO Link is available (info)! +2022-06-30T16:14:36.431136+0300 DEBUG Get description from xml (debug)! +2022-06-30T16:14:36.433130+0300 INFO Description is available (info)! +2022-06-30T16:14:36.434128+0300 DEBUG Convert to json call (debug)! +2022-06-30T16:14:36.436121+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T16:14:36.437119+0300 DEBUG Convert data to json (debug)! +2022-06-30T16:14:36.439115+0300 INFO Save to json file (info)! +2022-06-30T16:14:36.441418+0300 DEBUG Convert data to dictionary (debug)! +2022-06-30T16:14:36.443104+0300 DEBUG Convert data to json (debug)! +2022-06-30T16:14:36.445332+0300 INFO Save to json file (info)! +2022-06-30T16:14:36.446097+0300 DEBUG Printer call (debug)! +2022-06-30T16:14:36.448090+0300 DEBUG Read data from json(debug)! +2022-06-30T16:14:36.449086+0300 DEBUG Data is available (debug)! +2022-06-30T16:14:36.452079+0300 INFO Print information (info)! +2022-06-30T16:14:36.457182+0300 DEBUG Json-style call (debug)! +2022-06-30T16:14:36.463050+0300 DEBUG Read data from json(debug)! +2022-06-30T16:14:36.470032+0300 INFO Print json-style information (info)! +2022-06-30T16:14:36.474020+0300 ERROR Error with HTML-file(error)! From 3e5e74572f6f03a357daed177d1bc9f3269353d3 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 16:51:22 +0300 Subject: [PATCH 37/52] add: requirements.txt --- requirements.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..055ff375 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,10 @@ +beautifulsoup4==4.11.1 +charset-normalizer==2.0.12 +idna==3.3 +lxml==4.9.0 +soupsieve==2.3.2.post1 +urllib3==1.26.9 +python-dateutil==2.8.2 +reportlab==3.6.10 +json2html==1.3.0 +requests==2.27.1 \ No newline at end of file From 0f39dcf497300c4a9618be46f228e6191410fba0 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 17:20:33 +0300 Subject: [PATCH 38/52] add: parser_README.md --- parser_README.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 parser_README.md diff --git a/parser_README.md b/parser_README.md new file mode 100644 index 00000000..1c03adc0 --- /dev/null +++ b/parser_README.md @@ -0,0 +1,72 @@ +RSS reader +========= + +This is RSS reader version 4.0. + +rss_reader.py is a python script intended to get RSS feed from given source URL +and write its content to standart output also it's can convert content to .json and .html files. + + +To use this script you should install all required packages from requirements.txt +```shell +pip install {name of package} +``` + + + +How to execute after installation +------ + +Specifying the script file. Run from directory with rss_reader.py file the following command + + +Windows +```shell +python rss_reader.py ... +``` + +Linux +```bash + +python3 rss_reader.py ... +``` + +Command line format +------- + + usage: rss_reader.py [-h] [-v] [--json] [--verbose] [--limit LIMIT] [--date DATE] [--to-html ] + source + + Pure Python command-line RSS reader. + + positional arguments: + source RSS URL + + optional arguments: + -h, --help show this help message and exit + --version Print version info + --json Print result as JSON + --verbose Outputs verbose status messages. Prints logs. + --limit LIMIT Limit news topics. If it's not specified, then you get all available feed. + + --date DATE It should take a date in Ymd format.The new from the specified day will be printed out. + --html It convert data to HTML-format in file output.html. + +JSON representation +------- + +```json +{ + "name": Name of the feed, + "size": Number of available news, + "title": [Names of available news], + "pubDate": [Dates of publication news], + "description": [Summary description], + "link": [Link of source] +} +``` + +Cache storage format +------ + +News cache is stored in file data.json in current working directory. From c7b9c51e2b235263befa4eb09d4fce5c9d7f8bf8 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 17:21:44 +0300 Subject: [PATCH 39/52] fix: execute --- parser_README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser_README.md b/parser_README.md index 1c03adc0..a3f912bf 100644 --- a/parser_README.md +++ b/parser_README.md @@ -34,7 +34,7 @@ python3 rss_reader.py ... Command line format ------- - usage: rss_reader.py [-h] [-v] [--json] [--verbose] [--limit LIMIT] [--date DATE] [--to-html ] + usage: python rss_reader.py [-h] [-v] [--json] [--verbose] [--limit LIMIT] [--date DATE] [--to-html ] source Pure Python command-line RSS reader. From e295941e7163c02d40ebb6b1822de0f05b561633 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 17:31:02 +0300 Subject: [PATCH 40/52] fix: Console representation --- parser_README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/parser_README.md b/parser_README.md index a3f912bf..7b9c0eb0 100644 --- a/parser_README.md +++ b/parser_README.md @@ -49,9 +49,29 @@ Command line format --verbose Outputs verbose status messages. Prints logs. --limit LIMIT Limit news topics. If it's not specified, then you get all available feed. - --date DATE It should take a date in Ymd format.The new from the specified day will be printed out. + --date DATE It should take a date in %Y%m%d format.The new from the specified day will be printed out. --html It convert data to HTML-format in file output.html. +Сonsole representation +------- + +```json +Name of the feed +Title from news +PubDate + +Summary description + +Source link + +------------ +Title from news +PubDate +... +..... + + +``` JSON representation ------- From bb587bec25e7d7898d4de6070dc2c2760dd73042 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:25:54 +0300 Subject: [PATCH 41/52] fix: Command exampke --- parser_README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/parser_README.md b/parser_README.md index 7b9c0eb0..c741736f 100644 --- a/parser_README.md +++ b/parser_README.md @@ -90,3 +90,20 @@ Cache storage format ------ News cache is stored in file data.json in current working directory. + + +Command example +------ + + +```shell +python rss_reader.py "https://www.onliner.by/feed" --limit 1 --html + +python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 2 --json --verbose + +python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 3 + +python rss_reader.py "https://feeds.fireside.fm/bibleinayear/rss" --limit 3 --verbose + +python rss_reader.py --date 20220620 +``` \ No newline at end of file From 33540337e29311696768d572eec753d9d6960230 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:26:49 +0300 Subject: [PATCH 42/52] add: test Reader Converter Printer --- test.py | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 00000000..c1b03022 --- /dev/null +++ b/test.py @@ -0,0 +1,62 @@ +import unittest + +from reader import Reader +from converter import Converter +from printer import Printer + + +class TestReader(unittest.TestCase): + + def setUp(self): + self.reader1 = Reader("https://www.onliner.by/feed", 1) + self.reader2 = Reader("https://www.onliner.by/feed", 2) + + def test_get_acces(self): + self.assertEqual(type(self.reader1.get_title()), list) + + def test_get_title(self): + self.assertEqual(len(self.reader1.get_title()), 1) + + def test_get_pubDate(self): + self.assertEqual(len(self.reader2.get_pubDate()), 2) + + def test_get_link(self): + self.assertEqual(len(self.reader2.get_pubDate()), 2) + + def test_get_descriprion(self): + self.assertEqual(len(self.reader1.get_pubDate()), 1) + + def test_get_acces(self): + self.assertEqual(type(self.reader1.get_title()), list) + + +class TestConverter(unittest.TestCase): + def setUp(self): + self.converter1 = Converter(Reader("https://feeds.fireside.fm/bibleinayear/rss", 3)) + self.converter2 = Converter() + + def test_to_dict(self): + self.assertEqual(len(self.converter1.to_dict()), 6) + + def test_from_json(self): + self.assertEqual(len(self.converter1.from_json()), 6) + + def test_from_json2(self): + self.assertEqual(type(self.converter2.from_json()), dict) + + def test_to_HTML(self): + self.assertEqual(self.converter1.to_HTML(), True) + + +class TestPrinter(unittest.TestCase): + def setUp(self): + self.converter1 = Converter(Reader("https://feeds.fireside.fm/bibleinayear/rss", 3)) + self.printer = Printer(self.converter1.from_json()) + + def test_print(self): + print(self.printer) + + +if __name__ == "__main__": + unittest.main() + From 60d46e224ff4f7d75836328157bea147ba1ec195 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:27:55 +0300 Subject: [PATCH 43/52] add: unsuccessful setup. maybe you can tell me how to fix it? :c --- setup.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..51d89817 --- /dev/null +++ b/setup.py @@ -0,0 +1,30 @@ +import os +from setuptools import find_packages, setup + + +def read(file_name): + with open(os.path.join(os.path.dirname(__file__), file_name)) as file: + return file.read() +setup( + name="rss_reader", + version="4.0", + author="Maya Voyshnis", + author_email="vvvoyshnism@gmail.com", + description='Python RSS Parser', + # long_description=open('README.txt').read(), + packages=find_packages(), + install_requires=[ + "wheel", + "setuptools", + "argparse", + "requests", + "beautifulsoup4", + "python-dateutil", + "loguru" + ], + entry_points={ + 'console_scripts': [ + 'rss_reader=rss_reader.main:main' + ], + } +) From fa5e6ae1ff3acaafb15bf390086477c609c285f1 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:31:25 +0300 Subject: [PATCH 44/52] fix: utf-8 --- rss_reader.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/rss_reader.py b/rss_reader.py index 8b2dd13f..0addbddb 100644 --- a/rss_reader.py +++ b/rss_reader.py @@ -116,15 +116,3 @@ def main(): logger.error(f"Unexpected error (error)!") print(f"Unexpected error") raise sys.exit() - -# python f.py "https://www.onliner.by/feed" --limit 1 + -# python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 2 --json --verbose - -# python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 3 -# python rss_reader.py "https://feeds.fireside.fm/bibleinayear/rss" --limit 3 + -# python rss_reader.py "https://feeds.simplecast.com/qm_9xx0g" --limit 1 + - - -# python rss_reader.py "https://realpython.com/atom.xml" --limit 3 -# python rss_reader.py --date 20220620 -# python rss_reader.py --json \ No newline at end of file From 73784d7bb0449f90c7724ddb65a38614bc2ae50a Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:31:45 +0300 Subject: [PATCH 45/52] fix: utf-8 --- reader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/reader.py b/reader.py index 5e218a5d..fb61345a 100644 --- a/reader.py +++ b/reader.py @@ -51,6 +51,7 @@ def get_title(self) -> list: def get_pubDate(self) -> list: logger.debug("Get pubDate from xml (debug)!") + print([self.items[i].pubDate.text for i in range(self.limit)]) return [self.items[i].pubDate.text for i in range(self.limit)] def get_link(self) -> list: From 95cde962209433413dc412d7a326a66eb1903ff8 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 20:33:45 +0300 Subject: [PATCH 46/52] add: additional files --- .idea/.gitignore | 3 +++ .idea/HomeTask.iml | 8 ++++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ 6 files changed, 35 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/HomeTask.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/HomeTask.iml b/.idea/HomeTask.iml new file mode 100644 index 00000000..8437fe66 --- /dev/null +++ b/.idea/HomeTask.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 00000000..105ce2da --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..dc9ea490 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..ac775c34 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 1cb1a81a03517063afb1638adf82b3c2c43e54e4 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 21:02:37 +0300 Subject: [PATCH 47/52] add: utf-8 --- Final_Task.md | 76 ++++++++++++++++++++++++++------------------------- converter.py | 1 + final_task.py | 0 3 files changed, 40 insertions(+), 37 deletions(-) delete mode 100644 final_task.py diff --git a/Final_Task.md b/Final_Task.md index 2e2e618a..71b0025a 100644 --- a/Final_Task.md +++ b/Final_Task.md @@ -4,20 +4,21 @@ You are proposed to implement Python RSS-reader using **python 3.9**. The task consists of few iterations. Do not start new iteration if the previous one is not implemented yet. ## Common requirements. -* It is mandatory to use `argparse` module. -* Codebase must be covered with unit tests with at least 50% coverage. It's a mandatory requirement. -* Yor script should **not** require installation of other services such as mysql server, +* ✅It is mandatory to use `argparse` module. +* ❗Codebase must be covered with unit tests with at least 50% coverage. It's a mandatory requirement. +* ✅Yor script should **not** require installation of other services such as mysql server, postgresql and etc. (except Iteration 6). If it does require such programs, they should be installed automatically by your script, without user doing anything. -* In case of any mistakes utility should print human-readable. +* ✅In case of any mistakes utility should print human-readable. error explanation. Exception tracebacks in stdout are prohibited in final version of application. -* Docstrings are mandatory for all methods, classes, functions and modules. -* Code must correspond to `pep8` (use `pycodestyle` utility for self-check). +*✅Docstrings are mandatory for all methods, classes, functions and modules. +*✅ Code must correspond to `pep8` (use `pycodestyle` utility for self-check). * You can set line length up to 120 symbols. -* Commit messages should provide correct and helpful information about changes in commit. Messages like `Fix bug`, + +*✅ Commit messages should provide correct and helpful information about changes in commit. Messages like `Fix bug`, `Tried to make workable`, `Temp commit` and `Finally works` are prohibited. -* All used third-party packages should be written in the `requirements.txt` file and in installation files (`setup.py`, `setup.cfg`, etc.). -* You have to write a file with documentation. Everything must be documented: how to run scripts, how to run tests, how to install the library and etc. +* ✅All used third-party packages should be written in the `requirements.txt` file and in installation files (`setup.py`, `setup.cfg`, etc.). +* ✅You have to write a file with documentation. Everything must be documented: how to run scripts, how to run tests, how to install the library and etc. ## [Iteration 1] One-shot command-line RSS reader. RSS reader should be a command-line utility which receives [RSS](wikipedia.org/wiki/RSS) URL and prints results in human-readable format. @@ -27,19 +28,19 @@ You are free to choose format of the news console output. The textbox below prov ```shell $ rss_reader.py "https://news.yahoo.com/rss/" --limit 1 -Feed: Yahoo News - Latest News & Headlines +✅Feed: Yahoo News - Latest News & Headlines -Title: Nestor heads into Georgia after tornados damage Florida -Date: Sun, 20 Oct 2019 04:21:44 +0300 -Link: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html +✅Title: Nestor heads into Georgia after tornados damage Florida +✅Date: Sun, 20 Oct 2019 04:21:44 +0300 +✅Link: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html -[image 2: Nestor heads into Georgia after tornados damage Florida][2]Nestor raced across Georgia as a post-tropical cyclone late Saturday, hours after the former tropical storm spawned a tornado that damaged +✅[image 2: Nestor heads into Georgia after tornados damage Florida][2]Nestor raced across Georgia as a post-tropical cyclone late Saturday, hours after the former tropical storm spawned a tornado that damaged homes and a school in central Florida while sparing areas of the Florida Panhandle devastated one year earlier by Hurricane Michael. The storm made landfall Saturday on St. Vincent Island, a nature preserve off Florida's northern Gulf Coast in a lightly populated area of the state, the National Hurricane Center said. Nestor was expected to bring 1 to 3 inches of rain to drought-stricken inland areas on its march across a swath of the U.S. Southeast. -Links: +❗Links: [1]: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html (link) [2]: http://l2.yimg.com/uu/api/res/1.2/Liyq2kH4HqlYHaS5BmZWpw--/YXBwaWQ9eXRhY2h5b247aD04Njt3PTEzMDs-/https://media.zenfs.com/en/ap.org/5ecc06358726cabef94585f99050f4f0 (image) @@ -52,10 +53,10 @@ usage: rss_reader.py [-h] [--version] [--json] [--verbose] [--limit LIMIT] Pure Python command-line RSS reader. -positional arguments: +✅positional arguments: source RSS URL -optional arguments: +✅optional arguments: -h, --help show this help message and exit --version Print version info --json Print result as JSON in stdout @@ -64,32 +65,32 @@ optional arguments: ``` -In case of using `--json` argument your utility should convert the news into [JSON](https://en.wikipedia.org/wiki/JSON) format. +✅In case of using `--json` argument your utility should convert the news into [JSON](https://en.wikipedia.org/wiki/JSON) format. You should come up with the JSON structure on you own and describe it in the README.md file for your repository or in a separate documentation file. -With the argument `--verbose` your program should print all logs in stdout. +✅With the argument `--verbose` your program should print all logs in stdout. ### Task clarification (I) -1) If `--version` option is specified app should _just print its version_ and stop. -2) User should be able to use `--version` option without specifying RSS URL. For example: +✅1) If `--version` option is specified app should _just print its version_ and stop. +✅2) User should be able to use `--version` option without specifying RSS URL. For example: ``` > python rss_reader.py --version "Version 1.4" ``` 3) The version is supposed to change with every iteration. -4) If `--limit` is not specified, then user should get _all_ available feed. -5) If `--limit` is larger than feed size then user should get _all_ available news. -6) `--verbose` should print logs _in the process_ of application running, _not after everything is done_. -7) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout_. -8) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout in JSON format_. +✅4) If `--limit` is not specified, then user should get _all_ available feed. +✅5) If `--limit` is larger than feed size then user should get _all_ available news. +✅6) `--verbose` should print logs _in the process_ of application running, _not after everything is done_. +✅7) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout_. +✅8) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout in JSON format_. 9) It is preferrable to have different custom exceptions for different situations(If needed). -10) The `--limit` argument should also affect JSON generation. +✅10) The `--limit` argument should also affect JSON generation. -## [Iteration 2] Distribution. +## ❗[Iteration 2] Distribution. * Utility should be wrapped into distribution package with `setuptools`. * This package should export CLI utility named `rss-reader`. @@ -114,23 +115,23 @@ as well as this: ## [Iteration 3] News caching. -The RSS news should be stored in a local storage while reading. The way and format of this storage you can choose yourself. -Please describe it in a separate section of README.md or in the documentation. +✅The RSS news should be stored in a local storage while reading. The way and format of this storage you can choose yourself. +❗Please describe it in a separate section of README.md or in the documentation. New optional argument `--date` must be added to your utility. It should take a date in `%Y%m%d` format. For example: `--date 20191020` Here date means actual *publishing date* not the date when you fetched the news. -The cashed news can be read with it. The new from the specified day will be printed out. +✅The cashed news can be read with it. The new from the specified day will be printed out. If the news are not found return an error. -If the `--date` argument is not provided, the utility should work like in the previous iterations. +✅If the `--date` argument is not provided, the utility should work like in the previous iterations. ### Task clarification (III) -1) Try to make your application crossplatform, meaning that it should work on both Linux and Windows. +❗1) Try to make your application crossplatform, meaning that it should work on both Linux and Windows. For example when working with filesystem, try to use `os.path` lib instead of manually concatenating file paths. -2) `--date` should **not** require internet connection to fetch news from local cache. -3) User should be able to use `--date` without specifying RSS source. For example: +✅2) `--date` should **not** require internet connection to fetch news from local cache. +✅3) User should be able to use `--date` without specifying RSS source. For example: ``` > python rss_reader.py --date 20191206 ...... @@ -140,8 +141,9 @@ Or for second iteration (when installed using setuptools): > rss_reader --date 20191206 ...... ``` -4) If `--date` specified _together with RSS source_, then app should get news _for this date_ from local cache that _were fetched from specified source_. -5) `--date` should work correctly with both `--json`, `--limit`, `--verbose` and their different combinations. +❗4) If `--date` specified _together with RSS source_, then app should get news _for this date_ from local cache that _were fetched from specified source_. + +✅5) `--date` should work correctly with both `--json`, `--limit`, `--verbose` and their different combinations. ## [Iteration 4] Format converter. diff --git a/converter.py b/converter.py index 080c549b..8ce589dd 100644 --- a/converter.py +++ b/converter.py @@ -46,3 +46,4 @@ def to_HTML(self): with open(htmlReportFile, 'w') as htmlfile: htmlfile.write(str(scanOutput)) print("Data save in output.html") + return True diff --git a/final_task.py b/final_task.py deleted file mode 100644 index e69de29b..00000000 From 2893ee5770f31f073363dad9b0a862e7af688547 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 21:11:01 +0300 Subject: [PATCH 48/52] update --- data.json | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/data.json b/data.json index 4060f166..915a42bf 100644 --- a/data.json +++ b/data.json @@ -1,16 +1,24 @@ { "name": "BuzzFeed - Quizzes", - "size": 1, + "size": 3, "title": [ - "Pick Lots Of Dogs And I Bet You That I Won't Get Your Eye Color Right" + "Okay, But For Real \u2014 Do These Celebs Deserve More Or Less Time In The Limelight?", + "Roll Up A Suuuper Fat Burrito To Reveal The Musical Instrument You Were Born To Play", + "Order Off The Kids Menu And We'll Tell You How Many Children You're Gonna Have" ], "pubDate": [ - "Sun, 26 Jun 2022 00:40:18 -0400" + "Wed, 29 Jun 2022 23:46:02 -0400", + "Mon, 27 Jun 2022 21:32:03 -0400", + "Wed, 29 Jun 2022 15:16:58 -0400" ], "description": [ - "I WANT to get it wrong...View Entire Post ;" + "When I see certain celebrity names trending on Twitter, my fight or flight kicks in. \ud83d\udc40View Entire Post ;", + "I personally wouldn't mind tickling some ivories...View Entire Post ;", + "Happy Meals still slap.View Entire Post ;" ], "link": [ - "https://www.buzzfeed.com/turtleo/dog-eye-color-guessing-quiz" + "https://www.buzzfeed.com/hannahdobro/celebrities-in-the-news-poll", + "https://www.buzzfeed.com/benjaminyp/your-burrito-reveals-the-instrument-you-should-play", + "https://www.buzzfeed.com/blackwidow888/kids-menu-number-of-kids-quiz" ] } \ No newline at end of file From 651ee04bab7826791d67467e8253f027b2a81af1 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 21:15:47 +0300 Subject: [PATCH 49/52] delete --- README.md | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index c86d1e65..00000000 --- a/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# How to create a PR with a homework task - -1. Create fork from the following repo: https://github.com/E-P-T/Homework. (Docs: https://docs.github.com/en/get-started/quickstart/fork-a-repo ) -2. Clone your forked repo in your local folder. -3. Create separate branches for each session.Example(`session_2`, `session_3` and so on) -4. Create folder with you First and Last name in you forked repo in the created session. -5. Add your task into created folder -6. Push finished session task in the appropriate branch in accordance with written above. - You should get the structure that looks something like that - -``` - Branch: Session_2 - DzmitryKolb - |___Task1.py - |___Task2.py - Branch: Session_3 - DzmitryKolb - |___Task1.py - |___Task2.py -``` - -7. When you finish your work on task you should create Pull request to the appropriate branch of the main repo https://github.com/E-P-T/Homework (Docs: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork). -Please use the following instructions to prepare good description of the pull request: - - Pull request header should be: `Session - `. - Example: `Session 2 - Dzmitry Kolb` - - Pull request body: You should write here what tasks were implemented. - Example: `Finished: Task 1.2, Task 1.3, Task 1.6` - From a096286c4fc9d7fcc92ea1880407c0e986028e6f Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 21:31:13 +0300 Subject: [PATCH 50/52] rename: parserREADME to README --- README.md | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..01813e26 --- /dev/null +++ b/README.md @@ -0,0 +1,109 @@ +RSS reader +========= + +This is RSS reader version 4.0. + +rss_reader.py is a python script intended to get RSS feed from given source URL +and write its content to standart output also it's can convert content to .json and .html files. + + +To use this script you should install all required packages from requirements.txt +```shell +pip install {name of package} +``` + + + +How to execute after installation +------ + +Specifying the script file. Run from directory with rss_reader.py file the following command + + +Windows +```shell +python rss_reader.py ... +``` + +Linux +```bash + +python3 rss_reader.py ... +``` + +Command line format +------- + + usage: python rss_reader.py [-h] [-v] [--json] [--verbose] [--limit LIMIT] [--date DATE] [--to-html ] + source + + Pure Python command-line RSS reader. + + positional arguments: + source RSS URL + + optional arguments: + -h, --help show this help message and exit + --version Print version info + --json Print result as JSON + --verbose Outputs verbose status messages. Prints logs. + --limit LIMIT Limit news topics. If it's not specified, then you get all available feed. + + --date DATE It should take a date in %Y%m%d format.The new from the specified day will be printed out. + --html It convert data to HTML-format in file output.html. + +Сonsole representation +------- + +```json +Name of the feed +Title from news +PubDate + +Summary description + +Source link + +------------ +Title from news +PubDate +... +..... + + +``` +JSON representation +------- + +```json +{ + "name": Name of the feed, + "size": Number of available news, + "title": [Names of available news], + "pubDate": [Dates of publication news], + "description": [Summary description], + "link": [Link of source] +} +``` + +Cache storage format +------ + +News cache is stored in file data.json in current working directory. + + +Command example +------ + + +```shell +python rss_reader.py "https://www.onliner.by/feed" --limit 1 --html + +python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 2 --json --verbose + +python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 3 + +python rss_reader.py "https://feeds.fireside.fm/bibleinayear/rss" --limit 3 --verbose + +python rss_reader.py --date 20220620 +``` \ No newline at end of file From bf75d2a6a73a1f74a189012b7d8aad62fa82da01 Mon Sep 17 00:00:00 2001 From: fcumay Date: Thu, 30 Jun 2022 21:33:45 +0300 Subject: [PATCH 51/52] delete: trash from past session --- .idea/HomeTask.iml | 9 +- custom.py | 6 - data.json | 20 +- data/lorem_ipsum.txt | 19 - data/students.csv | 1001 --------------------------------------- data/unsorted_names.txt | 199 -------- modules/legb.py | 10 - modules/mod_a.py | 8 - modules/mod_b.py | 4 - modules/mod_c.py | 1 - names.txt | 1 - output.html | 2 +- package/__init__.py | 4 - package/__main__.py | 20 - package/skill_c.py | 2 - package/skill_linux.py | 2 - package/skill_nim.py | 2 - package/skill_python.py | 2 - package2/__init__.py | 0 package2/__main__.py | 12 - package2/skill_java.py | 2 - parser_README.md | 109 ----- sh.txt | 41 -- storage.data | Bin 51 -> 0 bytes 24 files changed, 11 insertions(+), 1465 deletions(-) delete mode 100644 custom.py delete mode 100644 data/lorem_ipsum.txt delete mode 100644 data/students.csv delete mode 100644 data/unsorted_names.txt delete mode 100644 modules/legb.py delete mode 100644 modules/mod_a.py delete mode 100644 modules/mod_b.py delete mode 100644 modules/mod_c.py delete mode 100644 names.txt delete mode 100644 package/__init__.py delete mode 100644 package/__main__.py delete mode 100644 package/skill_c.py delete mode 100644 package/skill_linux.py delete mode 100644 package/skill_nim.py delete mode 100644 package/skill_python.py delete mode 100644 package2/__init__.py delete mode 100644 package2/__main__.py delete mode 100644 package2/skill_java.py delete mode 100644 parser_README.md delete mode 100644 sh.txt delete mode 100644 storage.data diff --git a/.idea/HomeTask.iml b/.idea/HomeTask.iml index 8437fe66..ec63674c 100644 --- a/.idea/HomeTask.iml +++ b/.idea/HomeTask.iml @@ -1,8 +1,7 @@ - - - - - + + + \ No newline at end of file diff --git a/custom.py b/custom.py deleted file mode 100644 index d322fe97..00000000 --- a/custom.py +++ /dev/null @@ -1,6 +0,0 @@ -def say_hello(name): - print(f'Hello! I\'m {name}') - - -def say_bye(): - print('Hasta la vista, baby') diff --git a/data.json b/data.json index 915a42bf..f1067a87 100644 --- a/data.json +++ b/data.json @@ -1,24 +1,16 @@ { - "name": "BuzzFeed - Quizzes", - "size": 3, + "name": "Onliner", + "size": 1, "title": [ - "Okay, But For Real \u2014 Do These Celebs Deserve More Or Less Time In The Limelight?", - "Roll Up A Suuuper Fat Burrito To Reveal The Musical Instrument You Were Born To Play", - "Order Off The Kids Menu And We'll Tell You How Many Children You're Gonna Have" + "\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u044c \u0441 1 \u0438\u044e\u043b\u044f \u0432\u0432\u043e\u0434\u0438\u0442 \u0431\u0435\u0437\u0432\u0438\u0437\u043e\u0432\u044b\u0439 \u0432\u044a\u0435\u0437\u0434 \u0434\u043b\u044f \u0433\u0440\u0430\u0436\u0434\u0430\u043d \u041f\u043e\u043b\u044c\u0448\u0438" ], "pubDate": [ - "Wed, 29 Jun 2022 23:46:02 -0400", - "Mon, 27 Jun 2022 21:32:03 -0400", - "Wed, 29 Jun 2022 15:16:58 -0400" + "Thu, 30 Jun 2022 19:26:28 +0300" ], "description": [ - "When I see certain celebrity names trending on Twitter, my fight or flight kicks in. \ud83d\udc40View Entire Post ;", - "I personally wouldn't mind tickling some ivories...View Entire Post ;", - "Happy Meals still slap.View Entire Post ;" + "\u0421 1 \u0438\u044e\u043b\u044f \u043f\u043e 31 \u0434\u0435\u043a\u0430\u0431\u0440\u044f \u0411\u0435\u043b\u0430\u0440\u0443\u0441\u044c \u0432\u0432\u043e\u0434\u0438\u0442 \u0431\u0435\u0437\u0432\u0438\u0437\u043e\u0432\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0434\u043b\u044f \u0433\u0440\u0430\u0436\u0434\u0430\u043d \u041f\u043e\u043b\u044c\u0448\u0438. \u041e\u0431 \u044d\u0442\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0432\u00a0\u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b\u0435 \u041f\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u0438\u0442\u0435\u0442\u0430.\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435\u2026" ], "link": [ - "https://www.buzzfeed.com/hannahdobro/celebrities-in-the-news-poll", - "https://www.buzzfeed.com/benjaminyp/your-burrito-reveals-the-instrument-you-should-play", - "https://www.buzzfeed.com/blackwidow888/kids-menu-number-of-kids-quiz" + "https://people.onliner.by/2022/06/30/belarus-s-1-iyulya-vvodit-bezvizovyj-vezd-dlya-grazhdan-polshi" ] } \ No newline at end of file diff --git a/data/lorem_ipsum.txt b/data/lorem_ipsum.txt deleted file mode 100644 index 3c572faf..00000000 --- a/data/lorem_ipsum.txt +++ /dev/null @@ -1,19 +0,0 @@ -Lorem ipsum suspendisse nostra ullamcorper diam donec etiam nulla sagittis est aliquam, dictum aliquet luctus risus est habitant suspendisse luctus id inceptos lectus, aenean donec maecenas donec aenean fringilla vitae fermentum venenatis enim ultrices per etiam ut aenean odio. - -Habitasse ad sollicitudin arcu senectus enim etiam platea quisque purus odio sociosqu maecenas habitant, quisque laoreet himenaeos elementum consequat auctor ad dictum viverra donec faucibus enim scelerisque eu sodales vel lobortis euismod cubilia, dictum ut consectetur nisi litora ut, blandit vehicula sapien et fames tempor congue tristique urna inceptos neque suspendisse felis venenatis cras metus risus tellus nulla imperdiet maecenas potenti vestibulum id aliquam himenaeos a primis tortor, facilisis ullamcorper donec augue integer euismod habitasse orci vestibulum convallis. - -Augue eget primis sit iaculis placerat viverra conubia class consectetur porttitor luctus aenean, dui hac quis eros vivamus praesent taciti arcu nullam semper ullamcorper, maecenas turpis quis metus fringilla aptent et etiam rutrum viverra integer orci fermentum lacinia risus purus rhoncus torquent aenean augue felis ultricies, donec luctus dui eros pulvinar primis bibendum accumsan purus donec pharetra, eleifend varius lorem fames at viverra praesent justo lectus. - -Ligula tincidunt ultrices et lobortis ultrices mollis quisque egestas bibendum, etiam maecenas consectetur quam non ornare dictum donec nullam, platea aliquet duis aenean cras placerat aliquam integer venenatis interdum gravida est massa faucibus porta arcu, velit urna cursus laoreet vulputate dictumst hendrerit ornare, torquent ultricies metus sed turpis scelerisque suspendisse vulputate cubilia gravida suspendisse neque consequat laoreet, odio faucibus vestibulum cras cursus urna tincidunt, euismod nulla auctor eu diam habitant. - -Faucibus maecenas dapibus hendrerit conubia maecenas eros tempus molestie tincidunt dolor, lacinia himenaeos etiam duis nec felis hac interdum malesuada pharetra praesent, nostra ut donec non id tempus at ultricies sodales dapibus id per magna erat justo phasellus, lorem tellus neque enim quam vivamus, congue ad leo iaculis libero blandit eros interdum nullam rhoncus porta aliquam tristique fringilla, faucibus augue elit quis auctor volutpat imperdiet curabitur, tortor pellentesque vehicula fames venenatis aliquam cursus. - -At volutpat himenaeos eleifend mollis nunc per leo diam per leo mollis, sagittis etiam tortor arcu suscipit egestas et ullamcorper mollis commodo at ornare at ante sociosqu sed in, elementum primis curae enim suspendisse volutpat condimentum, id in ad eu maecenas aliquam proin erat magna vivamus fermentum blandit nec faucibus, viverra torquent massa tortor adipiscing ad consectetur interdum aptent, magna accumsan egestas magna ut iaculis est. - -Dictum aenean integer interdum sed potenti tincidunt sem aptent, gravida nunc malesuada bibendum class quam taciti duis a, ipsum orci proin mollis lorem in himenaeos. - -Sed tincidunt lectus ad pharetra vel proin massa aliquam molestie, lectus vel primis facilisis aliquam lacinia ultricies fames feugiat, eleifend tempus sodales volutpat congue dolor primis pulvinar tellus lorem risus porttitor morbi vivamus turpis scelerisque habitant cursus, vivamus morbi quisque class eget aliquet suspendisse laoreet faucibus, pulvinar vulputate at cursus morbi ac euismod lectus aenean potenti pellentesque conubia etiam porttitor tincidunt quisque adipiscing laoreet lobortis nulla sociosqu lobortis consectetur lobortis iaculis ad blandit donec sapien in vehicula tellus est vivamus taciti ultrices fermentum viverra turpis volutpat ligula. - -Vehicula nullam hac lacinia nunc pulvinar nullam quam leo proin, in tristique donec pretium vestibulum consectetur pulvinar bibendum egestas, pharetra habitasse class vitae quisque phasellus turpis non eleifend arcu ultricies blandit curabitur venenatis rutrum vivamus a, primis urna viverra accumsan tristique mi vulputate. - -Netus enim eros sed duis nostra vestibulum nulla, urna eleifend curabitur lobortis aliquet cursus himenaeos primis, quam pharetra cursus urna quisque a ipsum nibh dapibus diam ante proin convallis venenatis accumsan lorem est tortor inceptos lacinia vestibulum lobortis metus praesent leo eget in ante volutpat consectetur diam. \ No newline at end of file diff --git a/data/students.csv b/data/students.csv deleted file mode 100644 index ee7209a3..00000000 --- a/data/students.csv +++ /dev/null @@ -1,1001 +0,0 @@ -student name,age,average mark -Willie Gray,22,8.6 -Phyllis Deloach,25,6.09 -Dewey Killingsworth,20,9.31 -Patricia Daniels,29,8.39 -Anne Mandrell,19,9.63 -Verdell Crawford,30,8.86 -Mario Lilley,24,5.78 -Francisco Jones,25,9.01 -Donald Laurent,29,4.34 -Denise Via,27,8.11 -Scott Lange,19,6.65 -Brenda Silva,30,7.53 -James Ross,29,6.72 -Kimberly Brown,18,7.05 -Heather Winnike,25,4.25 -Benjamin Getty,25,7.85 -Linda Crider,26,9.52 -Garrett Mitchell,18,4.01 -Thomas Roberts,28,5.28 -Pauline Montoya,29,9.09 -Georgia Wilson,27,6.52 -Roberta Kelly,23,8.09 -Johnny Jennings,22,7.54 -Sherry Grant,28,4.43 -Andrew Schmidt,29,7.55 -Carole Tewani,20,6.49 -Linda Miller,23,6.79 -Mary Glasser,30,9.77 -Ruby Greig,21,7.59 -Rosie Watkins,26,4.08 -Wilma Dominguez,26,6.94 -Daniel Youd,20,9.67 -Tamara Harris,24,9.92 -Arnoldo Ewert,24,9.54 -John Velazquez,18,8.5 -Audrey Camille,30,4.15 -Helen Klein,18,6.5 -Eric Ruegg,22,8.48 -Vera Charles,22,5.81 -Annie Sudbeck,28,9.85 -Michael Clark,20,5.8 -Rosa Thomas,30,4.17 -Daisy Granados,22,4.12 -Betty Mabry,18,5.74 -Bertha Gary,26,8.26 -Vickie Laigo,21,8.89 -Richard Grant,24,9.07 -Linda Harrison,27,9.96 -Phyllis Cole,18,5.31 -Devin Spencer,25,7.79 -George Guest,28,9.94 -Kim Pyles,30,9.87 -Kristin Dean,18,9.75 -Clarence Cantu,21,9.19 -Kenneth Evans,21,4.86 -Frank Borgeson,24,9.65 -Richard Grossman,24,8.42 -Ann White,29,4.26 -Virginia Harris,22,9.29 -Maria Benear,28,9.12 -George Leno,30,9.47 -Richard Hamrick,21,8.86 -Tony Engel,21,9.61 -Scott Miller,25,8.95 -Bridget Cotter,29,7.8 -Terry Major,30,8.45 -Maria Boswell,29,8.39 -Ronald Oliver,27,4.15 -Delilah Howard,20,5.64 -Jose Paul,22,5.41 -Francisco Miller,26,8.81 -Josephine Perkins,25,9.58 -Gerald Murray,28,7.04 -Randy Hord,21,8.42 -Janee Bailey,22,6.79 -Martha Pitcher,30,7.6 -Renee Pagan,24,4.62 -Kenneth Rummel,28,6.6 -Doretha Ferguson,30,8.18 -Donald Luevano,24,5.15 -Valerie Mondragon,27,9.54 -Gladys Gomez,19,6.36 -Christin Cross,22,4.4 -Robert Birmingham,22,5.73 -Willie Eskridge,27,6.52 -Josephina Medina,23,10.0 -Burl Navarro,27,7.61 -Lila Hill,29,9.83 -David Roberts,20,9.41 -Travis Rhyne,23,8.16 -Robert Kirkland,21,4.99 -John Torres,24,8.33 -Cindy Nilson,23,8.16 -Steven Lawson,21,4.37 -Sylvia Kuhn,23,8.91 -Richard Crawford,28,7.76 -Fred Maestas,28,5.83 -Janie Waterman,22,8.49 -Paula Morales,28,7.51 -Lawrence Bentson,27,8.47 -Hattie Bramer,18,9.71 -Cynthia Beegle,20,5.79 -Sarah Martindale,26,7.16 -Shawn Bonifacio,26,6.26 -Lena Weston,29,8.01 -Joyce Beatty,23,9.65 -Juan Dunn,22,8.26 -Barry Mckenzie,20,9.63 -Joyce Foley,18,6.57 -Doris Kuck,21,5.73 -Kim Cohran,21,5.0 -Robert Martin,25,7.14 -George Jackson,25,9.67 -David Hayden,19,7.08 -David Barnas,20,4.7 -Amada Duncan,30,9.22 -Kathryn Harryman,28,6.82 -Janette Law,26,7.02 -Tonja Bull,21,5.36 -Alissa Belyoussian,25,6.54 -Lou Bible,26,8.37 -Marc Bibbs,18,6.26 -Arthur Kuhl,18,6.48 -Martha Woods,23,6.83 -Jeffrey Petty,20,6.36 -Harry Dampeer,21,7.81 -Wesley Wolf,18,9.2 -Elizabeth Lowe,28,7.42 -Marvin Silvas,26,6.27 -Donald Hardnett,19,7.21 -Michael Mcdonald,27,9.36 -Edna Mahoney,23,5.24 -Deborah Penn,18,7.98 -Ethel Disher,22,4.28 -Michael Jackson,23,4.31 -Kevin Houston,19,6.53 -Margaret Branstetter,28,6.57 -Billy Henry,27,7.35 -Christopher Mcintire,25,8.54 -Amy Martin,21,7.13 -Stephanie Grose,27,5.11 -Deanna Kathan,30,8.9 -Ann Arteaga,26,8.33 -David Goins,29,6.27 -Paul Alexander,21,5.24 -Robert Parker,18,8.88 -Patricia York,27,6.87 -Donna Baker,21,4.17 -Carla Morris,21,5.92 -John Hubbard,27,6.59 -Oscar Linahan,28,4.68 -David Cain,30,6.75 -Cindy Oconnor,22,4.74 -Nicholas Richter,20,6.46 -Faye Roberge,18,8.49 -Jessica Keenan,21,9.9 -Rebecca Garcia,22,4.22 -Esther Simmering,28,9.31 -Lou Houston,22,9.91 -Rebecca Gillies,19,4.09 -Philip Urbanski,21,8.87 -Teresa Perkins,24,5.85 -Mary Holley,25,6.74 -Tricia Davanzo,19,5.17 -Bridget Mcneal,26,5.46 -Douglas Holland,27,6.25 -Justin Whitmer,22,5.62 -David Davis,18,6.81 -Frances Kerr,27,8.3 -Kim Ellis,24,8.32 -Brian Brown,21,6.25 -Monica Lubrano,22,8.02 -Joyce Skaggs,29,8.43 -Penelope Fries,18,6.81 -Alice Randolph,26,8.1 -Jeffrey Ermitanio,28,9.5 -Stephanie Davis,27,9.36 -John Snow,30,8.67 -Barbara Gott,23,8.69 -Sharon Deleon,19,7.66 -Rigoberto Wilenkin,28,7.71 -Mathew Embree,24,5.97 -Bobby Walker,27,4.85 -Jacqueline Macias,27,8.76 -Benjamin Beck,27,8.8 -Steve Williams,22,6.99 -James Elick,29,9.68 -Elva Diaz,20,7.79 -Terrance Bruce,25,6.96 -Mark Pearson,24,8.49 -Arthur Lowrey,28,8.1 -Scott Lopez,18,4.67 -Hilario Lewis,24,8.95 -Esther Urbancic,18,8.93 -Eric Long,20,4.9 -Matthew Perry,18,4.48 -Lois Alexander,18,5.42 -James Brokaw,28,6.26 -Donald Lewis,27,8.64 -Amanda Gunderson,22,4.73 -Ryan Henricks,29,8.58 -Michelle Mori,25,5.38 -Stacy Erickson,22,5.69 -Kevin Hadley,30,4.64 -Daniel Lopez,23,4.66 -Jose Perez,22,4.53 -Nina Earp,21,9.88 -Richard Stellhorn,21,7.53 -Travis Sanchez,22,5.92 -Earl Anderson,29,4.2 -Antonio Watts,21,7.73 -Katia Cowan,19,7.55 -Michael Routzahn,29,5.97 -Teresa Baridon,26,8.05 -Bertram Eilerman,18,6.18 -Dianne Lucero,22,8.73 -Barbara Fine,28,4.7 -Betty Ferreira,25,6.18 -Charles Jimeson,24,4.34 -Marta Wang,27,4.33 -Travis Stanphill,29,8.21 -John Ashley,24,6.39 -John Merkel,28,7.08 -Josephine Zechman,20,9.64 -Mark Haven,27,8.27 -Carlos London,28,7.19 -Annemarie Keller,30,7.62 -Robert Mccollough,24,5.85 -Harold Slater,21,8.63 -Benjamin Sykes,30,6.9 -Vickie Potter,23,4.77 -Susan Chavis,29,5.89 -Patricia Robinson,18,5.61 -Florence Smith,21,9.62 -Olimpia Connolly,26,6.06 -Robert Stehlik,22,8.79 -Harry Mckenzie,24,4.15 -Kelly Friel,23,4.44 -Therese Butts,29,8.26 -Brian Cole,28,8.75 -Michael Zable,30,5.07 -Otis Bubar,27,6.14 -John Valdez,25,4.97 -Denise Tanner,28,8.19 -Catherine Wagner,30,4.32 -Lorenzo Dayton,22,9.9 -Shelby Martinez,26,5.74 -Nina Berner,25,9.67 -Rachel Bapties,26,8.1 -Wesley Byron,18,8.03 -Gregory Mccollum,30,9.8 -Diane Brady,29,9.86 -Christopher Hahn,21,5.22 -Dennis Rogers,19,4.47 -Gerald Hartley,21,5.9 -Barbara Pagan,23,4.32 -Trevor Hansen,30,6.03 -Pamela Alexander,30,6.6 -Don Smith,28,7.32 -Thomas Hill,26,6.0 -Catina Burgin,29,8.47 -James Moore,23,7.56 -Dorothy Laudat,24,7.63 -Eloise Griner,26,9.36 -Edna Huey,26,7.15 -Cheryl Bennett,24,9.01 -George Woodard,29,7.87 -Louis French,28,7.63 -Ruth Campbell,22,5.99 -Anna Johansson,26,5.47 -Cindy Christiansen,30,6.47 -Buck Buban,23,8.28 -Maria Wolfson,29,9.3 -Joyce Abernathy,21,8.27 -Adam Campbell,20,4.88 -Astrid Denoon,25,6.89 -Vera Mcdaniel,28,6.77 -Teresa Triplett,20,7.02 -Stacy Dingle,27,5.94 -Peter Hutchins,30,4.16 -Emma Garfield,23,4.24 -George Ober,19,9.47 -Linda Estrada,21,6.84 -Jimmy Gee,24,9.77 -Juanita Kimple,26,5.07 -Morris Todd,24,7.88 -Ruth Minor,30,4.32 -Hilda Kofford,29,6.36 -Jennifer Loftus,27,5.67 -Kristy Gilbert,28,6.41 -Juan Wall,22,8.08 -Brandy Crockett,29,5.63 -Stanley Guerrero,27,5.92 -Kelly Baker,18,5.7 -Thomas Phelan,29,4.34 -Sarah Dye,22,7.13 -Denise Myers,22,8.26 -Wallace Lafleur,30,7.25 -Esther Yother,18,9.38 -Nicole Bussman,20,6.86 -Edgar Meacham,24,5.6 -Michael Dorland,27,7.83 -Brenda Baumgartner,25,8.59 -Loretta Bonsall,30,9.93 -Arturo Orange,18,4.08 -Larry Sims,22,7.41 -Christopher Greene,28,4.63 -Teresa Owings,28,9.74 -Linda Herrington,26,5.62 -Dora Hass,28,5.83 -Joan Bodo,27,5.42 -Thomas Steel,21,7.04 -Walter Musick,28,4.47 -Suzy Williams,18,4.62 -Reginald Wilke,20,5.84 -Anthony Gunter,30,4.74 -Carlyn Harris,18,5.63 -Elizabeth Scharf,28,8.47 -Arlinda Kierzewski,26,5.12 -Glenn Herren,24,8.62 -Carolyn Weiss,20,6.36 -Evelyn Curles,24,6.1 -Kenneth Chase,25,6.73 -Sue Carlock,19,6.6 -Terry Chandler,30,5.21 -Margaret Fahnestock,26,7.08 -Terry Dale,18,7.86 -Dorothy Burke,27,5.06 -John Holm,30,9.92 -Frederick Teel,22,8.66 -Randy Wylie,22,4.58 -Charles Miller,18,6.7 -Leslie Johnson,26,6.99 -Charlotte Leftwich,30,7.96 -Donald Colantuono,30,4.91 -Gina Rice,21,7.39 -Ethel Freeman,19,4.38 -Paul Thrasher,19,5.78 -Marci Trimble,21,8.43 -Lenny Castoe,29,4.36 -Melissa Wozniak,20,9.13 -Jan Cunningham,30,8.83 -Daniel Hoobler,23,5.17 -Anna Dixon,21,9.46 -Xavier Bishop,28,6.34 -William Nighman,26,5.07 -Reinaldo Varrone,28,9.89 -Gregory Schick,21,5.9 -Kenneth Water,25,4.68 -Ruby Winkler,24,5.61 -Michael Weaver,21,7.59 -Mark Jewell,21,9.15 -Mary Buchanon,23,4.51 -Michelle Mayhugh,25,6.19 -Edna Avery,28,4.73 -James Jenkins,23,5.79 -Alex Heefner,21,5.12 -Karen Denny,21,4.58 -Matthew Gonzales,22,7.54 -Linda Quella,24,8.31 -Lynn Jones,30,5.8 -Darryl Sutton,30,4.43 -Marietta Ward,28,5.78 -Gregory Knight,18,9.64 -Terri Kelly,26,5.45 -Peter Nevills,23,8.13 -Christopher Ouzts,19,9.8 -Maxine Zirin,20,6.1 -Ruth Young,20,5.34 -David Phillies,30,6.85 -Lisa Sullivan,25,5.55 -David Bourque,25,8.96 -Adrianne Ali,20,6.84 -Ernest Sommerville,27,4.16 -Virginia Price,21,8.39 -Leon Morgan,24,5.34 -William Johnson,25,9.86 -Nicholas Mathes,18,4.47 -Alisa Smith,25,7.21 -Yolanda Mays,27,5.57 -Edith Shaffner,24,5.91 -William Gonzales,30,6.71 -Krista Henley,23,8.14 -Yvonne King,19,6.73 -Laura Hoffmann,29,6.1 -Raymond Brooks,27,9.49 -Arthur Loveless,30,5.47 -Louis Jones,30,5.97 -Sabine Smith,26,7.87 -David Hill,21,8.02 -John Gary,21,6.78 -Johnny Huffman,18,5.98 -Audrey Williams,18,6.78 -Kelly Rodriguez,19,8.71 -Keneth Burch,26,5.8 -Sean Fox,24,7.69 -Jan Leclair,22,8.35 -Eric Feagin,22,8.85 -Armanda Horgan,28,8.4 -Kenneth Joyce,18,9.62 -Maria Breton,22,7.93 -David Parr,21,5.87 -Logan Bartolet,24,7.59 -Hubert Williams,29,6.88 -Linda Foulkes,20,9.25 -Phyllis Thomas,25,9.08 -Lucille Berry,25,8.68 -Frank Beauchesne,24,5.55 -Kathryn Brown,19,6.24 -Marilyn Mathews,29,6.05 -Tim Moscoso,30,8.25 -William Milligan,20,8.15 -Nicholas Hahn,22,7.67 -Melinda Ludgate,19,9.48 -Theodore Yates,27,7.25 -Ester Leis,21,6.43 -Francis Robinson,27,4.19 -Tina Bath,26,8.4 -Mandy Hambric,29,8.22 -Jose Martin,21,4.07 -Helen Shoemake,24,8.07 -Richard Castro,19,4.91 -Willie Lowell,19,9.54 -Jennie Ramlall,21,4.5 -Karen Gavin,26,7.41 -Michael Mckinnon,28,4.23 -Priscilla Roper,20,6.69 -Jonathan Newsome,18,4.97 -Anthony Branch,25,6.3 -Robert Gibson,30,6.59 -Thomas Schade,23,4.16 -Kirby Green,27,7.6 -Brian Edwards,18,4.79 -Debra Flores,21,6.25 -David Macleod,21,9.12 -Lois Nelsen,30,5.88 -Wanda Jones,21,6.75 -Marsha Robinson,18,8.76 -Nicole Jeffries,28,9.94 -Ann Turner,24,6.25 -Agnes Warnock,25,9.38 -Darlene Wertman,21,9.53 -Leo Fleming,27,5.88 -Nicholas Maldonado,26,9.73 -Lanny Mccrary,27,7.31 -Lee Walburn,19,5.99 -Grace Souphom,20,4.33 -Thomas Mason,19,8.88 -Dudley Peterson,23,8.5 -Jennifer Guerrero,27,5.02 -Christopher Rash,23,7.76 -Tracey Kelty,18,7.89 -Patrick Hickman,22,9.87 -Roland Charleston,26,9.45 -Lucia Sherrill,23,8.46 -Barbara Buck,27,8.09 -Warren Pereira,26,6.42 -Heather Peterson,28,6.67 -Jasper Gonzalez,24,6.24 -Diane Stclair,29,4.53 -Dorothy Gosnell,22,7.31 -Charles Childress,24,9.34 -Linda Simmons,23,6.11 -Todd Netterville,29,5.38 -Rebecca Lamb,25,6.83 -Tiffany Erkkila,23,4.52 -Charles Hooper,20,5.09 -Raymond Brickey,19,5.27 -William Sheehan,22,4.54 -Margaret Miller,26,6.83 -Peggy Rael,27,9.0 -Barbara Roy,22,7.19 -Bernice Adams,29,6.98 -Michael Hamel,23,8.97 -Paul Swasey,23,4.92 -Johanna Chavez,28,4.36 -Gloria Gutierrez,29,6.63 -Harry Rusher,27,7.69 -Carlos Mcreynolds,19,6.85 -Susan Peschel,26,9.74 -Margaret Mcguire,19,7.17 -John Peralta,22,9.95 -Barbara Brown,25,4.94 -Dustin Patrick,23,7.01 -Brian Vargas,28,8.21 -Rick Capizzi,25,8.9 -Lisa Palmieri,29,6.59 -Brenda Sumter,24,7.63 -Laverne Radford,23,4.97 -Heather Lish,21,4.08 -Jeffrey Deane,18,5.5 -Valerie Woode,27,7.79 -Benjamin Brown,25,6.53 -Timothy Armstrong,24,6.16 -Krystal Janssen,24,7.73 -Daniel Bell,30,5.16 -George Basil,19,6.28 -Lilian Rocha,26,8.72 -Stanley Jackson,26,5.33 -Christine Franks,30,7.31 -Janelle Vecker,18,7.08 -Grace Robbins,19,5.24 -Joshua Ream,18,8.18 -Georgia Calaf,20,9.18 -Rhonda Leona,29,9.24 -Charles Schueller,28,5.49 -Leonor Adams,26,6.95 -John Bond,28,9.29 -Deirdre Marthe,24,7.48 -Gene Utley,25,9.94 -Lisa Wilson,20,9.13 -Catherine Kim,22,9.36 -Randolph Martin,24,8.77 -Velma Jobe,30,4.22 -Naomi Mendosa,21,4.03 -William Grove,29,7.01 -Sandra Hackney,29,5.68 -Jennifer Higdon,28,9.61 -Tina Tidwell,29,9.4 -Emily Simpson,30,4.06 -Frank Rasmussen,24,4.51 -Lisa Strause,19,6.06 -Donald Skinner,30,4.61 -Robert Jordan,22,8.48 -Enedina Mcneil,24,5.83 -Nathaniel Boyd,18,5.46 -Clyde Huelskamp,25,4.46 -Lorena Harris,22,6.29 -Walter Ham,25,7.2 -Brian Lee,22,8.08 -Jason Page,28,9.64 -Deborah Watt,22,5.58 -Christopher Zupancic,28,5.5 -Helen Perkins,22,7.12 -Nina Aber,23,7.79 -Dwight Johnson,30,4.06 -Allyson Gay,25,8.9 -David Propes,24,7.61 -Sheldon Johnson,29,4.64 -Elana Bergeron,19,7.27 -Lisa Rowe,19,7.85 -William Filmore,18,4.56 -Angela Stultz,24,7.6 -John Collins,26,5.52 -Thomas Meade,25,4.62 -Ann Lorenz,20,9.85 -Delphia Clarke,30,9.3 -Richard Allen,21,4.44 -Amelia Costain,29,6.9 -Anisha Bridges,18,6.99 -Marcus Denson,20,6.42 -Almeda Stamey,25,5.29 -Cindy Chapman,26,6.77 -Jadwiga Truocchio,25,6.37 -Ricky Bergman,18,5.26 -Jennifer Franz,29,4.82 -Brenda Painter,29,8.07 -Robert Hawkins,26,4.92 -Johnny Alvidrez,30,6.61 -Meredith Spears,22,8.29 -Kevin Walton,22,5.85 -Dave White,20,7.53 -Timothy Wagner,24,4.7 -Billie Hodge,29,7.17 -Angela Sangi,21,5.22 -Paula Moore,23,6.74 -Harold Aguilar,19,5.67 -Rocky Brooks,19,6.56 -Rachel Smith,29,9.5 -Barbara Harry,18,4.24 -Vicki Ricker,25,5.95 -Terry Carlyle,19,7.24 -Leslie Hamlin,30,6.67 -Eugene Bunting,20,7.1 -Bryan Hickerson,25,4.02 -Amanda James,19,8.13 -Steven Ball,21,7.25 -George Surratt,26,6.42 -Adriana Johnson,22,7.11 -Rachel Russell,27,6.51 -Rebecca Cully,18,4.83 -Nancy Landrum,29,7.16 -Elizabeth Howard,25,9.4 -Clifford Perkins,18,5.68 -Jonathan Koester,24,4.9 -Dona Chambers,27,9.43 -Sandra Schmiedeskamp,26,7.83 -Viola Bailey,22,5.75 -Joseph Head,24,9.97 -Wesley Bouyer,30,9.94 -Teresa Jones,19,9.99 -Michael Ginn,24,8.54 -Rebecca Imfeld,21,4.34 -Cynthia Tippins,29,7.96 -Inez Johnson,22,7.49 -Beverly Hertzler,18,4.41 -Helen Gloor,21,9.21 -Gail Monahan,21,7.26 -Marla Dodson,20,5.77 -Adele Deemer,22,4.37 -Jim Smith,20,8.18 -Julian Gutierrez,22,4.23 -Anna Payne,29,6.15 -James Pratka,29,4.13 -Sheila Linn,26,9.64 -Delphine Yousef,18,8.84 -Gwendolyn Alvarez,25,4.35 -Howard Holloway,19,9.64 -Harry Hanson,19,7.58 -Bobby Shelton,22,4.72 -Sara Wood,22,5.16 -Michael Toller,29,5.24 -Lisa Glover,18,7.62 -Robert Figueroa,24,6.02 -Margery Turner,21,6.98 -Ladonna Guinyard,23,8.56 -Anthony Sobus,25,9.43 -Patrick Ruiz,28,5.32 -Victor Santiago,20,6.31 -Harry Wages,30,4.19 -Celeste Pope,24,8.33 -Royce Hale,28,8.83 -Marie Powell,21,6.3 -Eva Buske,26,5.29 -Mary Ortiz,26,7.25 -Edward Williams,21,8.56 -William Moore,27,5.99 -Robert Jackson,30,7.9 -Jocelyn Jensen,20,6.64 -Clayton Williams,26,5.82 -Melinda Bass,19,9.45 -Salvador Kinney,18,5.83 -Patrick Rios,27,5.74 -Janice Smith,23,6.43 -Wilhelmina Collins,26,9.55 -Mary Skeesick,25,6.26 -David Diaz,22,9.11 -Maritza Evans,27,9.8 -Samuel Regan,30,8.45 -Richard Madden,24,8.58 -Bertha Boyd,21,6.67 -Travis Gutierrez,19,5.88 -Lisa Bernier,20,7.74 -Willie Keith,24,7.21 -Micheal Scott,21,5.54 -Norma Dixon,19,5.9 -Angel Rhoades,22,6.66 -May Avent,27,4.22 -Thad Banks,25,4.44 -Marlene Leonard,22,5.2 -Cora Fahey,23,7.37 -Bessie Trivedi,26,8.6 -Harold Delgado,30,6.31 -Brenda Jackson,27,8.89 -Nicole Larkin,22,8.27 -Henry Ferrell,20,6.99 -Holly White,27,7.29 -Ryan Digeorgio,26,5.82 -Floyd Anderson,20,7.22 -Robert Cahill,28,4.58 -Lori Villegas,24,9.77 -Jennifer Maxie,30,6.87 -Cindy Frazier,30,7.0 -Jerome Harper,18,7.09 -Christopher Luna,19,9.31 -David Valdez,20,8.7 -Ted Anderson,28,4.15 -Marie Marn,18,4.53 -James Doyle,18,5.98 -Jerry Pinner,29,5.0 -Eileen Fata,19,8.18 -Gary Simmons,21,8.49 -Willie Haven,29,5.16 -John Meyer,29,8.28 -Leola Murphy,25,8.96 -Nina Baker,23,5.73 -Edwin Zeger,30,7.64 -Mildred Perkins,24,6.81 -Yong Reaid,26,8.31 -Lynn Walker,28,8.42 -Jason Yates,19,7.55 -Cedric Wallace,29,4.08 -Anne Reedy,21,4.15 -Ricky Tetreault,26,6.0 -Gary Littleton,22,6.69 -Brian Deubler,28,6.52 -Adrian Colvin,29,6.69 -Eleanor Schroder,21,7.5 -Jean Gethers,28,6.89 -Matthew Kim,23,8.1 -Jennifer Mclean,19,4.71 -Jesus Weckerly,25,9.68 -Michael Boyd,20,4.94 -Michael Chavarria,28,6.47 -Sydney Anderson,30,7.15 -William Julius,28,6.29 -Richard Meza,19,6.99 -Katherine Roche,28,7.13 -Jacob Figgs,22,6.28 -Thomas Weimer,29,4.32 -Willie Mcgurk,19,5.99 -Minnie Cook,28,7.51 -Loretta Molina,21,8.69 -James Harris,24,4.44 -John Lyons,21,5.78 -Annie Krings,21,7.61 -Carrie Ontiveros,19,4.73 -Marie Clausen,24,4.55 -Robert Hung,23,5.55 -Wesley Shah,23,6.91 -Frank Lopez,30,6.66 -Albert Coral,25,7.12 -Kristine Harvey,22,4.83 -Arlene Bauer,29,8.29 -Connie Figueroa,23,9.86 -Tom Bishop,27,4.48 -James Harrison,19,5.6 -Sheila Stier,30,5.88 -Pearl Mckenna,26,9.45 -Casey Williams,25,7.92 -Yvette Heard,26,4.48 -Paul Paneto,28,4.97 -Christopher Iniguez,18,7.78 -Sheila Hudson,29,5.37 -Marilyn Sexton,21,5.97 -Eric Marchetti,28,5.47 -Veronica Benz,26,7.59 -Mackenzie Horta,24,8.8 -Nellie Cunningham,23,7.64 -Teresa Valiente,28,8.89 -Kate Pospicil,29,8.75 -Lawrence Mccullough,27,5.51 -Robert Hannan,23,7.27 -Paul Miyoshi,18,5.05 -Rebekah Leonardo,18,7.68 -Lillian Sanders,26,4.7 -Russell Tran,21,5.76 -Charles Fletcher,30,6.28 -Sibyl Barthelemy,18,7.47 -Trena Head,23,4.02 -Tracy Hogan,25,4.2 -Christopher Scott,24,5.07 -Peter Langenfeld,19,6.97 -Sara Miller,21,7.37 -Flora Allen,20,9.37 -Sarah Figueiredo,27,8.94 -Ronald Gotay,21,9.74 -Maryanne White,22,8.68 -Bettie Illsley,28,6.84 -Margaret Eychaner,19,5.1 -Frank Stevens,22,5.81 -Anthony Huie,19,5.69 -Jason Wainwright,20,7.13 -Kenneth Robles,18,9.21 -Chad Barnes,27,7.81 -Kelly Holcomb,29,4.03 -Ruby Astin,28,4.1 -Laurie Marshall,20,5.71 -Melanie Kath,20,8.14 -Jessica Dubose,26,9.98 -George Wofford,25,9.36 -Elizabeth Hollyday,23,4.1 -Gloria Gilreath,29,5.5 -Kathleen Pruitt,24,4.43 -James Bohman,20,6.95 -John Ferreira,28,4.88 -Everett Mccollough,28,5.82 -Phyliss Wood,21,4.47 -Jamie Wood,22,5.31 -Ralph Finwall,30,8.17 -Florence Lile,30,6.29 -Geraldine Nelson,22,9.52 -Robin Santiago,27,9.74 -Maureen Daugherty,18,9.49 -Matthew Grogan,28,7.05 -James Ryan,25,9.54 -Brian Christiansen,24,4.82 -Sondra Bui,21,9.7 -Janice Luna,21,7.6 -Roger Felton,20,9.08 -Gregory Harris,28,9.96 -Jewell Pate,22,5.3 -Antionette Blaydes,22,8.9 -Lisa Harrison,23,8.22 -Avery Chestnut,24,4.15 -Alfred Mendez,29,9.9 -Loretta Sullivan,20,7.7 -Matthew Fischer,22,6.28 -Fred Mckane,19,5.32 -Aaron Netolicky,30,9.48 -Mark Phillips,22,6.4 -Curtis Aiello,19,5.2 -Karen Spalding,29,9.24 -Angelita Williamson,18,7.66 -Rita Peterson,22,5.52 -William Childs,18,9.05 -Jackie Hummel,26,5.33 -Lance Cainne,28,6.21 -James Moore,22,7.15 -Bambi Sholders,22,5.03 -Pamela Collins,24,6.44 -John Gray,26,5.99 -Cynthia Greene,30,4.37 -Lori Hennemann,20,6.25 -Thomas Scruggs,23,4.82 -Hattie Dougherty,20,4.15 -Justin Mckenney,28,7.39 -Mark Shippey,28,9.87 -George Berti,19,4.11 -Sheila Miranda,29,9.19 -Gloria Kline,19,5.55 -Ardith Thomas,18,4.24 -Raymond Gagnon,24,6.08 -Pamela Goehner,20,6.97 -Julia Jackson,27,5.56 -Jan Arndt,29,5.03 -James Rivera,29,6.2 -Jennifer Dullea,24,4.31 -Laura Norris,21,9.02 -Amy Marshall,19,9.72 -Todd Wayman,26,6.5 -Louis Parson,29,8.36 -Charles Hawley,24,4.08 -Tammy Munday,25,5.14 -Dawn Oconor,20,9.64 -Ila Tobin,27,5.46 -Gloria Gaffney,22,9.37 -Francis Fletcher,20,4.38 -Tammy Perry,29,9.07 -Robert Carrera,26,5.26 -Sharron Ellis,24,4.94 -Sheila Taylor,26,9.59 -Richard Eaddy,22,7.86 -Billy Chrisman,28,7.46 -Dorothy Daugherty,23,9.13 -Paul Colon,29,7.21 -Justin Mann,30,4.81 -Michelle Torres,29,6.33 -Timothy Mercado,28,6.59 -Christopher Frank,25,8.15 -Johnnie Evans,18,8.86 -Jean Carter,18,7.11 -Matthew Mcdearmont,22,6.88 -Dorothy Yeager,30,4.86 -Ruth Rhodes,24,6.86 -James Powers,25,6.07 -Nell Dyson,29,5.27 -Edward Bailey,27,6.71 -Diana Patton,23,6.92 -Barbara Copeland,19,9.27 -Clarence Cerverizzo,30,4.0 -Daniel Lloyd,20,6.62 -Jeffrey Maxcy,24,4.25 -Brian Heidinger,20,7.28 -Howard Haitz,23,6.78 -Barbara Leroy,27,8.85 -Doris Scantling,26,5.97 -Richard Caruthers,24,5.54 -Mabel Dorch,27,4.56 -Yolanda Conner,27,9.08 -Susan Haley,26,7.99 -Brenda Scott,22,4.09 -George Lawless,24,9.48 -Richard Snider,18,9.99 -Florence Sooter,29,7.92 -Ann Sorensen,19,5.1 -Debbie Feazel,24,7.95 -Blaine Gust,22,5.42 -Gerald Gomez,21,9.62 -Daniel Wilson,25,9.46 -George Lapointe,28,5.96 -Brian Darrow,28,5.92 -Edward Jarvie,27,5.1 -John Paolucci,26,7.67 -Don Dryden,20,5.94 -Tonya Sculley,29,4.54 -William Erling,27,5.14 -Annie Maddox,26,9.59 -James Purcell,19,7.58 -Theresa Morgan,26,9.03 -Sean Dieteman,27,5.96 -Joyce Robison,19,5.89 -Larissa Stalling,23,7.82 -Thomas Ramos,23,6.96 -Kimberly Tarver,29,4.65 -Louie Unrein,30,4.43 -Miguel Bertalan,27,8.19 -Brian Perkins,29,6.69 -Brittney Muller,24,8.6 -Terry Gillikin,19,6.92 -Lela Sanders,25,4.36 -Herman Mcavoy,30,8.17 -Robert Ange,21,6.82 -Stephanie Ramirez,21,6.33 -Noah Minton,25,9.62 -Cynthia Wood,24,6.47 -Sue Mahon,28,6.82 -Lisa Robards,25,5.33 -John Jones,28,8.42 -Roger Williams,26,9.39 -Thomas Black,20,9.29 -Leonore Mcmillian,23,5.66 -Betty Mccoy,19,7.76 -Janice Sousa,21,5.0 -Emma Mottillo,24,8.7 -Kristi Swanson,19,6.24 -Ann Eaton,27,8.44 -Olive Williams,28,6.54 -Paul Rio,27,8.65 -Earl Horan,26,6.6 -Linda Mckoy,25,8.06 -Kevin Brown,23,5.38 -Jack Meza,26,7.07 -Joe Smith,28,7.27 -Don Knox,19,8.12 -Teresa Robotham,26,6.3 -Maryjane Shafer,21,7.26 -Estella Neubauer,24,5.14 -Cassandra Maldonado,25,9.95 -Sherry Bean,26,4.03 -Leonard Jackson,23,8.03 -James Mills,19,5.35 -Kristen Keri,19,6.44 -Jerry Kirk,20,8.95 -Angelo Landrum,28,4.93 -Dora Swarr,22,4.18 -Diane Laird,20,6.12 -Darren Charbonneau,27,4.84 -Barbara Lambert,28,5.43 -Mark Waits,30,5.81 -Ann Mondragon,19,5.76 -Michelle Oneal,23,5.51 -Carl Campbell,25,9.82 -Alice Digangi,27,4.55 -Frances Nez,30,9.64 -Amber Wilson,24,8.96 -Maria Ceraos,27,4.26 -Jennifer Turner,29,4.33 -Larry Smith,29,5.43 -Daniel Dumar,28,9.07 -Mary Macdonald,22,6.04 -Johnnie Yepez,29,6.35 -Stella Hallmark,20,7.76 -Jimmy Dunnaway,27,4.87 -Hilda Bohlke,23,7.34 -Robert Maines,18,8.81 -Richard Shackleford,19,8.86 -Shane Machesky,24,8.83 -Rodolfo Maldonado,18,7.97 -Connie Butler,29,4.52 -Michael Kath,19,9.28 -Josephine Newbury,21,7.71 -Martha Burton,24,8.0 -Evelyn Johnson,24,8.18 -Renee Munn,27,8.84 -Brenna Szymansky,29,7.99 -Luz Roseboro,29,8.46 -Heather Garcia,28,9.98 -Anita Tudor,26,5.05 -Eddie Shiels,30,9.1 -Edwin Broadwell,24,7.35 -Corinne Hamblin,22,8.88 -Connie Berry,24,7.87 -Larry Fields,22,4.37 -Amber Wallin,18,9.29 -Richard Somers,27,4.48 -Steve Williams,27,7.52 -Lee Davis,30,9.91 -Alice Hudson,21,9.25 -Elissa Sinclair,29,7.02 -Anita Mcpherson,21,5.13 -Jackie Johnson,30,9.15 -Howard Smoot,30,7.52 -Robert Gonzalez,28,7.91 -Leticia Wright,21,5.72 -Carl Olson,24,6.19 -Evelyn Daniels,19,4.54 -Robert Hatley,25,4.39 -Kelly Stewart,29,4.5 -Logan Pruitt,18,7.63 -Tammy Wong,30,6.13 -Henry Quinton,24,9.51 -Stanley Monteleone,30,4.76 -Harry Neher,28,9.4 -Jason Rossetti,23,7.23 -Emma Marcus,26,5.36 -Lindsey Cummings,18,6.88 -Miguel Guinn,25,5.41 -James Herring,27,5.65 -Glenda Cisneros,21,7.86 -Gladys Purdom,29,9.43 -Marjorie Rapelyea,25,6.85 -Malcolm Smith,30,6.78 -Erica Broussard,19,8.73 -Emma Mcbride,19,7.36 -Raymond Soileau,18,7.27 -Rikki Gomes,30,7.19 -Thomas Spaur,29,6.4 -Gabrielle Szmidt,29,8.41 -Justin Gonzales,24,7.66 \ No newline at end of file diff --git a/data/unsorted_names.txt b/data/unsorted_names.txt deleted file mode 100644 index 4c9ca1f9..00000000 --- a/data/unsorted_names.txt +++ /dev/null @@ -1,199 +0,0 @@ -Erminia -Elisa -Ricarda -Royce -Amelia -Mariah -Kendal -Karl -Eustolia -Clay -Erma -Vita -Corrin -Sanjuanita -Shavonda -Donnetta -Adrienne -Ching -Leonie -Wan -Cheyenne -Sharon -Milissa -Marlon -Lena -Adele -Amee -Lolita -Junita -Agueda -Maggie -Herma -Major -Tyler -Ka -Dannette -Carlotta -Donald -Ramiro -Norman -Columbus -Detra -Maximina -Cindi -Elke -Tammie -Claudia -Irving -Jeane -Susanna -Michele -Chet -Kirstie -Blanca -Dorothea -Octavia -Randa -Louis -Penny -Twanna -Darryl -Mignon -Myrl -Lavern -Christa -Brooks -Samella -Roberto -Fredia -Raquel -Darrick -Willodean -Denisse -Idalia -Alda -Lashanda -Shea -Treasa -Rosetta -Charleen -Marisol -Matt -Keisha -Len -Tena -Mervin -Regina -Loan -Starla -Julian -Roberta -Long -Mei -Felton -Merrill -Lisha -Lydia -Toya -Katharyn -Fatimah -Cristal -Mathilda -Merideth -Carson -Marcelina -Floyd -Demetrice -Luz -Cheryll -Saundra -Vernell -Sheila -Quentin -Oliva -Victoria -Sage -Emanuel -Gwyneth -Buck -Patsy -Jeanine -Gaylene -Noelia -Dorene -Petrina -Chrissy -Kelsie -Marla -Antonio -Kiley -Katerine -Rina -Bettina -Charlie -Dino -Meda -Sherry -Gracia -Maisha -Hiroko -Margareta -Caroll -Sharie -Ciera -Lindy -Dierdre -Alejandrina -Jannette -Marco -Hwa -Exie -Jed -Rena -Rebeca -Luisa -Jasmine -Elinore -Tashia -GuillerminaAlaine -Ronda -Kasha -Joelle -Antony -Bari -Nicolas -Johnie -Ninfa -Sebastian -Catalina -Nicky -Justina -Danuta -Morris -Jaimee -Erik -Jenifer -Cecille -Lynne -Sharleen -Valentin -Elayne -Kayce -Karyl -Catherin -Craig -Marline -Ilda -Xavier -Genesis -Corrie -Elmira -Ericka -Carisa -Dwana -Randy -Marquetta -Dagmar -Williams -Oma diff --git a/modules/legb.py b/modules/legb.py deleted file mode 100644 index 722f941d..00000000 --- a/modules/legb.py +++ /dev/null @@ -1,10 +0,0 @@ -a = "I am global variable!" - - -def enclosing_funcion(): - a = "I am variable from enclosed function!" - - def inner_function(): - - a = "I am local variable!" - print(a) diff --git a/modules/mod_a.py b/modules/mod_a.py deleted file mode 100644 index 848c3a5c..00000000 --- a/modules/mod_a.py +++ /dev/null @@ -1,8 +0,0 @@ - -from mod_b import * -from mod_c import * - -print(x) - - - diff --git a/modules/mod_b.py b/modules/mod_b.py deleted file mode 100644 index d981daa7..00000000 --- a/modules/mod_b.py +++ /dev/null @@ -1,4 +0,0 @@ -import mod_c - - -mod_c.x = 1000 diff --git a/modules/mod_c.py b/modules/mod_c.py deleted file mode 100644 index e080e1ab..00000000 --- a/modules/mod_c.py +++ /dev/null @@ -1 +0,0 @@ -x = 6 diff --git a/names.txt b/names.txt deleted file mode 100644 index 25f2e741..00000000 --- a/names.txt +++ /dev/null @@ -1 +0,0 @@ -Bob, Alex, Naruto, Peter diff --git a/output.html b/output.html index 576aff25..b6e44e59 100644 --- a/output.html +++ b/output.html @@ -1 +1 @@ -
nameBuzzFeed - Quizzes
size1
title
  • Pick Lots Of Dogs And I Bet You That I Won't Get Your Eye Color Right
pubDate
  • Sun, 26 Jun 2022 00:40:18 -0400
description
  • I WANT to get it wrong...View Entire Post ;
link
  • https://www.buzzfeed.com/turtleo/dog-eye-color-guessing-quiz
\ No newline at end of file +
nameOnliner
size1
title
  • �������� � 1 ���� ������ ���������� ����� ��� ������� ������
pubDate
  • Thu, 30 Jun 2022 19:26:28 +0300
description
  • � 1 ���� �� 31 ������� �������� ������ ���������� ����� ��� ������� ������. �� ���� ��������� ���������-������ ������������ ��������.������ �����
link
  • https://people.onliner.by/2022/06/30/belarus-s-1-iyulya-vvodit-bezvizovyj-vezd-dlya-grazhdan-polshi
\ No newline at end of file diff --git a/package/__init__.py b/package/__init__.py deleted file mode 100644 index b8732cd7..00000000 --- a/package/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .skill_python import python -from .skill_c import c -from .skill_nim import nim -from .skill_linux import linux diff --git a/package/__main__.py b/package/__main__.py deleted file mode 100644 index 01ca8883..00000000 --- a/package/__main__.py +++ /dev/null @@ -1,20 +0,0 @@ -import sys - -from .skill_python import python -from .skill_c import c -from .skill_nim import nim -from .skill_linux import linux - -print('#--------------') -print(sys.path) -print('#--------------') - -def learn_all(): - python() - c() - nim() - linux() - - -if __name__ == '__main__': - learn_all() diff --git a/package/skill_c.py b/package/skill_c.py deleted file mode 100644 index f25365b7..00000000 --- a/package/skill_c.py +++ /dev/null @@ -1,2 +0,0 @@ -def c(): - print('Skill c') diff --git a/package/skill_linux.py b/package/skill_linux.py deleted file mode 100644 index 1638cdaf..00000000 --- a/package/skill_linux.py +++ /dev/null @@ -1,2 +0,0 @@ -def linux(): - print('Skill linux') diff --git a/package/skill_nim.py b/package/skill_nim.py deleted file mode 100644 index 4a381418..00000000 --- a/package/skill_nim.py +++ /dev/null @@ -1,2 +0,0 @@ -def nim(): - print('Skill nim') diff --git a/package/skill_python.py b/package/skill_python.py deleted file mode 100644 index 2baef533..00000000 --- a/package/skill_python.py +++ /dev/null @@ -1,2 +0,0 @@ -def python(): - print('Skill python') diff --git a/package2/__init__.py b/package2/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/package2/__main__.py b/package2/__main__.py deleted file mode 100644 index a5143a0a..00000000 --- a/package2/__main__.py +++ /dev/null @@ -1,12 +0,0 @@ -import sys - -from skill_java import java - - -print('#--------------') -print(sys.path) -print('#--------------') - - -if __name__ == '__main__': - java() diff --git a/package2/skill_java.py b/package2/skill_java.py deleted file mode 100644 index dfc45f99..00000000 --- a/package2/skill_java.py +++ /dev/null @@ -1,2 +0,0 @@ -def java(): - print('Skill Java') diff --git a/parser_README.md b/parser_README.md deleted file mode 100644 index c741736f..00000000 --- a/parser_README.md +++ /dev/null @@ -1,109 +0,0 @@ -RSS reader -========= - -This is RSS reader version 4.0. - -rss_reader.py is a python script intended to get RSS feed from given source URL -and write its content to standart output also it's can convert content to .json and .html files. - - -To use this script you should install all required packages from requirements.txt -```shell -pip install {name of package} -``` - - - -How to execute after installation ------- - -Specifying the script file. Run from directory with rss_reader.py file the following command - - -Windows -```shell -python rss_reader.py ... -``` - -Linux -```bash - -python3 rss_reader.py ... -``` - -Command line format -------- - - usage: python rss_reader.py [-h] [-v] [--json] [--verbose] [--limit LIMIT] [--date DATE] [--to-html ] - source - - Pure Python command-line RSS reader. - - positional arguments: - source RSS URL - - optional arguments: - -h, --help show this help message and exit - --version Print version info - --json Print result as JSON - --verbose Outputs verbose status messages. Prints logs. - --limit LIMIT Limit news topics. If it's not specified, then you get all available feed. - - --date DATE It should take a date in %Y%m%d format.The new from the specified day will be printed out. - --html It convert data to HTML-format in file output.html. - -Сonsole representation -------- - -```json -Name of the feed -Title from news -PubDate - -Summary description - -Source link - ------------- -Title from news -PubDate -... -..... - - -``` -JSON representation -------- - -```json -{ - "name": Name of the feed, - "size": Number of available news, - "title": [Names of available news], - "pubDate": [Dates of publication news], - "description": [Summary description], - "link": [Link of source] -} -``` - -Cache storage format ------- - -News cache is stored in file data.json in current working directory. - - -Command example ------- - - -```shell -python rss_reader.py "https://www.onliner.by/feed" --limit 1 --html - -python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 2 --json --verbose - -python rss_reader.py "https://www.buzzfeed.com/quizzes.xml" --limit 3 - -python rss_reader.py "https://feeds.fireside.fm/bibleinayear/rss" --limit 3 --verbose - -python rss_reader.py --date 20220620 -``` \ No newline at end of file diff --git a/sh.txt b/sh.txt deleted file mode 100644 index 937576fd..00000000 --- a/sh.txt +++ /dev/null @@ -1,41 +0,0 @@ -A Scandal in Bohemia -Chapter I. -To Sherlock Holmes she is always the woman. I have seldom heard him mention her under any other name. In his eyes she eclipses and predominates the whole of her sex. It was not that he felt any emotion akin to love for Irene Adler. All emotions, and that one particularly, were abhorrent to his cold, precise but admirably balanced mind. He was, I take it, the most perfect reasoning and observing machine that the world has seen, but as a lover he would have placed himself in a false position. He never spoke of the softer passions, save with a gibe and a sneer. They were admirable things for the observer—excellent for drawing the veil from men's motives and actions. But for the trained reasoner to admit such intrusions into his own delicate and finely adjusted temperament was to introduce a distracting factor which might throw a doubt upon all his mental results. Grit in a sensitive instrument, or a crack in one of his own high-power lenses, would not be more disturbing than a strong emotion in a nature such as his. And yet there was but one woman to him, and that woman was the late Irene Adler, of dubious and questionable memory. - -I had seen little of Holmes lately. My marriage had drifted us away from each other. My own complete happiness, and the home-centred interests which rise up around the man who first finds himself master of his own establishment, were sufficient to absorb all my attention, while Holmes, who loathed every form of society with his whole Bohemian soul, remained in our lodgings in Baker Street, buried among his old books, and alternating from week to week between cocaine and ambition, the drowsiness of the drug, and the fierce energy of his own keen nature. He was still, as ever, deeply attracted by the study of crime, and occupied his immense faculties and extraordinary powers of observation in following out those clues, and clearing up those mysteries which had been abandoned as hopeless by the official police. From time to time I heard some vague account of his doings: of his summons to Odessa in the case of the Trepoff murder, of his clearing up of the singular tragedy of the Atkinson brothers at Trincomalee, and finally of the mission which he had accomplished so delicately and successfully for the reigning family of Holland. Beyond these signs of his activity, however, which I merely shared with all the readers of the daily press, I knew little of my former friend and companion. - -One night—it was on the twentieth of March, 1888—I was returning from a journey to a patient (for I had now returned to civil practice), when my way led me through Baker Street. As I passed the well-remembered door, which must always be associated in my mind with my wooing, and with the dark incidents of the Study in Scarlet, I was seized with a keen desire to see Holmes again, and to know how he was employing his extraordinary powers. His rooms were brilliantly lit, and, even as I looked up, I saw his tall, spare figure pass twice in a dark silhouette against the blind. He was pacing the room swiftly, eagerly, with his head sunk upon his chest and his hands clasped behind him. To me, who knew his every mood and habit, his attitude and manner told their own story. He was at work again. He had risen out of his drug-created dreams and was hot upon the scent of some new problem. I rang the bell and was shown up to the chamber which had formerly been in part my own. - -His manner was not effusive. It seldom was; but he was glad, I think, to see me. With hardly a word spoken, but with a kindly eye, he waved me to an armchair, threw across his case of cigars, and indicated a spirit case and a gasogene in the corner. Then he stood before the fire and looked me over in his singular introspective fashion. - -“Wedlock suits you,” he remarked. “I think, Watson, that you have put on seven and a half pounds since I saw you.” - -“Seven!” I answered. - -“Indeed, I should have thought a little more. Just a trifle more, I fancy, Watson. And in practice again, I observe. You did not tell me that you intended to go into harness.” - -“Then, how do you know?” - -“I see it, I deduce it. How do I know that you have been getting yourself very wet lately, and that you have a most clumsy and careless servant girl?” - -“My dear Holmes,” said I, “this is too much. You would certainly have been burned, had you lived a few centuries ago. It is true that I had a country walk on Thursday and came home in a dreadful mess, but as I have changed my clothes I can't imagine how you deduce it. As to Mary Jane, she is incorrigible, and my wife has given her notice, but there, again, I fail to see how you work it out.” - -He chuckled to himself and rubbed his long, nervous hands together. - -“It is simplicity itself,” said he; “my eyes tell me that on the inside of your left shoe, just where the firelight strikes it, the leather is scored by six almost parallel cuts. Obviously they have been caused by someone who has very carelessly scraped round the edges of the sole in order to remove crusted mud from it. Hence, you see, my double deduction that you had been out in vile weather, and that you had a particularly malignant boot-slitting specimen of the London slavey. As to your practice, if a gentleman walks into my rooms smelling of iodoform, with a black mark of nitrate of silver upon his right forefinger, and a bulge on the right side of his top-hat to show where he has secreted his stethoscope, I must be dull, indeed, if I do not pronounce him to be an active member of the medical profession.” - -I could not help laughing at the ease with which he explained his process of deduction. “When I hear you give your reasons,” I remarked, “the thing always appears to me to be so ridiculously simple that I could easily do it myself, though at each successive instance of your reasoning I am baffled until you explain your process. And yet I believe that my eyes are as good as yours.” - -“Quite so,” he answered, lighting a cigarette, and throwing himself down into an armchair. “You see, but you do not observe. The distinction is clear. For example, you have frequently seen the steps which lead up from the hall to this room.” - -“Frequently.” - -“How often?” - -“Well, some hundreds of times.” - -“Then how many are there?” - -“How many? I don't know.” - -“Quite so! You have not observed. And yet you have seen. That is just my point. Now, I know that there are seventeen steps, because I have both seen and observed. By-the-way, since you are interested in these little problems, and since you are good enough to chronicle one or two of my trifling experiences, you may be interested in this.” He threw over a sheet of thick, pink-tinted note-paper which had been lying open upon the table. “It came by the last post,” said he. “Read it aloud.” \ No newline at end of file diff --git a/storage.data b/storage.data deleted file mode 100644 index 2b23711380703133e8d45d0ef75b150acb688eeb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 51 zcmZo*nX1760kKmwdYBWFlBalAyF1kM%->gbVoU9m9+s5M Date: Thu, 30 Jun 2022 21:50:15 +0300 Subject: [PATCH 52/52] update:delete own notes --- Final_Task.md | 75 +++++++++++---------- Homework-5_Working-with-data.md | 114 -------------------------------- output.html | 2 +- 3 files changed, 38 insertions(+), 153 deletions(-) delete mode 100644 Homework-5_Working-with-data.md diff --git a/Final_Task.md b/Final_Task.md index 71b0025a..111096e2 100644 --- a/Final_Task.md +++ b/Final_Task.md @@ -4,21 +4,21 @@ You are proposed to implement Python RSS-reader using **python 3.9**. The task consists of few iterations. Do not start new iteration if the previous one is not implemented yet. ## Common requirements. -* ✅It is mandatory to use `argparse` module. -* ❗Codebase must be covered with unit tests with at least 50% coverage. It's a mandatory requirement. -* ✅Yor script should **not** require installation of other services such as mysql server, +* It is mandatory to use `argparse` module. +* Codebase must be covered with unit tests with at least 50% coverage. It's a mandatory requirement. +* Yor script should **not** require installation of other services such as mysql server, postgresql and etc. (except Iteration 6). If it does require such programs, they should be installed automatically by your script, without user doing anything. -* ✅In case of any mistakes utility should print human-readable. +* In case of any mistakes utility should print human-readable. error explanation. Exception tracebacks in stdout are prohibited in final version of application. -*✅Docstrings are mandatory for all methods, classes, functions and modules. -*✅ Code must correspond to `pep8` (use `pycodestyle` utility for self-check). +*Docstrings are mandatory for all methods, classes, functions and modules. +* Code must correspond to `pep8` (use `pycodestyle` utility for self-check). * You can set line length up to 120 symbols. -*✅ Commit messages should provide correct and helpful information about changes in commit. Messages like `Fix bug`, +*Commit messages should provide correct and helpful information about changes in commit. Messages like `Fix bug`, `Tried to make workable`, `Temp commit` and `Finally works` are prohibited. -* ✅All used third-party packages should be written in the `requirements.txt` file and in installation files (`setup.py`, `setup.cfg`, etc.). -* ✅You have to write a file with documentation. Everything must be documented: how to run scripts, how to run tests, how to install the library and etc. +*All used third-party packages should be written in the `requirements.txt` file and in installation files (`setup.py`, `setup.cfg`, etc.). +*You have to write a file with documentation. Everything must be documented: how to run scripts, how to run tests, how to install the library and etc. ## [Iteration 1] One-shot command-line RSS reader. RSS reader should be a command-line utility which receives [RSS](wikipedia.org/wiki/RSS) URL and prints results in human-readable format. @@ -28,19 +28,18 @@ You are free to choose format of the news console output. The textbox below prov ```shell $ rss_reader.py "https://news.yahoo.com/rss/" --limit 1 -✅Feed: Yahoo News - Latest News & Headlines +Feed: Yahoo News - Latest News & Headlines -✅Title: Nestor heads into Georgia after tornados damage Florida -✅Date: Sun, 20 Oct 2019 04:21:44 +0300 -✅Link: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html +Title: Nestor heads into Georgia after tornados damage Florida +Date: Sun, 20 Oct 2019 04:21:44 +0300 +Link: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html -✅[image 2: Nestor heads into Georgia after tornados damage Florida][2]Nestor raced across Georgia as a post-tropical cyclone late Saturday, hours after the former tropical storm spawned a tornado that damaged +[image 2: Nestor heads into Georgia after tornados damage Florida][2]Nestor raced across Georgia as a post-tropical cyclone late Saturday, hours after the former tropical storm spawned a tornado that damaged homes and a school in central Florida while sparing areas of the Florida Panhandle devastated one year earlier by Hurricane Michael. The storm made landfall Saturday on St. Vincent Island, a nature preserve off Florida's northern Gulf Coast in a lightly populated area of the state, the National Hurricane Center said. Nestor was expected to bring 1 to 3 inches of rain to drought-stricken inland areas on its march across a swath of the U.S. Southeast. - -❗Links: +Links: [1]: https://news.yahoo.com/wet-weekend-tropical-storm-warnings-131131925.html (link) [2]: http://l2.yimg.com/uu/api/res/1.2/Liyq2kH4HqlYHaS5BmZWpw--/YXBwaWQ9eXRhY2h5b247aD04Njt3PTEzMDs-/https://media.zenfs.com/en/ap.org/5ecc06358726cabef94585f99050f4f0 (image) @@ -53,10 +52,10 @@ usage: rss_reader.py [-h] [--version] [--json] [--verbose] [--limit LIMIT] Pure Python command-line RSS reader. -✅positional arguments: +positional arguments: source RSS URL -✅optional arguments: +optional arguments: -h, --help show this help message and exit --version Print version info --json Print result as JSON in stdout @@ -65,32 +64,32 @@ Pure Python command-line RSS reader. ``` -✅In case of using `--json` argument your utility should convert the news into [JSON](https://en.wikipedia.org/wiki/JSON) format. +In case of using `--json` argument your utility should convert the news into [JSON](https://en.wikipedia.org/wiki/JSON) format. You should come up with the JSON structure on you own and describe it in the README.md file for your repository or in a separate documentation file. -✅With the argument `--verbose` your program should print all logs in stdout. +With the argument `--verbose` your program should print all logs in stdout. ### Task clarification (I) -✅1) If `--version` option is specified app should _just print its version_ and stop. -✅2) User should be able to use `--version` option without specifying RSS URL. For example: +1) If `--version` option is specified app should _just print its version_ and stop. +2) User should be able to use `--version` option without specifying RSS URL. For example: ``` > python rss_reader.py --version "Version 1.4" ``` 3) The version is supposed to change with every iteration. -✅4) If `--limit` is not specified, then user should get _all_ available feed. -✅5) If `--limit` is larger than feed size then user should get _all_ available news. -✅6) `--verbose` should print logs _in the process_ of application running, _not after everything is done_. -✅7) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout_. -✅8) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout in JSON format_. +4) If `--limit` is not specified, then user should get _all_ available feed. +5) If `--limit` is larger than feed size then user should get _all_ available news. +6) `--verbose` should print logs _in the process_ of application running, _not after everything is done_. +7) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout_. +8) Make sure that your app **has no encoding issues** (meaning symbols like `'` and etc) when printing news to _stdout in JSON format_. 9) It is preferrable to have different custom exceptions for different situations(If needed). -✅10) The `--limit` argument should also affect JSON generation. +10) The `--limit` argument should also affect JSON generation. -## ❗[Iteration 2] Distribution. +## [Iteration 2] Distribution. * Utility should be wrapped into distribution package with `setuptools`. * This package should export CLI utility named `rss-reader`. @@ -115,23 +114,23 @@ as well as this: ## [Iteration 3] News caching. -✅The RSS news should be stored in a local storage while reading. The way and format of this storage you can choose yourself. -❗Please describe it in a separate section of README.md or in the documentation. +The RSS news should be stored in a local storage while reading. The way and format of this storage you can choose yourself. +Please describe it in a separate section of README.md or in the documentation. New optional argument `--date` must be added to your utility. It should take a date in `%Y%m%d` format. For example: `--date 20191020` Here date means actual *publishing date* not the date when you fetched the news. -✅The cashed news can be read with it. The new from the specified day will be printed out. +The cashed news can be read with it. The new from the specified day will be printed out. If the news are not found return an error. -✅If the `--date` argument is not provided, the utility should work like in the previous iterations. +If the `--date` argument is not provided, the utility should work like in the previous iterations. ### Task clarification (III) -❗1) Try to make your application crossplatform, meaning that it should work on both Linux and Windows. +1) Try to make your application crossplatform, meaning that it should work on both Linux and Windows. For example when working with filesystem, try to use `os.path` lib instead of manually concatenating file paths. -✅2) `--date` should **not** require internet connection to fetch news from local cache. -✅3) User should be able to use `--date` without specifying RSS source. For example: +2) `--date` should **not** require internet connection to fetch news from local cache. +3) User should be able to use `--date` without specifying RSS source. For example: ``` > python rss_reader.py --date 20191206 ...... @@ -141,9 +140,9 @@ Or for second iteration (when installed using setuptools): > rss_reader --date 20191206 ...... ``` -❗4) If `--date` specified _together with RSS source_, then app should get news _for this date_ from local cache that _were fetched from specified source_. +4) If `--date` specified _together with RSS source_, then app should get news _for this date_ from local cache that _were fetched from specified source_. -✅5) `--date` should work correctly with both `--json`, `--limit`, `--verbose` and their different combinations. +5) `--date` should work correctly with both `--json`, `--limit`, `--verbose` and their different combinations. ## [Iteration 4] Format converter. diff --git a/Homework-5_Working-with-data.md b/Homework-5_Working-with-data.md deleted file mode 100644 index b6a55c93..00000000 --- a/Homework-5_Working-with-data.md +++ /dev/null @@ -1,114 +0,0 @@ -# Python Practice - Session 4 - - -### Task 4.1 -Open file `data/unsorted_names.txt` in data folder. Sort the names and write them to a new file called `sorted_names.txt`. Each name should start with a new line as in the following example: - -``` -Adele -Adrienne -... -Willodean -Xavier -``` - -### Task 4.2 -Implement a function which search for most common words in the file. -Use `data/lorem_ipsum.txt` file as a example. - -```python -def most_common_words(filepath, number_of_words=3): - pass - -print(most_common_words('lorem_ipsum.txt')) ->>> ['donec', 'etiam', 'aliquam'] -``` - -> NOTE: Remember about dots, commas, capital letters etc. - -### Task 4.3 -File `data/students.csv` stores information about students in [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) format. -This file contains the student’s names, age and average mark. -1) Implement a function which receives file path and returns names of top performer students -```python -def get_top_performers(file_path, number_of_top_students=5): - pass - -print(get_top_performers("students.csv")) ->>> ['Teresa Jones', 'Richard Snider', 'Jessica Dubose', 'Heather Garcia', 'Joseph Head'] -``` - -2) Implement a function which receives the file path with srudents info and writes CSV student information to the new file in descending order of age. -Result: -``` -student name,age,average mark -Verdell Crawford,30,8.86 -Brenda Silva,30,7.53 -... -Lindsey Cummings,18,6.88 -Raymond Soileau,18,7.27 -``` - -### Task 4.4 -Look through file `modules/legb.py`. - -1) Find a way to call `inner_function` without moving it from inside of `enclosed_function`. - -2.1) Modify ONE LINE in `inner_function` to make it print variable 'a' from global scope. - -2.2) Modify ONE LINE in `inner_function` to make it print variable 'a' form enclosing function. - -### Task 4.5 -Implement a decorator `remember_result` which remembers last result of function it decorates and prints it before next call. - -```python -@remember_result -def sum_list(*args): - result = "" - for item in args: - result += item - print(f"Current result = '{result}'") - return result - -sum_list("a", "b") ->>> "Last result = 'None'" ->>> "Current result = 'ab'" -sum_list("abc", "cde") ->>> "Last result = 'ab'" ->>> "Current result = 'abccde'" -sum_list(3, 4, 5) ->>> "Last result = 'abccde'" ->>> "Current result = '12'" -``` - -### Task 4.6 -Implement a decorator `call_once` which runs a function or method once and caches the result. -All consecutive calls to this function should return cached result no matter the arguments. - -```python -@call_once -def sum_of_numbers(a, b): - return a + b - -print(sum_of_numbers(13, 42)) ->>> 55 -print(sum_of_numbers(999, 100)) ->>> 55 -print(sum_of_numbers(134, 412)) ->>> 55 -print(sum_of_numbers(856, 232)) ->>> 55 -``` - - -### Task 4.7* -Run the module `modules/mod_a.py`. Check its result. Explain why does this happen. -Try to change x to a list `[1,2,3]`. Explain the result. -Try to change import to `from x import *` where x - module names. Explain the result. - - -### Materials -* [Decorators](https://realpython.com/primer-on-python-decorators/) -* [Decorators in python](https://www.geeksforgeeks.org/decorators-in-python/) -* [Python imports](https://pythonworld.ru/osnovy/rabota-s-modulyami-sozdanie-podklyuchenie-instrukciyami-import-i-from.html) -* [Files in python](https://realpython.com/read-write-files-python/) diff --git a/output.html b/output.html index b6e44e59..0d218399 100644 --- a/output.html +++ b/output.html @@ -1 +1 @@ -
nameOnliner
size1
title
  • �������� � 1 ���� ������ ���������� ����� ��� ������� ������
pubDate
  • Thu, 30 Jun 2022 19:26:28 +0300
description
  • � 1 ���� �� 31 ������� �������� ������ ���������� ����� ��� ������� ������. �� ���� ��������� ���������-������ ������������ ��������.������ �����
link
  • https://people.onliner.by/2022/06/30/belarus-s-1-iyulya-vvodit-bezvizovyj-vezd-dlya-grazhdan-polshi
\ No newline at end of file +
nameOnliner
size1
title
  • 1
pubDate
  • Thu, 30 Jun 2022 19:26:28 +0300
description
  • 1 31 . - .
link
  • https://people.onliner.by/2022/06/30/belarus-s-1-iyulya-vvodit-bezvizovyj-vezd-dlya-grazhdan-polshi
\ No newline at end of file