MathByte Academy
MathByte Academy
  • Видео 63
  • Просмотров 205 037
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...
Просмотров: 2 509

Видео

Python Logging Demystified: Part 1 - Concepts
Просмотров 3,3 тыс.5 месяцев назад
#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
Просмотров 7065 месяцев назад
#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
Просмотров 1 тыс.5 месяцев назад
#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,7 тыс.6 месяцев назад
#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!
Просмотров 8526 месяцев назад
#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,3 тыс.7 месяцев назад
#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,4 тыс.7 месяцев назад
#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,6 тыс.7 месяцев назад
#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,9 тыс.8 месяцев назад
#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,1 тыс.9 месяцев назад
#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,5 тыс.9 месяцев назад
#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,3 тыс.9 месяцев назад
#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,5 тыс.10 месяцев назад
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
Просмотров 16 тыс.Год назад
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
Просмотров 979Год назад
Idiomatic Python: Named Arguments
Speed Up your Python Apps with Caching
Просмотров 2,4 тыс.Год назад
Speed Up your Python Apps with Caching
Idiomatic Python: Merging Dictionaries
Просмотров 845Год назад
Idiomatic Python: Merging Dictionaries
Pydantic: Migrating from V1 to V2
Просмотров 2,6 тыс.Год назад
Pydantic: Migrating from V1 to V2
Idiomatic Python: Counting Things with Dictionaries
Просмотров 1,2 тыс.Год назад
Idiomatic Python: Counting Things with Dictionaries
Idiomatic Python: Iterating Dictionaries
Просмотров 1,5 тыс.Год назад
Idiomatic Python: Iterating Dictionaries
Idiomatic Python: Decomposition & Refactoring Demo
Просмотров 3,2 тыс.Год назад
Idiomatic Python: Decomposition & Refactoring Demo
Idiomatic Python: Generators
Просмотров 1,8 тыс.Год назад
Idiomatic Python: Generators
Idiomatic Python: Custom Sorts and Leveraging Sort Stability
Просмотров 613Год назад
Idiomatic Python: Custom Sorts and Leveraging Sort Stability
Idiomatic Python: Deques vs Lists
Просмотров 1,3 тыс.Год назад
Idiomatic Python: Deques vs Lists
PyCharm and Virtual Environments
Просмотров 2,1 тыс.Год назад
PyCharm and Virtual Environments
Idiomatic Python: Using Comprehensions
Просмотров 899Год назад
Idiomatic Python: Using Comprehensions
Idiomatic Python: The `itertools` Module
Просмотров 1,3 тыс.Год назад
Idiomatic Python: The `itertools` Module
A Deep Dive into Python's Dataclasses (Part 2)
Просмотров 4,4 тыс.Год назад
A Deep Dive into Python's Dataclasses (Part 2)
A Deep Dive into Python's Dataclasses (Part 1)
Просмотров 12 тыс.Год назад
A Deep Dive into Python's Dataclasses (Part 1)

Комментарии

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

    Thanks for this! I'm returning to Python from a couple of years doing Go. In Go projects I was using golang/migrate and was using it in my new Python project. I like having the up and down migration in the same file so, I'll try Yoyo.

  • @BrainiumAI
    @BrainiumAI 2 дня назад

    immediately recognized the voice from the Udemy courses, auto like/sub

  • @gigixperia
    @gigixperia 11 дней назад

    Hi Fred, Happy New Year! Wishing you all the best for the year ahead. I’ve been following your channel regularly and noticed some recent inactivity. First and foremost, I hope everything is going great on your end. That said, I can’t help but wonder if this quiet period is a sign that you’re working on something big-perhaps a massive new course? If that’s the case, I’m already excited and would love to preorder it if possible. Haha!

  • @gisleberge4363
    @gisleberge4363 12 дней назад

    Very well explained, thank you 🙂

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

    I watch your content on Udemy too. Best regards ❤

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

    Hey Fred, I hope you are in good health. Wish you a happy new year 2025 🎉

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

      Thank you @pratiksen7809! Happy New Year to you too!

  • @nazfloyd
    @nazfloyd 19 дней назад

    Great tutorial, thank you!

  • @nazfloyd
    @nazfloyd 20 дней назад

    great video, thank you!

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

    I'm a huge fan of Dr. Fred. I've found him on Udemy, from where I just finished the Deep Dive Part 2 of the course series... going forward to Part 3 😅

  • @SandeepPrajapati-xu9ru
    @SandeepPrajapati-xu9ru Месяц назад

    Thank you for great content, Keep up the good work!

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

    Fred, you are a priceless addition to to programming world. Your ability to explain complex topics and switch from high level, theoretical, abstractions to implementation is unparalleled. I really enjoyed your courses and have yet to find better. I'm really glad you started a RUclips channel.

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

    This is really awesome. I wish I could hug you.

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

    Is defaultdict a wrapper for setdefault ?

  • @lukashk.1770
    @lukashk.1770 2 месяца назад

    can you share you setup of jupyter notebook?

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

      So I _think_ I was using Jupyter Notebooks (as opposed to the newer Jupyter Labs I use nowadays). For that I was using a theme and settings I document here: tinyurl.com/bddfupbz But for the newer JupyterLab I just use their default dark theme.

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

    Hi, when we will se your course on asyncio. Thank You

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

    Thank you so much.

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

    I’ve learned so much from your videos, especially the advanced course on Udemy. I feel much more comfortable using Python now! I have a question and a suggestion: could you make some videos on unit testing and integration testing? It’s a big topic in Python, and having someone like you explain it would make it much simpler and more comprehensive.

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

    Best teacher ever. Please more video about standard library, about static duck typing etc

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

    Excellent!

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

    Some dude did dataclass in 20 minutes

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

    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 3 месяца назад

    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 3 месяца назад

      Glad it sparked some new learning for you! 😃

  • @moardub
    @moardub 3 месяца назад

    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 3 месяца назад

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

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

      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 3 месяца назад

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

  • @fatalsg92
    @fatalsg92 3 месяца назад

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

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

      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 3 месяца назад

    awesome

  • @farishassan7727
    @farishassan7727 3 месяца назад

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

  • @Costin8406
    @Costin8406 4 месяца назад

    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.

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

      Thank you!!

    • @Costin8406
      @Costin8406 3 месяца назад

      @@mathbyteacademy any news on your new course?

  • @harshbiyani3048
    @harshbiyani3048 4 месяца назад

    Please plan the video on AsyncIO. great explanation 👍

  • @imansyaefulloh
    @imansyaefulloh 4 месяца назад

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

  • @LeTotorDuCoin
    @LeTotorDuCoin 4 месяца назад

    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 4 месяца назад

    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 4 месяца назад

      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 4 месяца назад

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

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

      @@mathbyteacademy I got to know from your udemy profile that you are into data engineering. Can we expect something on that?

  • @szymonpiechutowski2340
    @szymonpiechutowski2340 4 месяца назад

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

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

      Thanks! Glad you liked it.

    • @szymonpiechutowski2340
      @szymonpiechutowski2340 4 месяца назад

      @@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 4 месяца назад

      @@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 4 месяца назад

      @@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 4 месяца назад

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

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

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

  • @robertmcdonnell2807
    @robertmcdonnell2807 4 месяца назад

    Many thanks for this excellent introduction

  • @TomLeg
    @TomLeg 4 месяца назад

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

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

      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 4 месяца назад

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

  • @AyushMandloi
    @AyushMandloi 4 месяца назад

    You are the best python tutor on this planet

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

    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 4 месяца назад

      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 4 месяца назад

      @@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 4 месяца назад

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

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

      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 4 месяца назад

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

  • @tirthasg
    @tirthasg 4 месяца назад

    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 4 месяца назад

      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 4 месяца назад

      @@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 4 месяца назад

      @@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 4 месяца назад

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

  • @LeTotorDuCoin
    @LeTotorDuCoin 4 месяца назад

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

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

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

  • @MaGJ83
    @MaGJ83 4 месяца назад

    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 4 месяца назад

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

  • @MaGJ83
    @MaGJ83 4 месяца назад

    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 4 месяца назад

      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 4 месяца назад

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