Python Tutorial: Working with JSON Data using the json Module

2024 ж. 13 Мам.
1 135 889 Рет қаралды

In this Python Programming Tutorial, we will be learning how to work with JSON data. We will learn how to load JSON into Python objects from strings and how to convert Python objects into JSON strings. We will also see how to load JSON from a file and save those Python objects back to files. Let's get started...
The code from this video can be found at:
github.com/CoreyMSchafer/code...
Python File Objects: • Python Tutorial: File ...
✅ Support My Channel Through Patreon:
/ coreyms
✅ Become a Channel Member:
/ @coreyms
✅ One-Time Contribution Through PayPal:
goo.gl/649HFY
✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
✅ Corey's Public Amazon Wishlist
a.co/inIyro1
✅ Equipment I Use and Books I Recommend:
www.amazon.com/shop/coreyschafer
▶️ You Can Find Me On:
My Website - coreyms.com/
My Second Channel - / coreymschafer
Facebook - / coreymschafer
Twitter - / coreymschafer
Instagram - / coreymschafer
#Python

Пікірлер
  • Your videos should be part of the official Python docs.

    @ibrahimal-mahfooz8737@ibrahimal-mahfooz87374 жыл бұрын
    • He truly is the best tutorial on the entire internet !!!!!!!!!

      @jairuskersey8311@jairuskersey83114 жыл бұрын
    • He truly is the best tutorial on the entire internet !!!!!!!!!

      @anshulkanwar1@anshulkanwar14 жыл бұрын
    • Bucky’s tutorials was best

      @guckesksk5895@guckesksk58954 жыл бұрын
    • Agree

      @moody54324@moody543243 жыл бұрын
    • J'ai enfin un script légitime que je fonctionne parfaitement via FRESKIEHACK sur Instagram

      @ifeanyiinnocentlazarus1403@ifeanyiinnocentlazarus14033 жыл бұрын
  • You are the best python teacher ever. Every single time I go through documentation to learn something, I feel confused. Every single time I type on youtube my problem, one of your videos shows up and I understand everything completely. You are a wonderful teacher. Thank you for your time!

    @nktslp3650@nktslp36504 жыл бұрын
    • I agree with you, the author tells us as clearly as possible

      @SueBeatMaker@SueBeatMaker Жыл бұрын
  • Gives me hope for humanity that people like Corey post this kind of elite educational content FOR FREE. Makes me happy. Coding, specifically in python is SO useful and surprisingly learnable with a good teacher like Corey. This man has literally helped hundreds of thousands of people with each video and he should be extremely proud of his work.

    @augurelite@augurelite2 жыл бұрын
    • Not really "elite" educational content. But it certainly is high quality information.

      @MrMutt111@MrMutt1116 ай бұрын
  • The best thing we get from Corey's tutorial is an easy explanation with a real-world example. THANKS A TON.

    @imtiazshahed944@imtiazshahed9444 жыл бұрын
  • I also loved the practical example at the end of the tutorial. Thank you!

    @haoyangrocks@haoyangrocks6 жыл бұрын
  • I tried the INR conversion and was surprised when you showed it :) You cover a lot and with clarity in short time - thanks Corey!

    @shobhamourya8396@shobhamourya83966 жыл бұрын
  • YES!!!!! This is exactly what I have been trying to do for over 2 weeks and couldn't work it out. A HUGE Thank you.

    @andrewbaillie2475@andrewbaillie24754 жыл бұрын
  • Thank you for being here for us and blessed be.

    @absolutedgefindout726@absolutedgefindout7265 жыл бұрын
  • Man, love the way Corey explains. His videos explain the fundamentals but with real practical demonstrations. Love you man

    @shihabkhan3218@shihabkhan32183 жыл бұрын
  • Wonderful tutorial Corey. I was able to turn it into an Action Learning project because you could covered so much in just 20 minutes with practical examples that someone with no python and json experience (but experienced in parsing data) could use to start using json and python in real world automation project. Truly a rare find, in thank you.

    @phillipsparks9690@phillipsparks96902 жыл бұрын
  • Corey, you are amazing! Thank you for your time and most of all, your being you, a person who has a good heart of sharing your knowledge. Your content shows your maturity in your field of expertise. More power to you!

    @monagulapa3022@monagulapa30224 жыл бұрын
  • You are the best....I've watched several tutorials of several topics, and I almost always had problems following them, with you it is different.

    @husainshaikh8724@husainshaikh87245 жыл бұрын
  • Pretty easy to follow. The best part is you've used real-world examples. Great tutorial!

    @beem124@beem1245 жыл бұрын
  • I read multiple blogs and was confused all along till I bumped into your video :). Thank you so much.

    @arpithamuthappa@arpithamuthappa3 жыл бұрын
  • Hey Corey, thank you for making this video. I was doing some stuff with mysql and json files and was browsing through the web and nothing seemed to work, but your video really did the trick. I hope you keep making such clear and useful videos.

    @ambarishkapil8004@ambarishkapil80044 жыл бұрын
  • It's 5 years later and you are still a real legend. Thank you.

    @johnprogrammer7164@johnprogrammer7164 Жыл бұрын
  • Man, this has been the most helpful straight to the point walk-through! Thank you!

    @anigasparyan3841@anigasparyan38412 жыл бұрын
  • Corey, thank you so much for all the amazing tutorials on Python! You not only explain the concepts but also give valid examples which make it easy to retain the concepts. I have definitely learnt a lot from them. Thanks again!

    @sampadakhandekar5383@sampadakhandekar53836 жыл бұрын
    • agreed, I also like to see the exploration of some of the options (if that is the right term) , sort, indent etc

      @davidreynolds9649@davidreynolds96496 жыл бұрын
    • J'ai enfin un script légitime que je fonctionne parfaitement via FRESKIEHACK sur Instagram

      @ifeanyiinnocentlazarus1403@ifeanyiinnocentlazarus14033 жыл бұрын
  • Been searching for a good tutorial online for JSON & Python and this hands down is the fastest and most understandable tutorial there is!

    @GabrielRodriguezInjectedFusion@GabrielRodriguezInjectedFusion4 жыл бұрын
  • Seriously, you are one of the best Python tutors online 👍🏻 Thank you for the video sir!

    @funrover90@funrover905 жыл бұрын
  • I was trying to view some json files from image data set, which were large and all in one line. I had no idea how to format it to human-readable format, and tried some awkward approaches to rearrange the big files. Now I watch your tutorial and realize that "load and then dump with indent" is what I needed. Thank you so much.

    @hiankun@hiankun4 жыл бұрын
  • I usually rarely comment on videos in KZhead, but you sir definitely deserve a lot more than just comments and likes. I'm truly happy to find your channel in KZhead. Just about 3 month I began learning programming and started with Python and with your videos I almost replace reading tons of pages of official docs. Bless you! Once I'll get my first salary I'll be back and show my respect in "patreon-way" too. But for now, you got my respect in words and my best wishes!

    @ericcartman2294@ericcartman22943 жыл бұрын
  • Even more than 4 years later this video is still useful, thank you!

    @tarick1650@tarick16502 жыл бұрын
  • Wish I came across this sooner. Been searching for a clear way to access inner members of a JSON, this is by far the clearest, to the point explanation.

    @alkor3883@alkor38832 жыл бұрын
  • I've watched a ton of your videos and the kind of conceptual clarity I have is unparalleled. Such great content, I can't help but donate on Patreon! :)

    @ishabytheway@ishabytheway3 жыл бұрын
  • spent so many hours scouring json/python info and your vid cleared everything in one go! excellent stuff and thank you!

    @sandhusukhdeep@sandhusukhdeep2 жыл бұрын
  • I was struggling with this for the past 3 days, thank you so much for your video tutorials, they really helped me.

    @GeNiaaz@GeNiaaz3 жыл бұрын
  • Phenomenal !! you're the best instructor, Corey- keep up the good work !!

    @aank2007@aank20076 жыл бұрын
  • Amazing video. I've been holding off learning JSON for so long and this video taught me the basics in just 20 minutes

    @LuskyMJ@LuskyMJ2 жыл бұрын
  • Clearly explained the topic working with json with practical problems and solutions. Thanks man.

    @ChetanKumar-eg6ot@ChetanKumar-eg6ot5 жыл бұрын
  • The most prefered Channel.... Always in my youtube search. Respect for you.

    @zeeshanqureshi9252@zeeshanqureshi92525 жыл бұрын
  • Thank you sooo much Corey!! You have made my journey of self learning python a hell lot easier and interesting.😃 Again can't thank you enough!!!😊

    @aakashsrivastava1128@aakashsrivastava11284 жыл бұрын
  • Amazing. Seriously. Out of all of the Python tutorials ive watched this is by far the best.

    @stephencedric8553@stephencedric85536 жыл бұрын
    • Thanks!

      @coreyms@coreyms6 жыл бұрын
  • Corey, thank you so much for this content. Some of the best I’ve found, you’re a great teacher. I’ll be donating through your patreon

    @JustinPresley@JustinPresley6 жыл бұрын
    • Thanks so much! I really appreciate that and it really helps me with these videos!

      @coreyms@coreyms6 жыл бұрын
  • I've been struggling trying to wrap my head around using JSON data obtained via an API. After watching your video, I finally got it to work! Excellent videos! I finally get it.

    @timgore829@timgore8293 жыл бұрын
  • Thank you so much! I'm creating a personal voice assistant rn and I didn't want to do every response by hand. This helped me a lot!

    @LauLauHip@LauLauHip2 жыл бұрын
  • Ah, the wonders of KZhead and Corey Schafer. Thank you!

    @glowish1993@glowish19934 жыл бұрын
  • Thanks man your the best python teacher I've found all your vids helpful i learned classes here better than the course i was reading keep up the good work

    @pollen4595@pollen45956 жыл бұрын
  • Thank you, I've been searching all over the internet at paid courses looking for pretty much exactly this. 20min video.

    @oh6254@oh62543 жыл бұрын
  • Dude love your videos, honestly this and realpython are my go tos for getting Python explained in plain English with a focus on practical applications!

    @alfredsfutterkiste7534@alfredsfutterkiste75343 жыл бұрын
  • Outstanding.. not one second of wasted information. This had to be the most informative information I've seen in 20 minutes. Brilliant. Thanks!!!

    @stanmanmedia@stanmanmedia3 жыл бұрын
  • Wow, you literally saved me from hours of desparation!! Thank you so much!

    @yaoi173@yaoi1736 жыл бұрын
  • Thank you! Straight to the point, quick and concise,...love it!

    @johanneszwilling@johanneszwilling5 жыл бұрын
  • Great tutorial and even better timing! Just the other day, I was bumbling my way through a real-world JSON data set and cursing the Python gods for making it so hard to understand. No I bumble/curse no more.

    @frakman1@frakman16 жыл бұрын
  • Best Python/JSON video on the internet.

    @theip7556@theip75565 жыл бұрын
  • I was struggling to get direction in python learning, your videos helped me a lot .Very crisp and concise ,easy to understand content. Thanks Corey !

    @singhkuldeep911@singhkuldeep9113 жыл бұрын
    • How is you’re python journey going since you’ve posted that comment ?

      @UnknownSend3r@UnknownSend3r2 жыл бұрын
  • Clear, easy-to-follow walk-through, with a practical API example. I'm pulling a bunch of financial data from 4 APIs and this video saved me at least 2+ hours! Great work, PayPal sent.

    @LittleEngineCan@LittleEngineCan6 жыл бұрын
    • Thanks!

      @coreyms@coreyms6 жыл бұрын
  • Your Python videos are a gold mine for beginners like me. Thank you so much!

    @NicoLargi@NicoLargi2 жыл бұрын
  • Yet another superb tutorial from you. Thank You. Patron donation on its way. Keep up the excellent work!

    @techcode_man@techcode_man5 жыл бұрын
    • Thanks! Any contributions help me keep the tutorials free for everyone else, so I really appreciate that!

      @coreyms@coreyms5 жыл бұрын
  • Your JSON videos are really amazing. Best tutorials! Very easy to consume and understand for a beginner who wants to manipulate API calls.

    @0cool966@0cool9663 жыл бұрын
  • Congrats Corey! This is the Zen of Python at its best, applied to JSON!

    @hedleypanama@hedleypanama6 жыл бұрын
  • fantastic tutorial, everything you need to know to work with JSON in python

    @pooryakhanali6921@pooryakhanali69214 жыл бұрын
  • Mr. Schafer, you're an amazing instructor! Thank you!

    @rayoh2011@rayoh2011 Жыл бұрын
  • *This video helped me a lot, I was with difficult at create an JSON file with some users' data, Thanks*

    @rafasantos23@rafasantos234 жыл бұрын
  • Your videos are excellent Corey, using this style and pace I was able to get an old API get to work that I couldnt before, much thankos!!

    @garethwoodall577@garethwoodall5774 жыл бұрын
  • A ton of *really* good info in here explained exceptionally well. Was a huge help; have subscribed and will donate. Keep up the great work!

    @ronglass5968@ronglass59686 жыл бұрын
  • simple ,crisp and clear explanation. Thank you very much for your very precise examples which will register in mind

    @kirankolluri4080@kirankolluri40804 жыл бұрын
  • As others have said, I found that other online tutorials, while good, do not match the clarity of these videos and the examples provided with them. They are my go to resource and reccomendation to new Python users. I have not found one yet that hasnt ebnabled me to progress with my own work. Many thanks Corey.

    @fabizmart398@fabizmart3982 жыл бұрын
  • Donated thru Patreon. Very good work - saved me hours of research and yet learned a ton. Keep them coming

    @retrodog65@retrodog656 жыл бұрын
    • Thanks!

      @coreyms@coreyms6 жыл бұрын
  • best json & python tutorial I'd ever met. thanks a lot!

    @sessdu@sessdu4 жыл бұрын
  • Its very crystal & clear to understand. Great explanation!

    @ranjitmahato6268@ranjitmahato62684 жыл бұрын
  • Valuable 20 minutes of my morning 🙂👌👌

    @piyushkonher8405@piyushkonher84054 жыл бұрын
  • This is the most amazing explanation I've seen so far :)

    @sanjaybabusanjay@sanjaybabusanjay4 жыл бұрын
  • Thanks a lot! Had to parse data from a json file and adapted from your example to do it, worked perfectly.

    @seiferleonheart@seiferleonheart2 жыл бұрын
  • very straight forward and sufficient information . Thanks Corey

    @UdayKiran-uz7mi@UdayKiran-uz7mi6 жыл бұрын
  • 6:00 indent 9:30 print different subfields 10:10 dump vs dumps dumps to file vs string 18:45 float conversion

    @zetsui0411@zetsui0411 Жыл бұрын
  • I want to give you a virtual hug. I found your video so helpful and easy

    @esteban578@esteban5785 жыл бұрын
  • Perfect! Simple and easy to follow and great examples! Thank you.

    @riadshash5456@riadshash54564 жыл бұрын
  • excellent presentation. you posted this tutorial 5 years ago. still finding it helpful

    @yeadahmed9165@yeadahmed91659 ай бұрын
  • No joke... dude is theeeee best explainer.

    @ericsuper8224@ericsuper82246 жыл бұрын
  • Simply awesome; the way its been explained with clarity & real-time examples. Thanks a lot & Cheers..!!

    @sazzi4all@sazzi4all4 жыл бұрын
  • thank you so much I was stuck to access the json values. very help full

    @HassanShahzadAheer@HassanShahzadAheer4 жыл бұрын
  • This is by far excellent tutorial for JSON + Python!! ❤❤🙏🏻🙏🏻

    @myandrobox3427@myandrobox3427 Жыл бұрын
  • What a way to explain!! Becoming a python developer (or really any language) by yourself is a challange for their own, but videos like this really help newbies like me to understand and become little better, one step at a time.. Thanks for this awesome tutorial!

    @pedrolazdin6164@pedrolazdin61643 жыл бұрын
  • Perfect and clear explanation and amazing presenter. Please contribute everyone so that he can keep making such useful videos.

    @abhisheksaharan@abhisheksaharan6 жыл бұрын
  • Your tutorials are brilliant, love the accent.

    @lardosian@lardosian5 жыл бұрын
  • Even though ur lecture was a bit long still it was an interesting session especially the way of teaching need to appreciate it, I had gone through many JSON videos still my concept was not clear this video is lifesaver thank you sir, Love from India

    @akashpillai7928@akashpillai79282 жыл бұрын
  • Crisp & clear to the point! explained beautifully.

    @Vamsibl@Vamsibl17 күн бұрын
  • This video has made me such a better coder just by watching it, really helped me solve a few problems I have

    @jackwightman3783@jackwightman37833 жыл бұрын
  • Really great Corey. Working on exactly this for a python backend which I need to convert computed variables values to something that will plug into html (in other words, JS). This is so helpful!

    @jimperkins9661@jimperkins96618 ай бұрын
  • Awesome! The best JSON explanation I've ever seen!

    @slonbeskonechen8310@slonbeskonechen83102 жыл бұрын
  • It was a pleasure to watch this and understand JSON concepts in Python

    @ramanupreti214@ramanupreti2144 жыл бұрын
  • This is a damn good video. It looks like you've just shown me exactly what I needed to know. I'd been hunting around for a while using Google... And thought I'd do a search on KZhead and this was the 2nd video on this topic I watched. Thanks heaps!!!

    @ScottMoyse@ScottMoyse4 жыл бұрын
  • Very straightforward, helpful videos for the python beginner. Thanks!

    @alexrsnh@alexrsnh4 жыл бұрын
  • U r the best teacher ever..!

    @arunsaivemula1300@arunsaivemula13006 жыл бұрын
  • Thank you for this visualization! Bootcamp started getting hard, and now it's manageable again (:

    @tatchsnart@tatchsnart3 жыл бұрын
  • I very much congratulate you for providing code_snippets.

    @s.baskaravishnu22@s.baskaravishnu225 жыл бұрын
  • OMG! EVERYTHING WAS EXPLAINED SO EASY! U R GOLD! THANK U MAN! U MAKE MY EDUCATION PROCESS EASIER! THANKS AGAIN

    @giorgipatsatsia544@giorgipatsatsia5443 жыл бұрын
  • You are a god! Never have I learned so much in just 20 minutes! Thank you, Corey!

    @mienislav@mienislav2 жыл бұрын
  • Thank you so much, this video help me to understand about JSON structure and how to use in python. The best explanation .

    @tranguyen758@tranguyen7586 жыл бұрын
  • Best Python Tutor on KZhead

    @benjaminaboagye9846@benjaminaboagye98462 жыл бұрын
  • You saved my day with this tutorial, thanks a lot :)

    @orsettogommoso@orsettogommoso5 жыл бұрын
  • Very clearly and concisely explained. Many thanks.

    @jims408@jims4085 жыл бұрын
  • Best Jason tutorial

    @sandobond4583@sandobond45835 жыл бұрын
  • Finally found a video which explained me everything about json.

    @pratyushshekhar5219@pratyushshekhar5219 Жыл бұрын
  • Cristal Clear. Thank you!

    @matiassandacz9145@matiassandacz91454 жыл бұрын
  • Thank you so much for making this video! Udacity gave precisely zero information on this subject despite it being part of the final project for my course.

    @amandasmith9530@amandasmith95302 жыл бұрын
  • Very nicely and lucidly explained in a very beautiful voice. hats off to you.

    @mantrava@mantrava3 жыл бұрын
  • Thanks for the upload. Very well explained.

    @ankurkumar-vp2ww@ankurkumar-vp2ww5 жыл бұрын
  • This is very clear tutorial. You are very good teacher, I learned so many things from you. Thank you.

    2 жыл бұрын
KZhead