Part 1: Call the extract function, passing this URL to it:# https://hugovk.github.io/top-pypi-packages/top-pypi-packages-30-days.json # Part 2:# Add a function definition *in the appropriate place in...

1 answer below »
Part 1: Call the extract function, passing this URL to it:# https://hugovk.github.io/top-pypi-packages/top-pypi-packages-30-days.json
# Part 2:# Add a function definition *in the appropriate place in this script* that# takes the output of the extract function and displays the top packages# in a format something like this:## package,downloads# urllib3,154949320# botocore,132475500
# Part 3:# Duplicate the function from part 2, but instead of writing the# results to the screen, write them to a text file.


Answered Same DayJul 18, 2021

Answer To: Part 1: Call the extract function, passing this URL to it:#...

Nithin answered on Jul 19 2021
146 Votes
import requests
def extract(url=None):
"""Returns useful data from a source and returns a raw
data
object."""
try:
rawdata = requests.get(url).json()
except:
print("Your data object will be empty. Please enter a valid URL.")
rawdata = None

...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here