|
| https://realpython.com/ |
| Start Here | https://realpython.com/start-here/ |
|
Learn Python
| https://realpython.com/lessons/working-json-data-python/ |
| Python Tutorials →In-depth articles and video courses | https://realpython.com/search?kind=article&kind=course&order=newest |
| Learning Paths →Guided study plans for accelerated learning | https://realpython.com/learning-paths/ |
| Quizzes & Exercises →Check your learning progress | https://realpython.com/quizzes/ |
| Browse Topics →Focus on a specific area or skill level | https://realpython.com/tutorials/all/ |
| Community Chat →Learn with other Pythonistas | https://realpython.com/community/ |
| Office Hours →Live Q&A calls with Python experts | https://realpython.com/office-hours/ |
| Podcast →Hear what’s new in the world of Python | https://realpython.com/podcasts/rpp/ |
| Books →Round out your knowledge and learn offline | https://realpython.com/products/books/ |
| Reference →Concise definitions for common Python terms | https://realpython.com/ref/ |
| Code Mentor →BetaPersonalized code assistance & learning tools | https://realpython.com/mentor/ |
| Unlock All Content → | https://realpython.com/account/join/ |
|
More
| https://realpython.com/lessons/working-json-data-python/ |
| Learner Stories | https://realpython.com/learner-stories/ |
| Python Newsletter | https://realpython.com/newsletter/ |
| Python Job Board | https://www.pythonjobshq.com |
| Meet the Team | https://realpython.com/team/ |
| Become a Tutorial Writer | https://realpython.com/write-for-us/ |
| Become a Video Instructor | https://realpython.com/become-an-instructor/ |
| Search | https://realpython.com/search |
| https://realpython.com/search |
| Join | https://realpython.com/account/join/ |
| Sign‑In | https://realpython.com/account/login/?next=%2Flessons%2Fworking-json-data-python%2F |
| Unlock This Lesson | https://realpython.com/account/join/?utm_source=rp_lesson&utm_content=working-json-data-python |
| Unlock This Lesson | https://realpython.com/account/join/?utm_source=rp_lesson&utm_content=working-json-data-python |
| https://realpython.com/courses/working-json-data-python/#team |
| Working With JSON in Python | https://realpython.com/courses/working-json-data-python/ |
| Austin Cepalia | https://realpython.com/courses/working-json-data-python/#team |
| Recommended Tutorial | https://realpython.com/python-json/ |
| Ask a Question | https://realpython.com/lessons/working-json-data-python/#discussion |
| https://realpython.com/feedback/survey/course/working-json-data-python/liked/?from=lesson-title |
| https://realpython.com/feedback/survey/course/working-json-data-python/disliked/?from=lesson-title |
| Contents | https://realpython.com/lessons/working-json-data-python/#description |
| Transcript | https://realpython.com/lessons/working-json-data-python/#transcript |
| Discussion (16) | https://realpython.com/lessons/working-json-data-python/#discussion |
| jsonplaceholder.typicode.com/todos | https://jsonplaceholder.typicode.com/todos |
| 00:00 | https://realpython.com/lessons/working-json-data-python/#t=0.51 |
| Welcome back to our series on working with JSON data in Python. In this | https://realpython.com/lessons/working-json-data-python/#t=0.51 |
| video, we’re going to work with a larger set of JSON data | https://realpython.com/lessons/working-json-data-python/#t=4.83 |
| and we’ll see how we can manipulate the data to derive some meaning from it. | https://realpython.com/lessons/working-json-data-python/#t=8.64 |
| 00:13 | https://realpython.com/lessons/working-json-data-python/#t=13.53 |
| To get our JSON data I’ll use JSONPlaceholder, | https://realpython.com/lessons/working-json-data-python/#t=13.53 |
| which is a public API that exposes large sets of JSON data for testing and | https://realpython.com/lessons/working-json-data-python/#t=17.43 |
| prototyping purposes. Just like usual, | https://realpython.com/lessons/working-json-data-python/#t=22.86 |
| we’ll start by importing the json module | https://realpython.com/lessons/working-json-data-python/#t=26.37 |
| but we’ll also need to import another module named requests. | https://realpython.com/lessons/working-json-data-python/#t=29.13 |
| 00:33 | https://realpython.com/lessons/working-json-data-python/#t=33.48 |
| This will allow us to get JSON data from the JSONPlaceholder API | https://realpython.com/lessons/working-json-data-python/#t=33.48 |
| in the form of a web request. Now we need to actually make the request. | https://realpython.com/lessons/working-json-data-python/#t=38.4 |
| We’ll create a new variable called response, | https://realpython.com/lessons/working-json-data-python/#t=43.05 |
| which will hold the response from the web server. | https://realpython.com/lessons/working-json-data-python/#t=45.81 |
| 00:48 | https://realpython.com/lessons/working-json-data-python/#t=48.45 |
| We’ll get that using requests.get() | https://realpython.com/lessons/working-json-data-python/#t=48.45 |
| and we’ll pass in this web address right here, | https://realpython.com/lessons/working-json-data-python/#t=51.48 |
| which contains a TODO list of 200 items formatted in JSON format. To actually | https://realpython.com/lessons/working-json-data-python/#t=54.3 |
| obtain a Python list from this JSON data, | https://realpython.com/lessons/working-json-data-python/#t=60.63 |
| we’ll create another variable called todos and we’ll use the loads() method from | https://realpython.com/lessons/working-json-data-python/#t=63.99 |
| before, passing in response.text. | https://realpython.com/lessons/working-json-data-python/#t=69.03 |
| 01:12 | https://realpython.com/lessons/working-json-data-python/#t=72.39 |
| response.text will get us the content of our web request, | https://realpython.com/lessons/working-json-data-python/#t=72.39 |
| which is a string containing all of the JSON data. | https://realpython.com/lessons/working-json-data-python/#t=76.41 |
| And that’s why we’re using the loads() method—because we’re reading from a | https://realpython.com/lessons/working-json-data-python/#t=79.53 |
| string, not a file object. Just to show that this works, | https://realpython.com/lessons/working-json-data-python/#t=83.19 |
| I’ll print out the first two items in our list with print(todos[:2]). | https://realpython.com/lessons/working-json-data-python/#t=87.72 |
| 01:35 | https://realpython.com/lessons/working-json-data-python/#t=95.76 |
| If I right-click and run the code, | https://realpython.com/lessons/working-json-data-python/#t=95.76 |
| we’ll see that on the right side of the screen, | https://realpython.com/lessons/working-json-data-python/#t=98.01 |
| we have the first two TODO items that is exposed by the API. | https://realpython.com/lessons/working-json-data-python/#t=99.81 |
| Each TODO item is a Python dictionary with keys and values. | https://realpython.com/lessons/working-json-data-python/#t=105.3 |
| 01:50 | https://realpython.com/lessons/working-json-data-python/#t=110.04 |
| Notice that each TODO object contains a 'userId' representing the user assigned | https://realpython.com/lessons/working-json-data-python/#t=110.04 |
| to this TODO; an 'id', which is used to label the | https://realpython.com/lessons/working-json-data-python/#t=114.99 |
| TODO; a 'title' describing it; and finally, whether or not the | https://realpython.com/lessons/working-json-data-python/#t=118.89 |
| TODO is completed. | https://realpython.com/lessons/working-json-data-python/#t=123.33 |
| 02:04 | https://realpython.com/lessons/working-json-data-python/#t=124.98 |
| We’re going to make use of all of this data except for the 'title'. | https://realpython.com/lessons/working-json-data-python/#t=124.98 |
| Now, we don’t want to see the data—we want to actually manipulate it. | https://realpython.com/lessons/working-json-data-python/#t=128.789 |
| So let’s just delete this print statement here. | https://realpython.com/lessons/working-json-data-python/#t=132.78 |
| 02:15 | https://realpython.com/lessons/working-json-data-python/#t=135.72 |
| We want to figure out which users have completed the most TODO items. | https://realpython.com/lessons/working-json-data-python/#t=135.72 |
| We’ll start by creating a new dictionary called todos_by_user, | https://realpython.com/lessons/working-json-data-python/#t=140.73 |
| which will map each 'userId' to the number of TODOs that they have completed. | https://realpython.com/lessons/working-json-data-python/#t=145.8 |
| 02:31 | https://realpython.com/lessons/working-json-data-python/#t=151.14 |
| Now, we actually have to compute that. So on a new line, | https://realpython.com/lessons/working-json-data-python/#t=151.14 |
| we’ll type for todo in todos:, | https://realpython.com/lessons/working-json-data-python/#t=154.77 |
| which will iterate through our todos list. | https://realpython.com/lessons/working-json-data-python/#t=158.07 |
| 02:41 | https://realpython.com/lessons/working-json-data-python/#t=161.07 |
| And we’ll say if todo["completed"]:—so here we’re checking | https://realpython.com/lessons/working-json-data-python/#t=161.07 |
| if the "completed" key has a value of True. | https://realpython.com/lessons/working-json-data-python/#t=165.27 |
| And then we will wrap the following logic in a try block. We’ll say, | https://realpython.com/lessons/working-json-data-python/#t=168.42 |
| “Get the user’s count in a dictionary with this code right here.” | https://realpython.com/lessons/working-json-data-python/#t=173.16 |
| And we’ll increment it by 1. | https://realpython.com/lessons/working-json-data-python/#t=177.12 |
| 02:59 | https://realpython.com/lessons/working-json-data-python/#t=179.23 |
| Our dictionary is going to represent the users by their "userId", | https://realpython.com/lessons/working-json-data-python/#t=179.23 |
| which is why we’re accessing the value of the "userId" key in this todo | https://realpython.com/lessons/working-json-data-python/#t=183.19 |
| dictionary. But if the user is not already present in our dictionary, | https://realpython.com/lessons/working-json-data-python/#t=187.42 |
| we’ll see a KeyError, | https://realpython.com/lessons/working-json-data-python/#t=192.58 |
| and so we’ll need to catch that by typing except KeyError: | https://realpython.com/lessons/working-json-data-python/#t=193.84 |
| and then we’ll create a new user in the dictionary, setting their completed | https://realpython.com/lessons/working-json-data-python/#t=198.37 |
| TODOs count to 1. At this point, | https://realpython.com/lessons/working-json-data-python/#t=202.75 |
| we’ve got a dictionary that maps each 'userId' to the number of items they’ve | https://realpython.com/lessons/working-json-data-python/#t=206.08 |
| completed. | https://realpython.com/lessons/working-json-data-python/#t=210.58 |
| 03:31 | https://realpython.com/lessons/working-json-data-python/#t=211.87 |
| Now we have to determine what the highest number of completed items is, as well | https://realpython.com/lessons/working-json-data-python/#t=211.87 |
| as who’s completed that many items. | https://realpython.com/lessons/working-json-data-python/#t=216.73 |
| This code I’m typing now is going to create a new list of tuples with each | https://realpython.com/lessons/working-json-data-python/#t=219.52 |
| tuple containing the person as well as how many items they’ve computed. | https://realpython.com/lessons/working-json-data-python/#t=224.02 |
| 03:48 | https://realpython.com/lessons/working-json-data-python/#t=228.7 |
| The tuples will be sorted in descending order by the number of items completed. | https://realpython.com/lessons/working-json-data-python/#t=228.7 |
| 03:53 | https://realpython.com/lessons/working-json-data-python/#t=233.95 |
| And now all we have to do is get the second value in the first tuple in the | https://realpython.com/lessons/working-json-data-python/#t=233.95 |
| list, and this will represent the maximum number of items completed. | https://realpython.com/lessons/working-json-data-python/#t=238.36 |
| We’ll type max_complete = top_users, | https://realpython.com/lessons/working-json-data-python/#t=243.16 |
| first index, second item. In order to determine which users have this completed | https://realpython.com/lessons/working-json-data-python/#t=249.07 |
| count, I’ll first define a new list called users, | https://realpython.com/lessons/working-json-data-python/#t=255.16 |
| which will hold the users that we discover. Now, | https://realpython.com/lessons/working-json-data-python/#t=258.88 |
| we’ll say for user, num_complete in top_users:— | https://realpython.com/lessons/working-json-data-python/#t=262.36 |
| so now we’re iterating over the list of tuples. We’ll type | https://realpython.com/lessons/working-json-data-python/#t=268.84 |
| if num_complete < max_complete: | https://realpython.com/lessons/working-json-data-python/#t=272.83 |
| then break. Otherwise, append a string representation of our user ID to the users | https://realpython.com/lessons/working-json-data-python/#t=277.24 |
| list. | https://realpython.com/lessons/working-json-data-python/#t=284.14 |
| 04:45 | https://realpython.com/lessons/working-json-data-python/#t=285.67 |
| Then we’ll create a new string that tells us what users have completed the most | https://realpython.com/lessons/working-json-data-python/#t=285.67 |
| TODOs. | https://realpython.com/lessons/working-json-data-python/#t=290.8 |
| We’ll call this max_users and we’ll take the string " and " padded with | https://realpython.com/lessons/working-json-data-python/#t=292.09 |
| space and .join() it with our list of users. Finally, | https://realpython.com/lessons/working-json-data-python/#t=297.52 |
| we’ll print the f-string f"user(s) {max_users} completed {max_complete} TODOs". | https://realpython.com/lessons/working-json-data-python/#t=302.05 |
| 05:10 | https://realpython.com/lessons/working-json-data-python/#t=310.96 |
| So now when we run this code, | https://realpython.com/lessons/working-json-data-python/#t=310.96 |
| we’ll see user(s) 5 and 10 completed 12 TODOs. | https://realpython.com/lessons/working-json-data-python/#t=313.36 |
| If you’d like, | https://realpython.com/lessons/working-json-data-python/#t=317.89 |
| you can verify that this is correct by heading to the web address at the top of | https://realpython.com/lessons/working-json-data-python/#t=318.88 |
| our file and viewing the JSON data for yourself. | https://realpython.com/lessons/working-json-data-python/#t=323.05 |
| 05:26 | https://realpython.com/lessons/working-json-data-python/#t=326.65 |
| Now for our final task, | https://realpython.com/lessons/working-json-data-python/#t=326.65 |
| let’s create a JSON file that contains all of the completed TODOs for each | https://realpython.com/lessons/working-json-data-python/#t=328.96 |
| of these users. At this point, we have the data for all of the | https://realpython.com/lessons/working-json-data-python/#t=333.4 |
| TODO items as well as the two users who have completed the most, | https://realpython.com/lessons/working-json-data-python/#t=337.48 |
| so we can do this. When we’re done, | https://realpython.com/lessons/working-json-data-python/#t=341.8 |
| we should have a JSON file containing only the | https://realpython.com/lessons/working-json-data-python/#t=344.17 |
| TODO items completed by users 5 and 10. | https://realpython.com/lessons/working-json-data-python/#t=346.69 |
| 05:50 | https://realpython.com/lessons/working-json-data-python/#t=350.83 |
| We’ll start by defining a new function | https://realpython.com/lessons/working-json-data-python/#t=350.83 |
| keep(), which will take a single todo object as its parameter. | https://realpython.com/lessons/working-json-data-python/#t=353.05 |
| Remember: this todo object is now a Python dictionary representing a single | https://realpython.com/lessons/working-json-data-python/#t=357.77 |
| TODO item, and we obtain that through deserialization. | https://realpython.com/lessons/working-json-data-python/#t=363.18 |
| 06:08 | https://realpython.com/lessons/working-json-data-python/#t=368.06 |
| This function will be used to filter out all of the | https://realpython.com/lessons/working-json-data-python/#t=368.06 |
| TODO items that were not completed by either of the top users. | https://realpython.com/lessons/working-json-data-python/#t=370.55 |
| 06:15 | https://realpython.com/lessons/working-json-data-python/#t=375.29 |
| First, we have to figure out if the item is even completed, | https://realpython.com/lessons/working-json-data-python/#t=375.29 |
| so we’ll say is_complete = todo["completed"]. | https://realpython.com/lessons/working-json-data-python/#t=378.5 |
| 06:24 | https://realpython.com/lessons/working-json-data-python/#t=384.59 |
| Then, we’ll see if this item was assigned to one of the top two users, | https://realpython.com/lessons/working-json-data-python/#t=384.59 |
| so we’ll write | https://realpython.com/lessons/working-json-data-python/#t=389.03 |
| has_max_count = todo["userId"] in users. | https://realpython.com/lessons/working-json-data-python/#t=390.35 |
| users is a list of users 5 and 10, | https://realpython.com/lessons/working-json-data-python/#t=398.75 |
| so we’re looking to see if this item was assigned to either of those people. | https://realpython.com/lessons/working-json-data-python/#t=401.93 |
| 06:46 | https://realpython.com/lessons/working-json-data-python/#t=406.46 |
| Finally, | https://realpython.com/lessons/working-json-data-python/#t=406.46 |
| we’ll return is_complete and has_max_count, since both of these Booleans need to | https://realpython.com/lessons/working-json-data-python/#t=407.15 |
| be True in order for the todo item to stay in our list. | https://realpython.com/lessons/working-json-data-python/#t=413.06 |
| 06:57 | https://realpython.com/lessons/working-json-data-python/#t=417.11 |
| Now that we have our filtering function, | https://realpython.com/lessons/working-json-data-python/#t=417.11 |
| we can write some JSON data to a file. Just like before | https://realpython.com/lessons/working-json-data-python/#t=419.15 |
| we’ll say with open("filtered_data_file.json") | https://realpython.com/lessons/working-json-data-python/#t=422.42 |
| but now we’ll give it the argument "w" to tell Python we want to write to this | https://realpython.com/lessons/working-json-data-python/#t=428.33 |
| file. And we’ll give it the identifier data_file. Inside the with block, | https://realpython.com/lessons/working-json-data-python/#t=432.17 |
| I want to obtain a list of only the items that were completed by users 5 and 10, | https://realpython.com/lessons/working-json-data-python/#t=438.68 |
| so I’ll say filtered_todos = list() | https://realpython.com/lessons/working-json-data-python/#t=443.72 |
| and then we’ll call the filter() function with our filter function keep | https://realpython.com/lessons/working-json-data-python/#t=448.61 |
| and our todos list, which contains all of the TODO items. | https://realpython.com/lessons/working-json-data-python/#t=453.5 |
| 07:38 | https://realpython.com/lessons/working-json-data-python/#t=458.15 |
| Now that we’ve got this list, we can say json.dump() | https://realpython.com/lessons/working-json-data-python/#t=458.15 |
| and we’ll keep it the list of filtered_todos and the data_file we’re writing to. | https://realpython.com/lessons/working-json-data-python/#t=462.2 |
| 07:47 | https://realpython.com/lessons/working-json-data-python/#t=467.09 |
| And finally, an indentation level of 2, which will make it easier to read. | https://realpython.com/lessons/working-json-data-python/#t=467.09 |
| And that’s all we need to do for this program! | https://realpython.com/lessons/working-json-data-python/#t=472.22 |
| If we right-click here and we choose Run Code, | https://realpython.com/lessons/working-json-data-python/#t=475.34 |
| we’ll see our expected output: user(s) 5 and 10 completed 12 TODOs. | https://realpython.com/lessons/working-json-data-python/#t=478.46 |
| 08:04 | https://realpython.com/lessons/working-json-data-python/#t=484.1 |
| But if we head over to our new JSON file that’s been created, | https://realpython.com/lessons/working-json-data-python/#t=484.1 |
| you’ll notice that we have a problem. It’s empty, | https://realpython.com/lessons/working-json-data-python/#t=487.94 |
| but it’s supposed to have all of the items completed by users 5 and 10, | https://realpython.com/lessons/working-json-data-python/#t=491.75 |
| since they’ve completed the greatest amount of items. | https://realpython.com/lessons/working-json-data-python/#t=496.13 |
| 08:19 | https://realpython.com/lessons/working-json-data-python/#t=499.16 |
| So let’s head back to our code here and start the debugging process. | https://realpython.com/lessons/working-json-data-python/#t=499.16 |
| I will say the bug in this program has nothing to do with the JSON | https://realpython.com/lessons/working-json-data-python/#t=503.18 |
| serialization or deserialization, | https://realpython.com/lessons/working-json-data-python/#t=506.99 |
| so I would encourage you to pause the video and step through this code with your | https://realpython.com/lessons/working-json-data-python/#t=509.72 |
| favorite debugger. Personally, I like the Visual Studio debugger, | https://realpython.com/lessons/working-json-data-python/#t=513.53 |
| so I’m going to use that. | https://realpython.com/lessons/working-json-data-python/#t=517.73 |
| 08:39 | https://realpython.com/lessons/working-json-data-python/#t=519.65 |
| Now we know everything up until our print statement is working because we got | https://realpython.com/lessons/working-json-data-python/#t=519.65 |
| the right print() output in the console, | https://realpython.com/lessons/working-json-data-python/#t=524.27 |
| so let’s safely ignore all that. I suspect the issue is in our filtering | https://realpython.com/lessons/working-json-data-python/#t=526.28 |
| function. I think it might be filtering everything out of our TODO list, | https://realpython.com/lessons/working-json-data-python/#t=530.9 |
| which is why no data is actually getting serialized. | https://realpython.com/lessons/working-json-data-python/#t=535.77 |
| 08:59 | https://realpython.com/lessons/working-json-data-python/#t=539.34 |
| I’m going to set a breakpoint on the last line in the function, | https://realpython.com/lessons/working-json-data-python/#t=539.34 |
| and then I will start the program with debugging. | https://realpython.com/lessons/working-json-data-python/#t=543.6 |
| Now that we’re stopped here on the return line, | https://realpython.com/lessons/working-json-data-python/#t=547.17 |
| we could sit here and step through each item until the bug reveals itself, | https://realpython.com/lessons/working-json-data-python/#t=549.6 |
| but I’ll save you the hassle and I’ll just tell you what it is. | https://realpython.com/lessons/working-json-data-python/#t=553.65 |
| 09:17 | https://realpython.com/lessons/working-json-data-python/#t=557.49 |
| If we hover over the users variable here, | https://realpython.com/lessons/working-json-data-python/#t=557.49 |
| we can see that users 5 and 10 are represented as strings. That’s because we | https://realpython.com/lessons/working-json-data-python/#t=560.37 |
| appended the users as strings earlier so that we could print them out in a nice | https://realpython.com/lessons/working-json-data-python/#t=565.86 |
| formatted manner. But if I hover over todo here, | https://realpython.com/lessons/working-json-data-python/#t=570.24 |
| notice that 'userId' is actually an int. Right now, we’re asking Python if an | https://realpython.com/lessons/working-json-data-python/#t=574.29 |
| integer is in a list of strings, | https://realpython.com/lessons/working-json-data-python/#t=579.75 |
| and so has_max_count is always set to False, | https://realpython.com/lessons/working-json-data-python/#t=582.3 |
| even when we’re comparing the integer 5 to the string '5'. | https://realpython.com/lessons/working-json-data-python/#t=585.78 |
| 09:50 | https://realpython.com/lessons/working-json-data-python/#t=590.1 |
| There’s a few different ways we can fix this, | https://realpython.com/lessons/working-json-data-python/#t=590.1 |
| but the easiest is just to convert this to a string | https://realpython.com/lessons/working-json-data-python/#t=591.99 |
| before we compare it. This way, | https://realpython.com/lessons/working-json-data-python/#t=595.53 |
| we’re comparing two strings and not an integer and a string, | https://realpython.com/lessons/working-json-data-python/#t=597.78 |
| which will always be False. | https://realpython.com/lessons/working-json-data-python/#t=601.83 |
| 10:03 | https://realpython.com/lessons/working-json-data-python/#t=603.93 |
| And now if I stop the debugger and I run this code again, | https://realpython.com/lessons/working-json-data-python/#t=603.93 |
| we should see that we still have our correct console output, | https://realpython.com/lessons/working-json-data-python/#t=608.13 |
| but if we head over to the JSON file, | https://realpython.com/lessons/working-json-data-python/#t=611.55 |
| we have all of the items that users 5 and 10 have completed. | https://realpython.com/lessons/working-json-data-python/#t=614.49 |
| 10:18 | https://realpython.com/lessons/working-json-data-python/#t=618.75 |
| Fortunately for us, that wasn’t too hard of a bug to find. In the next video, | https://realpython.com/lessons/working-json-data-python/#t=618.75 |
| we’ll take a look at how we can encode custom Python objects or otherwise | https://realpython.com/lessons/working-json-data-python/#t=623.43 |
| non-serializable types into JSON format. | https://realpython.com/lessons/working-json-data-python/#t=628.09 |
| May 11, 2019 | https://realpython.com/lessons/working-json-data-python/#comment-d1cd9b69-cde4-4699-9a44-09ae2e2ba6a7 |
| June 12, 2019 | https://realpython.com/lessons/working-json-data-python/#comment-75bef806-922c-40fd-9f0c-430ac602c2d2 |
| Nov. 12, 2019 | https://realpython.com/lessons/working-json-data-python/#comment-5cccc2a9-ec0d-41d9-8ef8-5d54048dfe11 |
| March 28, 2020 | https://realpython.com/lessons/working-json-data-python/#comment-938a1217-4813-4675-8341-dc56f2fc93a2 |
| April 24, 2020 | https://realpython.com/lessons/working-json-data-python/#comment-60cf7b59-b6af-472f-a5de-6ba4250087fa |
| May 7, 2020 | https://realpython.com/lessons/working-json-data-python/#comment-b005c11a-a129-4720-bef8-1ba2470929df |
| May 7, 2020 | https://realpython.com/lessons/working-json-data-python/#comment-10300798-0030-4b58-a647-a28481df42eb |
| Aug. 9, 2020 | https://realpython.com/lessons/working-json-data-python/#comment-841623fa-d11a-4b6c-9bd8-9eb15db6c502 |
| July 15, 2021 | https://realpython.com/lessons/working-json-data-python/#comment-01523f9b-e200-4ac0-9bdf-1b9e8dc16199 |
| July 16, 2021 | https://realpython.com/lessons/working-json-data-python/#comment-9ddc247c-2c30-49c3-96de-ea1088f73a39 |
| July 16, 2021 | https://realpython.com/lessons/working-json-data-python/#comment-edc744fc-fe8f-4075-a2a0-0890ec862c0a |
| @ravipgupta12 | https://realpython.com/lessons/working-json-data-python/#comment-5cccc2a9-ec0d-41d9-8ef8-5d54048dfe11 |
| @Ranit Pradhan | https://realpython.com/lessons/working-json-data-python/#comment-938a1217-4813-4675-8341-dc56f2fc93a2 |
| @J | https://realpython.com/lessons/working-json-data-python/#comment-b005c11a-a129-4720-bef8-1ba2470929df |
| Debugger | https://code.visualstudio.com/Docs/editor/debugging |
| @J | https://realpython.com/lessons/working-json-data-python/#comment-10300798-0030-4b58-a647-a28481df42eb |
| Python’s filter(): Extract Values From Iterables | https://realpython.com/python-filter-function/#getting-started-with-pythons-filter |
| @yaost | https://realpython.com/lessons/working-json-data-python/#comment-01523f9b-e200-4ac0-9bdf-1b9e8dc16199 |
| Sept. 1, 2021 | https://realpython.com/lessons/working-json-data-python/#comment-411c9d3d-1903-4e8b-b3bc-7f3161a18dbb |
| March 2, 2022 | https://realpython.com/lessons/working-json-data-python/#comment-8d2edcd0-7874-400e-9d0c-15fdb56e8d63 |
| May 27, 2023 | https://realpython.com/lessons/working-json-data-python/#comment-8b093332-da46-4ee1-8fbd-a89ad0c0bf3c |
| July 22, 2024 | https://realpython.com/lessons/working-json-data-python/#comment-2062e050-c481-41d5-b47b-3e40a4b940cf |
| March 17, 2025 | https://realpython.com/lessons/working-json-data-python/#comment-ef580a2a-020e-4123-a62b-c9d4d835fdb9 |
| Become a Member | https://realpython.com/account/join/ |
| https://realpython.com/lessons/deserializing-json-data/ |
| Overview | https://realpython.com/courses/working-json-data-python/ |
| https://realpython.com/lessons/json-custom-python-objects/ |
|
What Is JSON? 04:48
| https://realpython.com/videos/what-is-json/ |
|
Serializing JSON Data 04:39
| https://realpython.com/videos/serializing-json-data/ |
|
Deserializing JSON Data 03:04
| https://realpython.com/lessons/deserializing-json-data/ |
|
Working With JSON Data 10:34
| https://realpython.com/lessons/working-json-data-python/ |
|
JSON for Custom Python Objects 04:18
| https://realpython.com/lessons/json-custom-python-objects/ |
|
Encoding Custom Types to JSON 04:02
| https://realpython.com/lessons/encoding-custom-types-json/ |
|
Decoding Custom Types From JSON 04:59
| https://realpython.com/lessons/decoding-custom-types-json/ |
|
Working With JSON Data in Python (Quiz) 06:00
| https://realpython.com/lessons/working-with-json-data-in-python-quiz/ |
| Privacy Policy | https://realpython.com/privacy-policy/ |
Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover