Python Standard Library: JSON

Поделиться
HTML-код
  • Опубликовано: 28 авг 2024
  • This video covers the tools you need to know from the json module. There are a number of subjects covered in this video, so here are some timestamps for each major section.
    00:28 - intro
    02:58 - dumping
    06:09 - loading
    08:05 - encoding
    11:09 - decoding
    13:41 - self serializing
    15:18 - json tool cli
    Follow me on X: x.com/JakeJCal...
    Source: github.com/Jac...
    Intro music: Rich in the 80s - DivKid

Комментарии • 9

  • @JakeCallahan
    @JakeCallahan  7 месяцев назад +1

    What are some ways that you've used JSON in Python?
    Have you used the CLI tool I showed in the last section of the video?

  • @DiptonilRoy
    @DiptonilRoy 5 месяцев назад

    The last technique is genius! No matter how easy or accessible the topic is, every time I watch your video - I always go out learning something new.

  • @dragonkat13
    @dragonkat13 7 месяцев назад +1

    What a great video! I don't know how you don't have more views. It's a crime!

  • @duke007x3
    @duke007x3 5 месяцев назад

    really great explanation! Thank You, Jake!

  • @DiptonilRoy
    @DiptonilRoy 5 месяцев назад

    By the way, I do not know if you have ever covered it or not, but I would love to see your technique of designing and implementing custom exceptions for a general application (that is fairly complex and huge). How do you handle their respective logs? How do you decide what information to expose to the clients using the application as logs (may be in the terminal or a separate log file) and what to send to a more dev-centric log file (if any)? How do you tackle exceptions arising due to another exception in logs? Also, (this is more opinionated, I suppose) do you find the use of things like Liskov's Substitutions within Exceptions reasonable (and why)?

    • @JakeCallahan
      @JakeCallahan  5 месяцев назад +1

      These are all great questions, most of which are answered in one of my pet projects at work: github.com/SatelliteQE/broker.
      In that project, you can find the custom exceptions I use and how logging is handled when in different log levels. Another interesting thing I've introduced with this is an "Emitter" class that can be used for a more structured log-like file that can be more easily consumed in CI environments.
      github.com/SatelliteQE/broker/blob/master/broker/helpers.py#L269
      Now regarding LSP, I'm not very strict when it comes to adhering to most paradigms, if the situation you're in requires some kind of deviation. With that said, my exception subclasses are typically very lightweight.

    • @DiptonilRoy
      @DiptonilRoy 5 месяцев назад

      @@JakeCallahan Sounds interesting! Thanks for the recommendation!

  • @Diablo-qp3iz
    @Diablo-qp3iz 6 месяцев назад

    Is it better if using orjson ?

    • @JakeCallahan
      @JakeCallahan  6 месяцев назад

      I've not had a need to use that library, but it does look interesting. If your environment allows third party libraries, that looks like a good alternative.
      I'll add it to my list for a future series on great packages from PyPi, thanks!