From 2711f0ba1d08e28640653a5bfea1d0ca2b076ecf Mon Sep 17 00:00:00 2001 From: Skvm Date: Wed, 16 Aug 2017 19:19:48 +0100 Subject: [PATCH 1/6] Update requirements.txt 26_stock_scraper requires lxml --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 2ad222b..beee86c 100755 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ beautifulsoup4==4.4.1 PyYAML==3.11 requests==2.12.4 wheel==0.24.0 +lxml==3.8.0 From 49153f1cd98ca9bd0102db41c010d76780fa7222 Mon Sep 17 00:00:00 2001 From: chetanya-shrimali Date: Sat, 16 Sep 2017 21:05:46 +0530 Subject: [PATCH 2/6] added license --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6f2e061 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Chetanya-Shrimali + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From b060e39b6111c41e3d5cef906ffb138726875f00 Mon Sep 17 00:00:00 2001 From: Chetanya-Shrimali Date: Sat, 16 Sep 2017 21:09:03 +0530 Subject: [PATCH 3/6] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 6f2e061..2ae0d76 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Chetanya-Shrimali +Copyright (c) 2017 realpython Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 8eb073544ac2d5866c2f86528c03b11409eec1cd Mon Sep 17 00:00:00 2001 From: Michael Herman Date: Sat, 16 Sep 2017 09:47:51 -0600 Subject: [PATCH 4/6] Update TODO.md --- TODO.md | 1 - 1 file changed, 1 deletion(-) diff --git a/TODO.md b/TODO.md index 9358b94..9d2dfea 100644 --- a/TODO.md +++ b/TODO.md @@ -3,4 +3,3 @@ 1. Add support for Python 2.7, 3.5, and 3.6 1. Organize docs and folder structure better 1. Add all scripts to single CLI for easy running, testing, and searching -1. Add License From 5b745282a923bee43b1bd3ee972a2351637b45ae Mon Sep 17 00:00:00 2001 From: uttamo Date: Thu, 28 Sep 2017 01:02:29 +0100 Subject: [PATCH 5/6] Use random.choice instead of random.randint random.choice is better for selecting random elements from a list than using random.randint to generate random indices to select --- scripts/13_random_name_generator.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/13_random_name_generator.py b/scripts/13_random_name_generator.py index 6f0a00a..0acb9bf 100755 --- a/scripts/13_random_name_generator.py +++ b/scripts/13_random_name_generator.py @@ -1,4 +1,4 @@ -from random import randint +from random import choice def random_name_generator(first, second, x): @@ -10,13 +10,8 @@ def random_name_generator(first, second, x): - number of random names """ names = [] - for i in range(0, int(x)): - random_first = randint(0, len(first)-1) - random_last = randint(0, len(second)-1) - names.append("{0} {1}".format( - first[random_first], - second[random_last]) - ) + for i in range(x): + names.append("{0} {1}".format(choice(first), choice(second))) return set(names) From cb448c2dc3593dbfbe1ca47b49193b320115aae5 Mon Sep 17 00:00:00 2001 From: Michael Herman Date: Sun, 25 Mar 2018 08:56:49 -0600 Subject: [PATCH 6/6] updated readme --- LICENSE | 2 +- readme.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2ae0d76..3a6fa11 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 realpython +Copyright (c) 2018 Real Python Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/readme.md b/readme.md index 59d5c64..78f4a72 100755 --- a/readme.md +++ b/readme.md @@ -32,4 +32,5 @@ 1. **30_fullcontact.py**: Call the [FullcContact](https://www.fullcontact.com/developer/) API 1. **31_youtube_sentiment.py**: Calculate sentiment score from the comments of a Youtube video 1. **32_stock_scraper.py**: Get stock prices +1. **33_country_code.py**: Convert country code to country name 1. **34_git_all_repos.py**: Clone all repositories from a public user or organization on Github. Usage: `python git_all_repos.py users USER_NAME` or `python git_all_repos.py orgs ORG_NAME`