MathByte Academy
MathByte Academy
  • Видео 63
  • Просмотров 189 195
Python Logging Demystified: Part 2 - Coding
#mathbyteacademy #python
In this second part on Python logging, we implement the concepts covered in Part 1 and see how to use the logging library in practice through a series of 12 examples.
If you have not watched Part 1, and are not entirely familiar with the concepts behind the Python logging library, I encourage you to watch it first: ruclips.net/video/AXUrQ-SexMI/видео.html
Content
=======
00:00 - Introduction
00:55 - Overview of Examples covered in this video
02:48 - Example 1 - Root logger, Inspecting Loggers
05:30 - Example 2 - Main app logger with YAML config
17:43 - Example 3 - Main app logger with code config
22:18 - Example 2 - Revisiting for log levels and propagation
25:52 - Example 4...
Просмотров: 1 376

Видео

Python Logging Demystified: Part 1 - Concepts
Просмотров 2,4 тыс.2 месяца назад
#mathbyteacademy #python In this first of a series of videos we explore the most important concepts of logging in Python. There will be no code, just a detailed explanation of how Python logging works. Follow-up videos will then dig into how to implement all these concepts and go from simple to complex logging implementations for your applications. Content 00:00 - Intro 01:05 - Loggers 03:23 - ...
Partially Validated Pydantic Models
Просмотров 5532 месяца назад
#mathbyteacademy #python In this video I want to present a really neat approach that one of my students on Udemy came up with to have Pydantic models that will still deserialize invalid data (populated with some value, such as None), as well as provide information about those fields that failed validation. I didn't think it could be done, so I was very happy to be proved wrong by that person's ...
Easy Progress Bars using tqdm
Просмотров 8673 месяца назад
#mathbyteacademy #python When you have long running processes, whether in Python apps or Jupyter notebooks, don't just give your users a blank screen where things look frozen. After about 10 seconds they're going to think the app crashed or is stuck! Instead, give them visual feedback that things are running. The tqdm library gives us the ability to very easily add progress bars to our code, ev...
Simplify Debug Print Statements using IceCream
Просмотров 1,3 тыс.3 месяца назад
#mathbyteacademy #python I discovered this library recently, and found it to be quite useful to replace the print statements I sometimes use for debugging or simply inspecting variables as my code is running. Code for this Video Available in GitHub blog repo: github.com/fbaptiste/python-blog Direct link: tinyurl.com/w2z9vkk9 My Python Courses - Python 3 Fundamentals (introduction to Python) www...
psycopg Row Factories - ORM-free area!
Просмотров 7254 месяца назад
#mathbyteacademy #python This is Part 2 of a two-part set of videos that looks into how to hook up Pydantic models to data returned by queries run against a Postgres database using the `psycopg` library. In Part 1, we looked at how to run Postgres locally using docker compose, and at what SQL migrations are, and how to implement them using the YoYo library. In this second part, we'll see how we...
Postgres SQL Migrations using YoYo
Просмотров 1,1 тыс.4 месяца назад
#mathbyteacademy #python This is a two-part set of videos that looks into how to hook up Pydantic models to data returned by queries run against a Postgres database using the `psycopg` library. In Part 1, we'll look at how to run Postgres locally using docker compose, and at what SQL migrations are, and how to implement them using the YoYo library. In the next part, we'll see how we can load da...
Python's SimpleNamespace and JSON
Просмотров 1,3 тыс.4 месяца назад
#mathbyteacademy #python Using Python's SimpleNamespaces to deserialize JSON data. A simpler approach than Pydantic, and a cleaner attribute access syntax than dictionaries. Code for this Video Available in GitHub blog repo: github.com/fbaptiste/python-blog Direct link: tinyurl.com/3u9245tx My Python Courses - Python 3 Fundamentals (introduction to Python) www.udemy.com/course/python3-fundament...
The Tenacity Library
Просмотров 1,5 тыс.4 месяца назад
#mathbyteacademy #python In this video we explore the Tenacity library that provides a very easy and powerful mechanism to add retry behavior to any piece of code. Very useful in a variety of scenarios such as retrying API calls when they time out or get rate limited, retrying database calls when they fail for some reason, and much more. Content 00:00 - Introduction 02:35 - SQL Example Setup 12...
The benedict Library
Просмотров 1,8 тыс.5 месяцев назад
#mathbyteacademy #python A highly useful extension to Python dictionaries for simplified access to keys in dictionaries and nested dictionaries, as well as a slew of methods to traverse dictionaries, filter key/value pairs, flatten nested dictionaries, and much more. Give this library a try in your next project and let me know in the comments what you tought of it. I only recently became aware ...
The pyyaml Library
Просмотров 1 тыс.6 месяцев назад
#mathbyteacademy #python We take a quick look at how to use the pyyaml library to read and write YAML files (as well as JSON!). Code for this Video Available in GitHub blog repo: github.com/fbaptiste/python-blog Direct link: tinyurl.com/59kc4ppn My Python Courses - Python 3 Fundamentals (introduction to Python) www.udemy.com/course/python3-fundamentals/?referralCode=DA09C6F40CEC38C942F6 - Pydan...
The wrapt Library
Просмотров 1,4 тыс.6 месяцев назад
#mathbyteacademy #python In this video we look at the wrapt library that has some very useful features to create decorators. We look at how to use it, how to dynamically enable and disable decorators and some additional enhancements it provides for inspection over Python's own @wraps decorator. Code for this Video Available in GitHub blog repo: github.com/fbaptiste/python-blog Direct link: tiny...
The Arrow Library
Просмотров 2,1 тыс.7 месяцев назад
#mathbyteacademy #python A look at at the highly useful and easy to use Arrow library for handling date times. I highly encourage you to check out this video and start using Arrow in your Python projects! Code for this Video Available in GitHub blog repo: github.com/fbaptiste/python-blog Direct link: tinyurl.com/bp5f2kn9 My Python Courses - Python 3 Fundamentals (introduction to Python) www.ude...
Python MultiProcessing: Leveraging Pools to Turbocharge your Apps
Просмотров 2,3 тыс.7 месяцев назад
Turbocharge your CPU Intensive Apps with MultiProcessing In this video I show you how to easily use Python multiprocessing capabilities to seriously boost the execution speed of your CPU-bound workloads. By default, Python is limited to a single thread and a single core on your CPU. Multiprocessing allows you to run functions on multiple cores on your machine, thereby achieving true parallelism...
Pydantic (V2) - In-depth Starter Guide
Просмотров 14 тыс.10 месяцев назад
In this video I show you how to use Pydantic V2, including topics such as default factories, custom serializers and custom validators. There is a whole lot more to Pydantic than what I can cover in a video such as this. If you are interested in a deeper dive into Pydantic V2, please check out my Udemy course on the subject. Here is a discount coupon link (if it has expired, just let me know in ...
Idiomatic Python: Named Arguments
Просмотров 89210 месяцев назад
Idiomatic Python: Named Arguments
Speed Up your Python Apps with Caching
Просмотров 2,2 тыс.11 месяцев назад
Speed Up your Python Apps with Caching
Idiomatic Python: Merging Dictionaries
Просмотров 806Год назад
Idiomatic Python: Merging Dictionaries
Pydantic: Migrating from V1 to V2
Просмотров 2,4 тыс.Год назад
Pydantic: Migrating from V1 to V2
Idiomatic Python: Counting Things with Dictionaries
Просмотров 1,1 тыс.Год назад
Idiomatic Python: Counting Things with Dictionaries
Idiomatic Python: Iterating Dictionaries
Просмотров 1,5 тыс.Год назад
Idiomatic Python: Iterating Dictionaries
Idiomatic Python: Decomposition & Refactoring Demo
Просмотров 3,1 тыс.Год назад
Idiomatic Python: Decomposition & Refactoring Demo
Idiomatic Python: Generators
Просмотров 1,8 тыс.Год назад
Idiomatic Python: Generators
Idiomatic Python: Custom Sorts and Leveraging Sort Stability
Просмотров 592Год назад
Idiomatic Python: Custom Sorts and Leveraging Sort Stability
Idiomatic Python: Deques vs Lists
Просмотров 1,2 тыс.Год назад
Idiomatic Python: Deques vs Lists
PyCharm and Virtual Environments
Просмотров 1,8 тыс.Год назад
PyCharm and Virtual Environments
Idiomatic Python: Using Comprehensions
Просмотров 864Год назад
Idiomatic Python: Using Comprehensions
Idiomatic Python: The `itertools` Module
Просмотров 1,2 тыс.Год назад
Idiomatic Python: The `itertools` Module
A Deep Dive into Python's Dataclasses (Part 2)
Просмотров 4,1 тыс.Год назад
A Deep Dive into Python's Dataclasses (Part 2)
A Deep Dive into Python's Dataclasses (Part 1)
Просмотров 11 тыс.Год назад
A Deep Dive into Python's Dataclasses (Part 1)

Комментарии

  • @_praba
    @_praba День назад

    This is awesome and very fun to watch for each solution.

  • @sgurdmeal662
    @sgurdmeal662 3 дня назад

    This made decorators with arguments clearer for me. Before I thought you could just pass additional arguments to decorators, but when I tried it recently I realized you couldn't and was confused by the proper way of doing so. Thanks!

  • @moardub
    @moardub 5 дней назад

    I would love to see more refactoring like this! I think its important what the video teaches itself, but equally important is the questions it brings up for me. Frequently I see you implement something I've never seen or heard of before and it forces me to learn something that wasn't even related to the video content but very valuable! Thank you for putting so much work into this!

    • @mathbyteacademy
      @mathbyteacademy 4 дня назад

      Glad it sparked some new learning for you! 😃

  • @moardub
    @moardub 6 дней назад

    Thank you so much for this amazing tutorial! I really like the "best practice" and "real world" examples and not just the theory of how it works, but also the "why it is the way it is" with real examples.

  • @sharadsharma9511
    @sharadsharma9511 15 дней назад

    it was really good video. but i just wanted to know why u did'nt used celery?

    • @mathbyteacademy
      @mathbyteacademy 15 дней назад

      I typically don't use Celery unless I actually need its more extensive (but more complicated) features. Also, I believe this is still the case, Celery is not supported on Windows, so YMMV.

  • @rluijk
    @rluijk 16 дней назад

    Thanks. Very nice to follow along, actually seeing the works running in the end is very nice!

  • @fatalsg92
    @fatalsg92 26 дней назад

    The real question is if you're going to optimize for performance, why use Python at all?

    • @mathbyteacademy
      @mathbyteacademy 26 дней назад

      Sure, you could just choose to write in C, Rust, etc. But then you'd lose out on packages such as PyTorch, TensorFlow, Scikit-learn, Keras, Theano, FastAPI, Pydantic, etc - basically the Python package ecosystem. (and many of those packages *are* written in C/Rust/etc so from a pure performance perspective using Python does not give up much).

  • @wisenielsmuronha3405
    @wisenielsmuronha3405 27 дней назад

    awesome

  • @farishassan7727
    @farishassan7727 28 дней назад

    Thanks i would like to see more videos from you. You are the best teacher for me

  • @Costin8406
    @Costin8406 Месяц назад

    this is great! i am currently on your 4th deep dive course and just found out recently you had a youtube channel... omg what a gem. Best teacher, you deserve more recognition.

  • @harshbiyani3048
    @harshbiyani3048 Месяц назад

    Please plan the video on AsyncIO. great explanation 👍

  • @imansyaefulloh
    @imansyaefulloh Месяц назад

    Thank you for the video, please make another video about async and asyncio

  • @LeTotorDuCoin
    @LeTotorDuCoin Месяц назад

    Hello Fred, like the first part, this video about logging is crystal clear. Again I thank you a lot to help me to get some code cleaner. By the way, I thank you also to make a focus on the security. I think that in plenty of videos this aspect is ignored. My best regards

  • @sarthakchecker8212
    @sarthakchecker8212 Месяц назад

    Thanks Fred. I have completed your 4 parts on DD in Python on Udemy. It's truly amazing. I have a good hold on Data Structures and Algorithms and I now want to start learning the foundations for API development and followed by Distributed Systems. Could you tell me the best resources available I can use?

    • @mathbyteacademy
      @mathbyteacademy Месяц назад

      Thanks, glad you liked the courses! For APIs, I would probably learn FastAPI. You'll need a foundation in Python type hinting and Pydantic as well (I have videos on type hinting and Pydantic in this channel, or even a full course on Pydantic on Udemy). I would look for YT videos and blog posts on REST API concepts in general (does not have to be specific to Python or FastAPI) to learn how REST APIs are structured and some of the best practices. Then look for FastAPI specific content. I would also probably learn about various databases, starting with relational databases such as Postgres, and maybe a nosql database such as Mongo. As far as distributed systems go, once you have FastAPI covered, you'll need to learn about how to use message queues, and then how to architecture distributed systems. I don't know of any specific resources that will cover all of that - at this more advanced stage, you'll probnably need to piece your knowledge together from a variety of sources - courses, YT videos, books, blog posts, product docs, etc.

    • @sarthakchecker8212
      @sarthakchecker8212 Месяц назад

      ​​Thanks Fred for your advice. I really appreciate your advice and trust it because of your background as a mathematician and an experienced software engineer and also your DD in Python is such high quality teaching and I can't wait for what next you have to offer! Also I have enrolled for the Pydantic course so I can start learning APIs next after finishing it :) ​@@mathbyteacademy

  • @szymonpiechutowski2340
    @szymonpiechutowski2340 Месяц назад

    Wonderful video, I was looking for this type of tool to avoid ORMs

    • @mathbyteacademy
      @mathbyteacademy Месяц назад

      Thanks! Glad you liked it.

    • @szymonpiechutowski2340
      @szymonpiechutowski2340 Месяц назад

      @@mathbyteacademy is YoYo production ready? Also I do not understand why in Python there are just a few migration tools and nothing that is even close to e.g. Go migrate.

    • @mathbyteacademy
      @mathbyteacademy Месяц назад

      @@szymonpiechutowski2340 Yes, YoYo is production readyu - been using it for several years now. SQL migration tools don't have to be language specific, so plenty of choices around if you don't want a Python base migration tool.

    • @szymonpiechutowski2340
      @szymonpiechutowski2340 Месяц назад

      @@mathbyteacademy Thank you so much for sharing your experience! btw Course on SQL would be awesome. If you create a waiting list, I can join it!

  • @tiffanytai1603
    @tiffanytai1603 Месяц назад

    Thanks Fred! Great video! If you have time, a video on structlog would be much appreciated!

    • @mathbyteacademy
      @mathbyteacademy Месяц назад

      Thanks! I will add it to my list of future topics to cover.

  • @robertmcdonnell2807
    @robertmcdonnell2807 Месяц назад

    Many thanks for this excellent introduction

  • @TomLeg
    @TomLeg Месяц назад

    If you have 10,000 modules, you've got a bigger problem than the number of loggers

    • @mathbyteacademy
      @mathbyteacademy Месяц назад

      Very true 😆 Only project I could think of that has a lot of modules would be pypy - maybe there are larger ones out there. I counted the number of modules in that project (basically just counted number of files with .py extension)... 4586 !!

  • @ketanpurohit9086
    @ketanpurohit9086 Месяц назад

    Fantastic as always - FastAPI, Polars, Actor based programming, Microservices with Python would be my requests

  • @AyushMandloi
    @AyushMandloi Месяц назад

    You are the best python tutor on this planet

  • @JimRohn-u8c
    @JimRohn-u8c Месяц назад

    Do you have any plans to make a Python course for people new to creating Rest API’s with Fast API? Maybe even one for GraphQL?

    • @mathbyteacademy
      @mathbyteacademy Месяц назад

      I __have_ been thinking about a course on FastAPI, especially since I now have the course on Pydantic, just haven't had the time to dedicate to it. GraphQL I probably would not do - I have not used it enough to have what I consider sufficiently deep knowledge - at least not to create something beyond the run of the mill intro type "courses".

    • @JimRohn-u8c
      @JimRohn-u8c Месяц назад

      @@mathbyteacademy understandable, well in that case I really hope you make an in-depth Fast API Course on Udemy! Also, do you have any videos on how to properly read programming language documentation? I know that sounds simple but I highly doubt I could get even half the knowledge you have regarding more advanced python topics just from reading documentation, I feel like there’s probably something you do differently than I do. Thankfully we have LLM’s now so when I come across vague or poor documentation that doesn’t have many examples I can most of the time have ChatGPT explain further with examples but I would really love to know how to pick up in-depth advanced knowledge like you have regarding a language. I’m assuming you have a methodology by now that lets you approach programming documentation and lets you extract a deeper understanding than myself?

  • @tserewara
    @tserewara Месяц назад

    Awesome! It would be great to have more content or even a course covering web development. Any plan on that?

    • @mathbyteacademy
      @mathbyteacademy Месяц назад

      Thanks! I don't do web development (I assume you mean client-side things like React, etc), so no course on that from me. There are a few good ones on Udemy already anyway. I you mean backend stuff to support web clients, then I do plan on trying to get a course done on FastAPI at some point.

    • @tserewara
      @tserewara Месяц назад

      ​​@@mathbyteacademy Yes, I mean backend. That's really good to know!

  • @tirthasg
    @tirthasg Месяц назад

    Love your courses! Any plans on adding courses onto Udemy relating to Python's AI stack, namely, NumPy, Pandas, Matplotlib, and PyTorch? I would definitely enrol if you make them, since your lectures delve deep into the internals of the features. Not many instructors do that!

    • @mathbyteacademy
      @mathbyteacademy Месяц назад

      Thanks! Probably not, for a variety of reasons, the main one being that it takes a lot of time to produce in-depth and detailed courses, and some of these libraries have a tendency to change quite a bit, breaking backward compatibility. Which means I would have to update such a course quite frequently, certainly more often than would be viable. I cover the basics of NumPy, Pandas and Matplotlib in my fundamentals course, and Pandas has been a pain in the you-know-what for that reason. Also, if I were starting out, I think I may look at Polars instead of Pandas.

    • @tirthasg
      @tirthasg Месяц назад

      @@mathbyteacademy Thanks for replying back! Yes, your reservations are completely understandable. Sometimes as learners we often fail to appreciate the time and effort it takes for the instructor to produce quality content, and update them whenever necessary. Nonetheless, what advice would you give to someone who's just getting started with NumPy, Pandas, and Matplotlib, apart from viewing the basics from your course?

    • @mathbyteacademy
      @mathbyteacademy Месяц назад

      @@tirthasg In terms of my fundamentals course, the sections are still very relevant - numpy is pretty stable, and changes in Pandas have not been too great (but still, I hate when libraries just break backward compatibility). Matplotlib has been also good, I think, like NumPy. So you could certainly start there, or you could look for books, RUclips videos, blog posts, maybe other courses. But with any of those resources, be ready to also consult the official library documentation for any breaking changes between the time the contetn was created and whatever latest version of the library you decide to use. Then, once you have the basics a bit, time to start coding with them - that's really the only way to learn - and as you try things out, you'll most likely need to go to the library docs (this is something I highly recommend getting used to as early on as possible). Books, courses, YT videos can only take you so far - then you need to deep dive on your own - various blogs and stackoverflow will help you along quite a bit when yuu have *specific* things you want to learn more.

  • @santiagomartinez3417
    @santiagomartinez3417 Месяц назад

    Love your content man!!!!!!!!

  • @LeTotorDuCoin
    @LeTotorDuCoin Месяц назад

    Thank a lot for this crystal clear video about logging. Really impatient to see second one.

    • @mathbyteacademy
      @mathbyteacademy Месяц назад

      You're welcome! Next video dropping soon, subscribe and use bell icon to get notified!

  • @MaGJ83
    @MaGJ83 Месяц назад

    SimpleNamespace is a useful package. I'm using it for processing api returns. Thanks for teaching about the object_hook. I'm using a helper function to do the recursive namespace. This is super helpful

  • @DifferentialGeometry
    @DifferentialGeometry Месяц назад

    Fred, you are the GOAT of Python on RUclips. Please keep it coming <3

  • @MaGJ83
    @MaGJ83 Месяц назад

    Very useful video. Thank you. If you are crowd sourcing video idea through comments, please consider making a video on the API call the right way with pagination, timeout and data parsing 🙏🏽

    • @mathbyteacademy
      @mathbyteacademy Месяц назад

      Thanks, will look into doing a video on that. Although I do cover the tenacity library in this channel - if you have not seen it before I recommend looking at it, it's really useful.

  • @harshbiyani3048
    @harshbiyani3048 Месяц назад

    Hi Fred, do you have any plans to extend the Deep dive series to include AysncIO ?

  • @pavelekshin9261
    @pavelekshin9261 2 месяца назад

    Hi Fred, thanks for sharing, very helpful!💎

  • @raizen74
    @raizen74 2 месяца назад

    I learned pydantic thanks to your udemy course and I watch all your youtube videos. I grasp all the concepts and I learn a lot, you are a great instructor.

  • @dev.aaajit
    @dev.aaajit 2 месяца назад

    Very helpful 👌

  • @tannguyen_91
    @tannguyen_91 2 месяца назад

    We always love your materials; these are always majestic.

  • @wisenielsmuronha3405
    @wisenielsmuronha3405 2 месяца назад

    Hi Dr.Fred, for me, you're a rock star in Python. I did study all your deep dive course in udemy and got super powers in python. Please, create more deep dives

  • @JimRohn-u8c
    @JimRohn-u8c 2 месяца назад

    Thank you so much for this!

  • @adrianbiro2167
    @adrianbiro2167 2 месяца назад

    Yes, do queues video please.

  • @itzcallmepro4963
    @itzcallmepro4963 2 месяца назад

    Amazing , waiting for the rest of the videos

  • @KeanuJeevesTheRealOne
    @KeanuJeevesTheRealOne 2 месяца назад

    I've followed your content here on youtube and on Udemy (for a number of years now). Great work, great presentation, great material as usual. You make niche knowledge accessible to mere mortals, with adequate amount of details for its thorough understanding. Thank you Fred!

  • @yanglijian
    @yanglijian 2 месяца назад

    It is best to share about the queue for logger

  • @Emma-ox4ki
    @Emma-ox4ki 2 месяца назад

    You are my favorite tutor ♥

  • @أحمدالزغلي
    @أحمدالزغلي 2 месяца назад

    Thanks

  • @nasiq
    @nasiq 2 месяца назад

    This was something I suggested in the community post, appreciate you covering it!

  • @lyrafiel76
    @lyrafiel76 2 месяца назад

    Great video as usual, waiting for more!

  • @gustavojuantorena
    @gustavojuantorena 2 месяца назад

    Awesome

  • @iwswordpress
    @iwswordpress 2 месяца назад

    This is going to be very useful!

  • @MemyEdward
    @MemyEdward 2 месяца назад

    Great Explanation Sir, thank you very much, would you able to tell me the software you using to type the Coding, thanks

  • @petrs5567
    @petrs5567 2 месяца назад

    Also: apart from object proxies (which is interesting by itself), I noticed wrapt's **thread synchronization** decorator which appears to be... an uppercut for GIL. I'm not a big fan of free multithreaded programming, but it will come, together with JIT, to compete against Go, Java and the rest... Thank you for professional content and attention to these libs.

  • @abhishekbanerjee6140
    @abhishekbanerjee6140 2 месяца назад

    Really weird question but what keyboard do you use haha. I love the typing sound.

    • @mathbyteacademy
      @mathbyteacademy 2 месяца назад

      I use a Nuphy Halo 75

    • @abhishekbanerjee6140
      @abhishekbanerjee6140 2 месяца назад

      @@mathbyteacademy ahh nice and which switches do you use?

    • @mathbyteacademy
      @mathbyteacademy 2 месяца назад

      @@abhishekbanerjee6140 I think they were pre-lubed gateron browns, but honestly don't remember for sure - in any case I don't believe the new V2 keyboards have the same switch options anyway

    • @abhishekbanerjee6140
      @abhishekbanerjee6140 2 месяца назад

      @@mathbyteacademy Guess what, just got mine. Got the halo75 v2 with mint switches. Proper excited :)) Was on the lookout for a new keyboard for a while now and this just checked all my boxes.

  • @gardnmi
    @gardnmi 2 месяца назад

    Loguru is another one that quickly replaces print and the standard logging. Best of both worlds.

    • @mathbyteacademy
      @mathbyteacademy 2 месяца назад

      Yes, that's an excellent logging library. I have some videos on Python's standard library logging coming up soon, followed by videos on the loguru and structlog packages as well.