Python Weekly (Issue 566 September 8 2022)

Python Weekly - Issue 566

Python Weekly

Welcome to issue 566 of Python Weekly. Last week, our 11 years old Twitter account

 all of a sudden got suspended and I really don't understand why. We never had any issues whatsoever before. I immediately appealed via their standard process and also I followed up again, but haven't heard back yet. If you work at Twitter or know someone who does and can help me get our account reinstated, I will highly appreciate it.

From Our Sponsor 

Want to get started with Capture the Flag (CTF) security competitions? Join Snyk's CTF 101 Workshop on September 14 at 11am EDT to learn how to solve web & pwn CTF challenges. Get live support from CTF experts in the hands-on lab as you solve your first challenge.

News

Do you have ideas on improving Python packaging? Here is an opportunity to get your opinions heard.

Articles, Tutorials and Talks

In this video I share 5 tips to help you write code that has low coupling. I'll show you several examples and also share a story of a technique I used several times in the past that has really helped me reduce coupling and solve more complex software design problems.

After noticing an annoying warning, I went on an absurd yak shave, and discovered that because of a tiny handful of Python packages built with an appealing-sounding but dangerous compiler option, more than 2,500 Python packages—some with more than a million downloads per month—could end up causing any program that uses them to compute incorrect numerical results.

There is no universal solution to all optimization problems. That's partially why Python is fascinating. You can always find/create an easy-to-use tool that can precisely solve your problem at hand. In terms of scientific computing, Taichi is an ideal option within Python that can help you achieve performance comparable to C/C++.

Python's strings have dozens of methods, but some are much more useful than others. Let's discuss the dozen-ish must-know string methods and why the other methods aren't so essential.

Build a complete indoor asset tracking IoT solution using the Blues Wireless Notecard, an ESP32 host MCU, the Notecarrier-F, and Datacake.

This video goes over a list of 25 mistakes commonly made my beginners learning pandas in python. Pandas is a great tool, but there are some pitfalls to avoid!

Python's list comprehensions (and generators) are an awesome feature that can greatly simplify your code. Most of the time however, we only use them to write a single for loop, maybe with addition of one if conditional and that's it. If you start poking around a bit though, you will find out that there are many more features of Python's comprehensions that you don't know about, but can learn a lot from.

Starting a Python application typically results in a flurry of imports as modules from various locations (and the modules they import) get added into the application process. All of that occurs before the application even gets started doing whatever it is the user actually launched it for; that delay can be significant—and annoying. Beyond that, many of those imports may not be necessary at all for the code path being followed, so eagerly doing the import is purely wasted time. A proposal back in May would add a way for applications to choose lazy imports, where the import is deferred until the module is actually used.

Do you have an old pair of PC speakers, or an old Hi-Fi, that you would like to convert into a pair of Bluetooth® speakers to play music from your phone? A Raspberry Pi can be easily used as an audio bridge between a Bluetooth® device and an analog speaker system, to make this possible. In this quick guide, I will show you how to set up the software on a Pi, using PipeWire, to achieve this.

Interesting Projects, Tools and Libraries

An easy way to extract information from documents.

Distributed background task queue for Python backed by Redis, a super minimal Celery.

Create videos with Stable Diffusion by exploring the latent space and morphing between text prompts.

Automate the creation of large batches of AI-generated artwork locally.

Cog is an open-source tool that lets you package machine learning models in a standard, production-ready container.

Tensor search for humans.

Export Hugging Face models to Core ML and TensorFlow Lite.

A Python library for univariate regression, interpolation, and smoothing.

Sharing patterns I use with Django and htmx.

Run Python code from Tweets.

A unified Python API for CAPTCHA solving services.

A privacy-focused and secure CMS, Blog and Portfolio made with Python & Django. Designed with developers and IT professionals in mind.

New Releases

This release includes the following announcements:

  • Improved IntelliSense support for Jupyter Notebooks

  • A new Flake8 extension

  • Internship highlight: improved unittest support and notebook image pasting

Upcoming Events and Webinars

Experts from Azure DevOps, GitHub Actions, GitLab CI/CD and JFrog Pipelines will join IndyPy for a panel: “Hot Takes on CI Tools We Use.” The lively discussion, moderated by Calvin Hendryx-Parker (Six Feet Up), will feature the pros and cons of your favorite tools and, as always, awesome door prizes.

This month, PyData Pittsburgh is convening a panel discussion of data science managers and leaders to share their perspectives and advice on what it takes to get a job in data science or machine learning.

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.