text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
is that this has been standardized now | 3,645.839 | 5.361 |
as a python dictionary what indeed apple | 3,648.079 | 5.441 |
is returning is technically a json | 3,651.2 | 5.04 |
response javascript object notation but | 3,653.52 | 5.279 |
python the request library is converting | 3,656.24 | 5.28 |
it to a python dictionary which happens | 3,658.799 | 4.961 |
to use wonderfully coincidentally almost | 3,661.52 | 4.96 |
the same syntax it uses curly braces to | 3,663.76 | 4.48 |
represent the dictionary here and a | 3,666.48 | 3.44 |
closed curly brace to represent the end | 3,668.24 | 4.559 |
of it here for any lists therein it uses | 3,669.92 | 4.72 |
a square bracket here and a closed | 3,672.799 | 4.881 |
square bracket down here it uses quotes | 3,674.64 | 4.4 |
single quotes in this case or | 3,677.68 | 3.36 |
equivalently double quotes to represent | 3,679.04 | 5.039 |
the keys in that dictionary and after a | 3,681.04 | 6 |
colon it stores the value of that key | 3,684.079 | 4.72 |
and so you'll see that indeed we have a | 3,687.04 | 4.72 |
result count key whose value is one but | 3,688.799 | 5.201 |
then a more interesting result key | 3,691.76 | 4.96 |
called results whose value is this | 3,694 | 5.839 |
entire list of data now honestly this is | 3,696.72 | 4.96 |
such a big blob of text that it's going | 3,699.839 | 3.201 |
to take me forever to wrap my mind | 3,701.68 | 3.439 |
around what i'm seeing so let me propose | 3,703.04 | 4.64 |
temporarily we use another library in | 3,705.119 | 4.96 |
python that will allow me to format my | 3,707.68 | 4.8 |
data a little more cleanly it turns out | 3,710.079 | 4.72 |
that python also comes with a special | 3,712.48 | 4.96 |
library uh called json that allows you | 3,714.799 | 5.04 |
to manipulate json data and even just | 3,717.44 | 4.48 |
printing print it that is formatted in a | 3,719.839 | 3.441 |
way that's going to be way easier for | 3,721.92 | 3.439 |
you and i to understand so let me go | 3,723.28 | 4.64 |
back to my code here let me shrink my | 3,725.359 | 4 |
terminal window | 3,727.92 | 3.679 |
and let me propose that just temporarily | 3,729.359 | 4.72 |
again we do this let me import this | 3,731.599 | 4.48 |
additional library json which comes with | 3,734.079 | 3.601 |
python so i don't need to install it | 3,736.079 | 4.081 |
manually with pip and let me go ahead | 3,737.68 | 5.119 |
now and not just print out response.json | 3,740.16 | 4.56 |
which was that big blob of hard to | 3,742.799 | 4.161 |
understand text let me go ahead and use | 3,744.72 | 4.839 |
one other function here called | 3,746.96 | 6.72 |
json.dump s for dump string and pass to | 3,749.559 | 6.681 |
that function that response dot json | 3,753.68 | 4.399 |
return value so again i'm just | 3,756.24 | 4.319 |
introducing another function who i claim | 3,758.079 | 4.561 |
it has a purpose in life of pretty | 3,760.559 | 4.321 |
printing nicely formatting on the screen | 3,762.64 | 4.32 |
the exact same information i know this | 3,764.88 | 3.679 |
from the documentation having done this | 3,766.96 | 3.52 |
before but i'd like things to be nicely | 3,768.559 | 3.601 |
indented and according to the | 3,770.48 | 3.68 |
documentation if i pass in a named | 3,772.16 | 5.12 |
parameter of indent equals two that's | 3,774.16 | 4.72 |
going to indent everything at least two | 3,777.28 | 3.6 |
spaces i could do four or something else | 3,778.88 | 3.76 |
but it's going to be enough to help me | 3,780.88 | 4.08 |
wrap my mind around what the data is i'm | 3,782.64 | 4 |
getting back because again i'm just | 3,784.96 | 3.68 |
learning along with you so let me | 3,786.64 | 3.439 |
increase the size of my terminal window | 3,788.64 | 3.919 |
again let me run python of itunes.pi and | 3,790.079 | 4.24 |
again let's search for weezer and hit | 3,792.559 | 3.921 |
enter and now notice | 3,794.319 | 4 |
it's still a little bit cryptic because | 3,796.48 | 4.639 |
there's a lot going on here but my gosh | 3,798.319 | 5.681 |
i can totally read this more easily now | 3,801.119 | 4.96 |
notice now that i still see the first | 3,804 | 4.079 |
curly brace which means hey this is a | 3,806.079 | 4 |
dictionary in python a collection of | 3,808.079 | 4.72 |
keys and values the first key is called | 3,810.079 | 4.561 |
result count it happens to be displayed | 3,812.799 | 3.681 |
in double quotes now but that's just an | 3,814.64 | 3.28 |
issue of formatting it could be double | 3,816.48 | 3.359 |
or single so long as we're consistent | 3,817.92 | 5.04 |
the value of that key is one why well i | 3,819.839 | 5.28 |
told the url to only limit the responses | 3,822.96 | 4.079 |
to one weezer song so i've gotten a | 3,825.119 | 4.081 |
result set of one if i increase that | 3,827.039 | 4.721 |
limit i could probably get more then the | 3,829.2 | 4.159 |
interesting part of this response is | 3,831.76 | 3.88 |
really the data itself notice in the | 3,833.359 | 5.361 |
results key here there's a really big | 3,835.64 | 7.08 |
value the value is a python list as | 3,838.72 | 5.52 |
implied | 3,842.72 | 3.52 |
by this square bracket what does this | 3,844.24 | 4.48 |
list contain well i know from skimming | 3,846.24 | 4.48 |
it earlier that this contains one | 3,848.72 | 4.8 |
dictionary and that's why we see another | 3,850.72 | 4.8 |
curly brace here | 3,853.52 | 3.839 |
so again if this gets a little more | 3,855.52 | 3.36 |
complicated keep in mind that a | 3,857.359 | 4.081 |
dictionary is just a collection of key | 3,858.88 | 5.199 |
value pairs and python uses curly braces | 3,861.44 | 4.159 |
to indicate as much | 3,864.079 | 3.921 |
it is perfectly reasonable for a | 3,865.599 | 4.561 |
dictionary to be inside of another | 3,868 | 4.799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.