Python Tutorial: Working with JSON Data using the json Module

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 มิ.ย. 2024
  • 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

ความคิดเห็น • 742

  • @ibrahimal-mahfooz8737
    @ibrahimal-mahfooz8737 4 ปีที่แล้ว +1054

    Your videos should be part of the official Python docs.

    • @jairuskersey8311
      @jairuskersey8311 4 ปีที่แล้ว +17

      He truly is the best tutorial on the entire internet !!!!!!!!!

    • @anshulkanwar1
      @anshulkanwar1 4 ปีที่แล้ว +5

      He truly is the best tutorial on the entire internet !!!!!!!!!

    • @guckesksk5895
      @guckesksk5895 4 ปีที่แล้ว

      Bucky’s tutorials was best

    • @moody54324
      @moody54324 4 ปีที่แล้ว

      Agree

    • @ifeanyiinnocentlazarus1403
      @ifeanyiinnocentlazarus1403 3 ปีที่แล้ว +1

      J'ai enfin un script légitime que je fonctionne parfaitement via FRESKIEHACK sur Instagram

  • @nktslp3650
    @nktslp3650 4 ปีที่แล้ว +146

    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!

    • @SueBeatMaker
      @SueBeatMaker ปีที่แล้ว

      I agree with you, the author tells us as clearly as possible

  • @augurelite
    @augurelite 2 ปีที่แล้ว +48

    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.

    • @MrMutt111
      @MrMutt111 7 หลายเดือนก่อน

      Not really "elite" educational content. But it certainly is high quality information.

  • @imtiazshahed944
    @imtiazshahed944 4 ปีที่แล้ว +11

    The best thing we get from Corey's tutorial is an easy explanation with a real-world example. THANKS A TON.

  • @haoyangrocks
    @haoyangrocks 6 ปีที่แล้ว +29

    I also loved the practical example at the end of the tutorial. Thank you!

  • @beem124
    @beem124 5 ปีที่แล้ว +22

    Pretty easy to follow. The best part is you've used real-world examples. Great tutorial!

  • @monagulapa3022
    @monagulapa3022 4 ปีที่แล้ว +6

    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!

  • @andrewbaillie2475
    @andrewbaillie2475 4 ปีที่แล้ว +16

    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.

  • @phillipsparks9690
    @phillipsparks9690 2 ปีที่แล้ว

    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.

  • @shobhamourya8396
    @shobhamourya8396 6 ปีที่แล้ว +1

    I tried the INR conversion and was surprised when you showed it :) You cover a lot and with clarity in short time - thanks Corey!

  • @ericcartman2294
    @ericcartman2294 3 ปีที่แล้ว +1

    I usually rarely comment on videos in TH-cam, but you sir definitely deserve a lot more than just comments and likes. I'm truly happy to find your channel in TH-cam. 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!

  • @husainshaikh8724
    @husainshaikh8724 6 ปีที่แล้ว +2

    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.

  • @sampadakhandekar5383
    @sampadakhandekar5383 6 ปีที่แล้ว +49

    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!

    • @davidreynolds9649
      @davidreynolds9649 6 ปีที่แล้ว +1

      agreed, I also like to see the exploration of some of the options (if that is the right term) , sort, indent etc

    • @ifeanyiinnocentlazarus1403
      @ifeanyiinnocentlazarus1403 3 ปีที่แล้ว

      J'ai enfin un script légitime que je fonctionne parfaitement via FRESKIEHACK sur Instagram

  • @funrover90
    @funrover90 5 ปีที่แล้ว +4

    Seriously, you are one of the best Python tutors online 👍🏻 Thank you for the video sir!

  • @zeeshanqureshi9252
    @zeeshanqureshi9252 5 ปีที่แล้ว +14

    The most prefered Channel.... Always in my youtube search. Respect for you.

  • @GabrielRodriguezInjectedFusion
    @GabrielRodriguezInjectedFusion 4 ปีที่แล้ว

    Been searching for a good tutorial online for JSON & Python and this hands down is the fastest and most understandable tutorial there is!

  • @shihabkhan3218
    @shihabkhan3218 3 ปีที่แล้ว +1

    Man, love the way Corey explains. His videos explain the fundamentals but with real practical demonstrations. Love you man

  • @JustinPresley
    @JustinPresley 6 ปีที่แล้ว +50

    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

    • @coreyms
      @coreyms  6 ปีที่แล้ว +14

      Thanks so much! I really appreciate that and it really helps me with these videos!

  • @stephencedric8553
    @stephencedric8553 6 ปีที่แล้ว +9

    Amazing. Seriously. Out of all of the Python tutorials ive watched this is by far the best.

    • @coreyms
      @coreyms  6 ปีที่แล้ว +1

      Thanks!

  • @ambarishkapil8004
    @ambarishkapil8004 4 ปีที่แล้ว

    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.

  • @hiankun
    @hiankun 4 ปีที่แล้ว

    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.

  • @sandhusukhdeep
    @sandhusukhdeep 2 ปีที่แล้ว

    spent so many hours scouring json/python info and your vid cleared everything in one go! excellent stuff and thank you!

  • @aank2007
    @aank2007 6 ปีที่แล้ว +6

    Phenomenal !! you're the best instructor, Corey- keep up the good work !!

  • @absolutedgefindout726
    @absolutedgefindout726 5 ปีที่แล้ว +1

    Thank you for being here for us and blessed be.

  • @aakashsrivastava1128
    @aakashsrivastava1128 4 ปีที่แล้ว +7

    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!!!😊

  • @anigasparyan3841
    @anigasparyan3841 2 ปีที่แล้ว +1

    Man, this has been the most helpful straight to the point walk-through! Thank you!

  • @alkor3883
    @alkor3883 2 ปีที่แล้ว

    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.

  • @arpithamuthappa
    @arpithamuthappa 3 ปีที่แล้ว

    I read multiple blogs and was confused all along till I bumped into your video :). Thank you so much.

  • @johanneszwilling
    @johanneszwilling 5 ปีที่แล้ว +4

    Thank you! Straight to the point, quick and concise,...love it!

  • @ChetanKumar-eg6ot
    @ChetanKumar-eg6ot 5 ปีที่แล้ว +2

    Clearly explained the topic working with json with practical problems and solutions. Thanks man.

  • @timgore829
    @timgore829 3 ปีที่แล้ว

    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.

  • @ishabytheway
    @ishabytheway 3 ปีที่แล้ว

    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! :)

  • @LuskyMJ
    @LuskyMJ 3 ปีที่แล้ว

    Amazing video. I've been holding off learning JSON for so long and this video taught me the basics in just 20 minutes

  • @tarick1650
    @tarick1650 2 ปีที่แล้ว

    Even more than 4 years later this video is still useful, thank you!

  • @garethwoodall577
    @garethwoodall577 4 ปีที่แล้ว +1

    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!!

  • @oh6254
    @oh6254 3 ปีที่แล้ว

    Thank you, I've been searching all over the internet at paid courses looking for pretty much exactly this. 20min video.

  • @GeNiaaz
    @GeNiaaz 4 ปีที่แล้ว

    I was struggling with this for the past 3 days, thank you so much for your video tutorials, they really helped me.

  • @johnprogrammer7164
    @johnprogrammer7164 ปีที่แล้ว

    It's 5 years later and you are still a real legend. Thank you.

  • @glowish1993
    @glowish1993 5 ปีที่แล้ว +3

    Ah, the wonders of TH-cam and Corey Schafer. Thank you!

  • @ronglass5968
    @ronglass5968 6 ปีที่แล้ว

    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!

  • @LittleEngineCan
    @LittleEngineCan 6 ปีที่แล้ว +3

    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.

    • @coreyms
      @coreyms  6 ปีที่แล้ว

      Thanks!

  • @rafasantos23
    @rafasantos23 4 ปีที่แล้ว +3

    *This video helped me a lot, I was with difficult at create an JSON file with some users' data, Thanks*

  • @NicoLargi
    @NicoLargi 2 ปีที่แล้ว +1

    Your Python videos are a gold mine for beginners like me. Thank you so much!

  • @stanmanmedia
    @stanmanmedia 3 ปีที่แล้ว

    Outstanding.. not one second of wasted information. This had to be the most informative information I've seen in 20 minutes. Brilliant. Thanks!!!

  • @LauLauHip
    @LauLauHip 2 ปีที่แล้ว

    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!

  • @0cool966
    @0cool966 3 ปีที่แล้ว

    Your JSON videos are really amazing. Best tutorials! Very easy to consume and understand for a beginner who wants to manipulate API calls.

  • @UdayKiran-uz7mi
    @UdayKiran-uz7mi 6 ปีที่แล้ว +1

    very straight forward and sufficient information . Thanks Corey

  • @theip7556
    @theip7556 5 ปีที่แล้ว +4

    Best Python/JSON video on the internet.

  • @alfredsfutterkiste7534
    @alfredsfutterkiste7534 3 ปีที่แล้ว

    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!

  • @frakman1
    @frakman1 6 ปีที่แล้ว +1

    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.

  • @yaoi173
    @yaoi173 6 ปีที่แล้ว +5

    Wow, you literally saved me from hours of desparation!! Thank you so much!

  • @pollen4595
    @pollen4595 6 ปีที่แล้ว +2

    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

  • @pedrolazdin6164
    @pedrolazdin6164 3 ปีที่แล้ว

    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!

  • @riadshash5456
    @riadshash5456 4 ปีที่แล้ว +1

    Perfect! Simple and easy to follow and great examples! Thank you.

  • @kirankolluri4080
    @kirankolluri4080 4 ปีที่แล้ว +2

    simple ,crisp and clear explanation. Thank you very much for your very precise examples which will register in mind

  • @hedleypanama
    @hedleypanama 6 ปีที่แล้ว +2

    Congrats Corey!
    This is the Zen of Python at its best, applied to JSON!

  • @fabizmart398
    @fabizmart398 2 ปีที่แล้ว +1

    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.

  • @sazzi4all
    @sazzi4all 4 ปีที่แล้ว +2

    Simply awesome; the way its been explained with clarity & real-time examples. Thanks a lot & Cheers..!!

  • @ranjitmahato6268
    @ranjitmahato6268 4 ปีที่แล้ว +2

    Its very crystal & clear to understand. Great explanation!

  • @jimperkins9661
    @jimperkins9661 9 หลายเดือนก่อน

    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!

  • @pooryakhanali6921
    @pooryakhanali6921 4 ปีที่แล้ว +2

    fantastic tutorial, everything you need to know to work with JSON in python

  • @zetsui0411
    @zetsui0411 ปีที่แล้ว +9

    6:00 indent
    9:30 print different subfields
    10:10 dump vs dumps dumps to file vs string
    18:45 float conversion

  • @seiferleonheart
    @seiferleonheart 2 ปีที่แล้ว

    Thanks a lot! Had to parse data from a json file and adapted from your example to do it, worked perfectly.

  • @techcode_man
    @techcode_man 5 ปีที่แล้ว +7

    Yet another superb tutorial from you. Thank You. Patron donation on its way. Keep up the excellent work!

    • @coreyms
      @coreyms  5 ปีที่แล้ว +2

      Thanks! Any contributions help me keep the tutorials free for everyone else, so I really appreciate that!

  • @singhkuldeep911
    @singhkuldeep911 3 ปีที่แล้ว +1

    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 !

    • @UnknownSend3r
      @UnknownSend3r 2 ปีที่แล้ว

      How is you’re python journey going since you’ve posted that comment ?

  • @Vamsibl
    @Vamsibl หลายเดือนก่อน +1

    Crisp & clear to the point! explained beautifully.

  • @ericsuper8224
    @ericsuper8224 6 ปีที่แล้ว +6

    No joke... dude is theeeee best explainer.

  • @retrodog65
    @retrodog65 6 ปีที่แล้ว +2

    Donated thru Patreon. Very good work - saved me hours of research and yet learned a ton. Keep them coming

    • @coreyms
      @coreyms  6 ปีที่แล้ว +1

      Thanks!

  • @ScottMoyse
    @ScottMoyse 4 ปีที่แล้ว +3

    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 TH-cam and this was the 2nd video on this topic I watched. Thanks heaps!!!

  • @alexrsnh
    @alexrsnh 4 ปีที่แล้ว +1

    Very straightforward, helpful videos for the python beginner. Thanks!

  • @rayoh2011
    @rayoh2011 ปีที่แล้ว

    Mr. Schafer, you're an amazing instructor! Thank you!

  • @esteban578
    @esteban578 5 ปีที่แล้ว +2

    I want to give you a virtual hug. I found your video so helpful and easy

  • @myandrobox3427
    @myandrobox3427 ปีที่แล้ว +1

    This is by far excellent tutorial for JSON + Python!! ❤❤🙏🏻🙏🏻

  • @sanjaybabusanjay
    @sanjaybabusanjay 4 ปีที่แล้ว +1

    This is the most amazing explanation I've seen so far :)

  • @piyushkonher8405
    @piyushkonher8405 4 ปีที่แล้ว +2

    Valuable 20 minutes of my morning 🙂👌👌

  • @slonbeskonechen8310
    @slonbeskonechen8310 2 ปีที่แล้ว

    Awesome! The best JSON explanation I've ever seen!

  • @sessdu
    @sessdu 4 ปีที่แล้ว

    best json & python tutorial I'd ever met. thanks a lot!

  • @hacktooth1
    @hacktooth1 3 ปีที่แล้ว

    Great video Corey! Thanks for the help.

  • @abhisheksaharan
    @abhisheksaharan 6 ปีที่แล้ว +1

    Perfect and clear explanation and amazing presenter. Please contribute everyone so that he can keep making such useful videos.

  • @jims408
    @jims408 5 ปีที่แล้ว +1

    Very clearly and concisely explained. Many thanks.

  • @tranguyen758
    @tranguyen758 6 ปีที่แล้ว +1

    Thank you so much, this video help me to understand about JSON structure and how to use in python. The best explanation .

  • @akashpillai7928
    @akashpillai7928 2 ปีที่แล้ว

    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

  • @jackwightman3783
    @jackwightman3783 3 ปีที่แล้ว

    This video has made me such a better coder just by watching it, really helped me solve a few problems I have

  • @lardosian
    @lardosian 6 ปีที่แล้ว +2

    Your tutorials are brilliant, love the accent.

  • @ramanupreti214
    @ramanupreti214 4 ปีที่แล้ว

    It was a pleasure to watch this and understand JSON concepts in Python

  • @giorgipatsatsia544
    @giorgipatsatsia544 3 ปีที่แล้ว +1

    OMG! EVERYTHING WAS EXPLAINED SO EASY! U R GOLD! THANK U MAN! U MAKE MY EDUCATION PROCESS EASIER! THANKS AGAIN

  • @s.baskaravishnu22
    @s.baskaravishnu22 5 ปีที่แล้ว +2

    I very much congratulate you for providing code_snippets.

  • @mienislav
    @mienislav 2 ปีที่แล้ว

    You are a god! Never have I learned so much in just 20 minutes! Thank you, Corey!

  • @archtaurus
    @archtaurus 6 ปีที่แล้ว +1

    Love these detailed tutorials! THX :)

  • @HassanShahzadAheer
    @HassanShahzadAheer 4 ปีที่แล้ว +1

    thank you so much I was stuck to access the json values. very help full

  • @scottwiseman2966
    @scottwiseman2966 5 ปีที่แล้ว +1

    Very exciting Corey. Real Word!

  • @MrTroop86
    @MrTroop86 4 ปีที่แล้ว

    Very clear and easy to understand explanations. Thanks!

  • @arunsaivemula1300
    @arunsaivemula1300 6 ปีที่แล้ว +2

    U r the best teacher ever..!

  • @LakshmiNarasimha-Tech-Nature
    @LakshmiNarasimha-Tech-Nature 5 ปีที่แล้ว +1

    Very clear and easy to understand, Many thanks.

  • @yeadahmed9165
    @yeadahmed9165 9 หลายเดือนก่อน

    excellent presentation. you posted this tutorial 5 years ago. still finding it helpful

  • @kayderl
    @kayderl 4 ปีที่แล้ว

    I'm a self taught Python programmer and have been doing it for 2-months now. I only learnt that Python could work alongside JSON today. (Ikr, Shake my head) But your succinct lesson help me learn so much already.

  • @nancyanderson5413
    @nancyanderson5413 10 หลายเดือนก่อน

    As always another superb video

  • @a_maxed_out_handle_of_30_chars
    @a_maxed_out_handle_of_30_chars 3 ปีที่แล้ว +1

    corey covers every video I've interest in :)

  • @ankurkumar-vp2ww
    @ankurkumar-vp2ww 5 ปีที่แล้ว +1

    Thanks for the upload. Very well explained.

  • @johncrynick1597
    @johncrynick1597 ปีที่แล้ว

    Great video.
    Thank you for taking the time to make this.