Python Weekly (Issue 659 July 18 2024)

Python Weekly - Issue 659

Python Weekly

Welcome to issue 659 of Python Weekly. Let's get straight to the links this week.

News

The JFrog Security Research team identified the leaked secret and immediately reported it to PyPI’s security team, who revoked the token within a mere 17 minutes! This post will explain how we found a GitHub PAT that provided access to the entire Python infrastructure and prevented a supply chain disaster. Using this case, we will discuss the importance of (also) shifting right in secrets detection – searching for secrets in binaries and production artifacts, not just on source code.

Articles, Tutorials and Talks

Marcelo Trylesinski, a senior software engineer at Pydantic and a maintainer of open-source Python tools including Starlette and Uvicorn, joins host Gregory M. Kapfhammer to talk about FastAPI. Their conversation focuses on the design and implementation of FastAPI and how programmers can use it to create web-based APIs. They also explore how to create and deploy a FastAPI implemented in the Python programming language. Brought

Modern programming languages facilitate software reuse via package managers, but this leads to dependency bloat, which increases security risks, maintenance costs, storage requirements, and slows load times. A detailed analysis of 1,302 Python projects and 3,232 dependencies in the PyPI ecosystem found over 50% of dependencies are bloated, with 15% of security defects residing in these bloated areas, highlighting the need for improved debloating techniques and practices.

An overview of the ongoing efforts to improve and roll out support for free-threaded CPython throughout the Python open source ecosystem.

The article discusses using Z3, an SMT solver, to find and verify simple rewrite rules for PyPy's JIT compiler operations. It demonstrates how to encode JIT operations into Z3 formulas and use the solver to prove the correctness of simplifications, as well as synthesize constants for more complex rewrite patterns.

This is an article about a Python epoch timestamp timezone trap. It discusses how epoch timestamps can be tricky to work with in Python, especially when dealing with timezones. The author provides a few tips for avoiding the trap.

This is an article about debugging a Jupyter Echo Kernel ported to Deno using deno-python. The author encountered a segmentation fault and used gdb to identify the problem. The issue stemmed from the creation of the pyMethodDef buffer, and adding 4 bytes of padding resolved it. However, the kernel still exits unexpectedly.

This is an article about using eBPF to analyze the Python GIL (Global Interpreter Lock), a potential performance bottleneck. It explains how to measure the GIL's impact and provides a guide on using eBPF for instrumentation.

This comprehensive, hands-on tutorial teaches you how to simplify deep learning model development with PyTorch Lightning. Perfect for beginners and experienced developers alike, it covers environment setup, model training, and practical examples.

How can search engines be so fast? While there are many parts of a search system, one of the key concepts to know is the inverted index.

If you don't want to pay for a service to transcribe your audio, you can generate it easily on your own machine with a little setup. Here's how.

The article explores resource management and cleanup behavior in Python generators, highlighting unexpected issues when generators are not fully consumed. It demonstrates various scenarios, including the use of context managers and the finally clause, to ensure proper cleanup and resource management in generator functions.

Interesting Projects, Tools and Libraries

Run your own AI cluster at home with everyday devices.

Korvus is a search SDK that unifies the entire RAG pipeline in a single database query. Built on top of Postgres with bindings for Python, JavaScript, Rust and C.

MobileLLM Optimizing Sub-billion Parameter Language Models for On-Device Use Cases. In ICML 2024.

A fast and tunable vector search extension for SQLite.

kaskade is a text user interface for kafka, which allows you to interact and consume topics from your terminal in style!

A full stack app for interruptible, low-latency and near-human quality AI phone calls built from stitching LLMs, speech understanding tools, text-to-speech models, and Twilio’s phone API.

Upcoming Events and Webinars

Join us for an interactive workshop where we’ll dive into the world of LLM Guardrails. Discover the mechanisms that ensure applications produce reliable, robust, safe, and ethical outputs, and understand their crucial role in LLMs.

There will be following talks

  • Low effort configurable python: type hints and dependency injection

  • From Cronjobs to Apache Airflow: Enhancing Our Data Infrastructure

  • Exploring Creative Fusion: Robotics, 3D Printing, and Python with OpenCV, TensorFlow, and Beyond

There will be following talks

  • Scraping for fun and (no) profit

  • Python can do ANYthing: unit-testing in sql

  • Code Reviews: The Art and the Science

There will be following talks

  • Evaluating RAG applications

  • Estimagic: a package for difficult numerical optimization problems

  • Intro to OSSci + AI Alliance

There will be a talk, Let's Talk Databases in Python: SQLAlchemy and Alembic.

There will be a talk, Using Bayesian Regression to Link Biochemical and Cellular Efficacy of the Coronavirus Main Protease.

Our Other Newsletters

 - A free weekly newsletter for programmers.

- A free weekly newsletter for entrepreneurs featuring best curated content, must read articles, how to guides, tips and tricks, resources, events and more.