List of videos

Tutorials - Cheuk Ting Ho: PyO3 101 - Writing Python modules in Rust

In recent years, Rust has been getting more and more popular over other similar programming languages like C and C++ due to its robust compiler checking and ownership rules to make sure memory is safe. Hence there are more and more Python libraries that have been written in Rust natively with a Python API interface. One of the tools that have been driving this movement is PyO3, a toolset that proves Rust bindings for Python and tools for creating native Python extension modules. In this interactive workshop, we will cover the very basics of using PyO3. There will be hands-on exercises to go from how to set up the project environment to writing a "toy" Python library written in Rust using PyO3. We will cover a lot of expectations of the API provided by PyO3 to create Python functions, modules, handling errors and converting types. Goal To give developers who are not familiar with PyO3 an introduction to PyO3 so they can consider building their Python libraries with Rust to make use of Rust's memory-safe property and parallelism ability. Target audiences Any developers who are interested in developing Python libraries using Rust. It will be an advantage if the attendees are comfortable writing in Rust. However, attendees are not required to be familiar with Rust as all the Rust codes will be provided. Basic knowledge of Python will be assumed from the attendees.

Watch
Tutorials - Caroline Frasca, Tony Kipkemboi: Advanced Streamlit for Python Developers

This tutorial will be a deep dive into advanced Streamlit features and strategies to build robust, performant web apps in Python. Participants are welcome to bring their own app ideas to implement during this tutorial, but they will also have the opportunity to follow along as we build an example app together. The example app is a multi-page dashboard focused on your GitHub historical activity that also allows you to explore this data through a chatbot. The intended audience of this talk is Python developers with the desire to build robust web applications using only Python – no HTML, CSS, or JavaScript required. Some experience with Streamlit will be helpful but is not a prerequisite. Attendees will walk away with practical knowledge of advanced Streamlit usage including performance optimization through caching, session state management, and app testing. Slides: https://pycon-assets.s3.amazonaws.com/2024/media/presentation_slides/77/2024-05-10T21%3A52%3A33.421215/Advanced_Streamlit_for_Python_Developers.pdf

Watch
Tutorials - Sebastian Raschka: The Fundamentals of Modern Deep Learning with PyTorch

This tutorial is aimed at Python programmers new to PyTorch and deep learning. However, even more experienced deep learning practitioners and PyTorch users may be exposed to new concepts and ideas when exploring other open source libraries to extend PyTorch. Throughout this 3.5-hour tutorial session, attendees will learn how to use PyTorch to train neural networks for image and text classification. We will discuss the individual strengths and weaknesses of deep learning and contrast it with traditional machine learning. We will be going over the PyTorch library in detail, exploring it as a tensor library, automatic differentiation library, and library for implementing deep neural networks so that you get a solid grasp of how PyTorch is structured. After getting a firm grasp of the PyTorch API, we will introduce additional open source libraries, such as PyTorch Lightning, to familiarize attendees with the modern open source stack for deep learning to take advantage of mixed-precision techniques and multi-GPU training. Note that all model code in this tutorial can be run on a laptop computer, but attendees will also be introduced to using free GPU options for this tutorial via Google Colab and Lightning to get the full benefits of the GPU training sections. The tutorial materials and additional information will be uploaded in advance on GitHub at https://github.com/rasbt/pycon2024, which also contains a Discussion Forum for questions before the event. Slides: https://pycon-assets.s3.amazonaws.com/2024/media/presentation_slides/32/2024-05-07T14%3A20%3A47.694524/all-slides.zip

Watch
Tutorials - Meagen Voss, Scott Cranfill: How To Build More Accessible Websites with Wagtail

An astonishing 96.3% of websites have accessibility issues. As a Python developer, you can be a part of the effort to turn that number around. In this workshop, we’ll introduce you to the Web Content Accessibility Guidelines (WCAG) and show you practical ways to incorporate accessibility into your web development. We’ll build a blog website using a Python-powered content management system called Wagtail and demonstrate how you can make your project more accessible as you go. We’ll show you how to customize Wagtail’s accessibility tools to continuously test and improve your website accessibility over time. To benefit the most from this tutorial, students should have at least some basic knowledge of Python and Django. A laptop with Python 3.8 or above installed on it is required to participate in the hands-on exercises. Slides: https://pycon-assets.s3.amazonaws.com/2024/media/presentation_slides/31/2024-05-15T15%3A44%3A59.387449/PyCon_US_-_Wagtail_Accessibility_Tutor_74sTGdT.pdf

Watch
Tutorials - Yan Yanchii: Pointers in Python

Remember pointers from C/C++? Why don’t we add them to Python? Make any Python object mutable by manipulating it directly in memory through the pointer as you would do in C/C++. Why do this? Well, pointers have no use in Python, but the point is not implementation itself, but all the internal parts of Python programming language that you will touch while implementing it. What you will learn: - How to add new piece of syntax to Python. We will implement & and * (address of and dereference) operators just like in C/C++. - How to add custom builtin object. Adding new syntax has to do something, right? In our case it will operate on new pointer builtin object. - Internal layout of Python objects. - How to make our pointer object behave well. Everything in Python is an object and every object internally has to make sure it’s lifecycle does not cause any issues and your program works in a predictable way. - How to do something with new object. Having new syntax and object is cool, but it has to interact with other objects somehow. Remember double underscore methods like __add__ and __eq__? We will see how they are implemented internally and our object will have them. - How Python objects are garbage collected. Our pointer object will cover all ways Python objects can be garbage collected and all tricky parts of this process. These involve reference counting and tracing garbage collector for cyclic objects. - And many more. Optional: to minimise chances of inconsistencies, it is recommended to have Docker installed Slides: https://pycon-assets.s3.amazonaws.com/2024/media/presentation_slides/80/2024-05-25T08%3A34%3A17.223246/Pointers_in_Python.pdf

Watch
Tutorials - Reuven M. Lerner: All about decorators

Decorators are one of Python's most powerful features. But for many developers, they remain somewhat mysterious and intimidating. In this tutorial, you'll learn what decorators are, how they work, how to write them, and when you should use them. Along the way, you'll write a bunch of decorators that will demonstrate their power.

Watch
Tutorials - Renne Rocha: Gathering data from the web using Python

Information is abundant and readily available on the internet. However, the sheer amount of data can be overwhelming and time-consuming to navigate through. That's where web scraping comes in - a powerful tool used to extract data from websites and turn it into a usable format. In this tutorial, we will explore the basics of web scraping and how to implement it using Scrapy (a Python framework). Whether you are a data analyst, programmer, or researcher, this tutorial will equip you with the fundamental skills needed to create your own web scraper and extract valuable information from websites.

Watch
Tutorials - Aya Elsayed, Rhythm Patel: No More Raw SQL: SQLAlchemy, ORMs & asyncio

Managing a database and synchronizing service data representation with the database can be tricky. In this workshop, you’ll learn how to use SQLAlchemy, a powerful SQL toolkit, to simplify this task. We’ll cover how to leverage SQLAlchemy’s Object Relational Mapper (ORM) system, and how to use SQLAlchemy’s asyncio extension in your async services.

Watch
Tutorials - Jessica Greene, Chioma Onyekpere: Monitoring carbon emissions: making the impact...

Full title: Tutorials - Monitoring carbon emissions: making the impact of your python code visible Presented by: Jessica Greene (she/her) Chioma Onyekpere (She/Her) “If the Internet was a country, it would be the 4th largest polluter” [1] The power to make impactful change through technology has never been greater. Doing so starts with understanding the problem space. Our workshop will guide you through the process of quantifying the emissions of your Python code and integrating this awareness into your monitoring strategy. Starting with the basics of observability, an essential part of operating a deployed service, you’ll learn why it’s important to monitor your Python code, what makes a good metric, and the common pitfalls to avoid. We’ll then dive into the practical aspects of exposing and creating custom metrics, scraping and storing them in Prometheus, a time series database, and then visualising them in dashboards using Grafana. The workshop will also include an overview of climate-conscious tech, discussing the tech industry’s contribution to the climate crisis and introducing the principles of green coding. We’ll explore techniques and libraries for extracting metrics for carbon awareness, because "If you can't measure it, you can't improve it." (Peter Drucker) and guide attendees through a practical session on instrumenting your Python code for carbon emissions and visualizing this data. By attending this workshop, you’ll gain valuable insights and hands-on experience in making your code more carbon-conscious. You’ll learn about carbon-aware workloads, strategies for making your services more energy, and carbon efficient, the importance of cloud provider regions and transparency, and how to advocate for change. These skills and knowledge can be integrated into your day-to-day work, making a real difference in our world. Join us in this journey towards a more sustainable future in tech and a better planet for everyone. *source: https://www.sustainablewebmanifesto.com/#citation

Watch