Issue #624

Inline Dependencies, pipx, Multiplying Sequences, and More

April 9, 2024

Inline Dependencies, pipx, Multiplying Sequences, and More
#624 – APRIL 9, 2024 VIEW IN BROWSER
The PyCoder’s Weekly Logo
Install and Execute Python Applications Using pipx
In this tutorial, you’ll learn about a tool called pipx, which lets you conveniently install and run Python packages as standalone command-line applications in isolated environments. In a way, pipx turns the Python Package Index (PyPI) into an app marketplace for Python programmers.

Why Do Python Lists Multiply Oddly?
In Python you can use the multiplication operator on sequences to return a repeated version of the value. When you do this with a list containing an empty list you get what might be unexpected behavior. This article explains what happens and why.

Saga Pattern Made Easy
The Saga pattern lets you manage state across distributed transactions. But it’s difficult to build and maintain. Download this free technical guide to learn how to Automate Sagas Pattern with Temporal, the open source durable execution platform →

Inline Run Dependencies in pipx 1.4.2
PEP 723 adds the ability to specify dependencies within a Python script itself. The folks who write pipx have added an experimental feature that takes advantage of this future language change. This article shows you how the new feature looks and what pipx does with it.

PEP 738 Accepted: Adding Android as a Supported Platform

PEP 742 Accepted: Narrowing Types With TypeIs

Django Bugfix Release Issued: 5.0.4


What Is the Most Useless Project You Have Worked On?

Articles & Tutorials

Enforcing Conventions in Django Projects With Introspection
This post talks about the importance of naming conventions in your code, but takes it to the next level: use scripts to validate that conventions get followed. By using introspection you can write rules for detecting code that doesn’t follow your conventions. Examples are for Django fields but the concept works for any Python code.

Leveraging Docs and Data to Create a Custom LLM Chatbot
How do you customize a LLM chatbot to address a collection of documents and data? What tools and techniques can you use to build embeddings into a vector database? This week on the show, Calvin Hendryx-Parker is back to discuss developing an AI-powered, Large Language Model-driven chat interface.

“Real” Anonymous Functions for Python
The topic of multi-line lambdas, or anonymous functions akin to languages like JavaScript, comes up with some frequency in the Python community. It popped up again recently. This article talks about the history of the topic and the current reasoning against it.

How to Set Up Pre-Commit Hooks
Maintaining code quality can be challenging no matter the size of your project or the number of contributors. Pre-commit hooks make it a little easier. This article provides a step-by-step guide to installing and configuring pre-commit hooks on your project.
STEFANIE MOLIN • Shared by Stefanie Molin

Fix Python Code Smells With These Best Practices
A code smell isn’t something that is necessarily broken, but could be a sign of deeper problems. This post teaches you how to identify and eliminate seven Python code smells with practical examples.

New Open Initiative for Cybersecurity Standards
The PSF has joined with the Apache Software Foundation, the Eclipse Foundation, and other open source groups to form a group dedicated to cybersecurity initiatives in the open source community.

10 Reasons I Stick to Django Rather Than FastAPI
FastAPI is an excellent library and is quite popular in the Python community. Regardless of his respect for it, David still sticks with Django. This post discusses his ten reasons why.

My Accessibility Review Checklist
Ensuring accessibility in your software is important, removing boundaries that limit some people from participating. This checklist is valuable for helping you determine whether your web code meets the accepted Web Content Accessibility Guidelines.

Python Deep Learning: PyTorch vs Tensorflow
PyTorch vs Tensorflow: Which one should you use? Learn about these two popular deep learning libraries and how to choose the best one for your project.

Python Project-Local Virtualenv Management Redux
Hynek talks about his Python tooling choices and how they’ve changed over the years, with a focus on environment management tools like uv and direnv.

Trying Out Rye
Hamuko decided to try out rye. This post goes into detail about what worked and what didn’t for them.

Projects & Code

Brought to you by Real Python for Teamssponsor
Online Python training created by a community of experts. Give your team the real-world Python skills they need to succeed →

drawpyo: Programmatically Generate Charts

best-python-cheat-sheet: The Best* Python Cheat Sheet

rebound: Multi-Purpose N-Body Code

Compatibility Layer Between Polars, Pandas, cuDF, and More!
GITHUB.COM/MARCOGORELLI • Shared by Marco Gorelli

Reduce the Size of GeoJSON Files
GITHUB.COM/BEN-N93 • Shared by Ben Nour

📆🐍 Upcoming Python Events

Weekly Real Python Office Hours Q&A (Virtual)
April 10, 2024

Python Atlanta
April 11 to April 12, 2024

DFW Pythoneers 2nd Saturday Teaching Meeting
April 13, 2024

Inland Empire Python Users Group Monthly Meeting
April 17, 2024

Data Ethics
April 17, 2024

Python Meeting Düsseldorf
April 17, 2024
Happy Pythoning!
Copyright © 2024 PyCoder’s Weekly, All rights reserved.