DEV Community

Cover image for Python Trending Weekly #34 (2024-01-06)
豌豆花下猫
豌豆花下猫

Posted on

Python Trending Weekly #34 (2024-01-06)

Welcome to the Python Trending Weekly, a weekly newsletter about Python, AI and general programming techniques, with the majority links in English and a small portion in Chinese.

The original version of the weekly was written in Chinese. What you are reading here is mostly translated by LLMs.

Substack Channel : Click to subscribe

🦄Articles & Tutorials

  1. A Simple Introduction About Python JIT

Python 3.13 will introduce a copy-and-patch JIT compiler, which makes the most of the LLVM ecosystem. The compiler uses clang, the compiler parameter is set to -o3 to get the best performance, and the binary tools are llvm-objdump and llvm-readelf. The scheme can be described as both new and good.

  1. Fastest Way to Read Excel in Python

How to read Excel files with Python? This article compares the performance of Pandas, Tablib, Openpyxl, LibreOffice, DuckDB and Calamine in terms of speed, type and correctness.

Comparison of Python Libraries for Reading Excel

  1. Build a Scalable Flask Web Project From Scratch

Flask is a powerful and flexible web framework. This beginner-friendly tutorial covers how to set up a Flask project, develop a starter project, add multiple pages using blueprints, use Jinja templates, store static files, and more.

  1. Python, C, Assembly - 2'500x Faster Cosine Similarity

Cosine similarity is a widely used metric in machine learning and information retrieval. This article introduces some low-level optimizations, taking the cosine similarity as an example, starting with a pure Python version, NumPy slows it down, SciPy speeds it up by 2-5x, C brings a 200x speedup, SIMD intrinsics a 400x speedup, AVX-512 with BMI2 a 747x speedup, AVX-512FP16 a 1260x speedup, and AVX-512VNNI a 2521x speedup.

  1. AI or Not — detect AI-generated photos using AI

The latest AI models like Stable Diffusion XL and Midjourney v6 can generate extremely realistic images, making it harder for the human eye to distinguish between real and fake. The author trained a classifier that can detect AI-generated images with 99% accuracy.

  1. max is broken

The author keenly found that the functions sum, all, any, and math.prod all have proper default values when the input is an empty list, but the max and min functions will throw an error! The author thinks it should be equal to negative infinity, what do you think?

  1. App Automation Testing with Appium: Common Appium APIs and Operations

Appium is a commonly used Android UI automation testing tool, and this article is part of a series of tutorials on Appium automation testing.

  1. The simplest way to build an instant messaging app with Django

How to add real-time events to your Django app asynchronously? Without Redis, using Django's new async features. This article demonstrates the development of a minimalistic web-based instant messaging application.

  1. Understanding Numeric Data Types in Python

What are the commonly used numeric data types in Python? What are their characteristics and how are they implemented in CPython? The article introduces integer, floating-point, and complex types, as well as the math, decimal, and fractions modules. (Appendix: PEP-3141--Numeric Tower)

  1. Asyncio Logging Without Blocking

How to implement non-blocking logging in asyncio programs? The article introduces how to use a shared Queue and QueueHandler to log, and use QueueListener to store the logs.

  1. How Instagram scaled to 14 million users with only 3 engineers

Instagram went from 0 to 14 million users in 2010-2011, with only 3 engineers! What tech stack did they use and what successful experiences can we learn from? The article introduces the relevant technologies and implementation schemes used.

Instagram Early Architecture Overview

  1. Language Design of Starlark by Google

Google designed Starlark to replace Python as a build description language, and the syntax is very similar. This document explains some of its design principles and many differences from the Python language, such as its Boolean values are not integers, strings are not iterable, there is no "is" operator, for/if statements are not allowed outside of functions, and so on.

  1. The History and State of Data Engineering

The article is from the free online e-book Data Engineering Design Patterns, which is being serialized. Data engineering has gone through stages such as SQL, dimensional modeling, business intelligence and big data, MapReduce and Hadoop, and the cloud revolution.

🎁 Python Trending Weekly 🎁 organizes its content into seasons, with every 30 issues forming a season. The highlights from the first season have been compiled for your convenience. You can access them online here (Chinese).

🐿️Projects & Resources

  1. watchfiles: Simple, modern and fast file watching and code reload in python

A simple, modern and fast file watching and code reload library for Python. It uses the Notify library from Rust to handle file system notifications under the hood, and supports both synchronous and asynchronous event handling. (1.4k stars)

from watchfiles import watch

for changes in watch("./path/to/dir"):
    print(changes)
Enter fullscreen mode Exit fullscreen mode
  1. hy: A dialect of Lisp that's embedded in Python

Hy is an alternative syntax for Python that provides a variety of additional features, generalizations, and syntactic simplifications over Python. Compared to other Lisps, it offers direct access to Python's built-in and third-party libraries. (star 4.7K)

  1. pyapp: Runtime installer for Python applications

A tool developed in Rust that builds self-contained Python applications with a runtime installer, creating a single binary for each platform.

  1. yarl: Yet another URL library

Provides a URL class that makes it easy to parse and modify URLs, supporting access to each part of the URL via attributes. (1K stars)

  1. apispec: A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)

Apispec: A pluggable API specification generator. It currently supports the OpenAPI Specification (formerly known as the Swagger specification). It is framework agnostic and has built-in support for marshmallow. (1.1K stars)

  1. marshmallow: A lightweight library for converting complex objects to and from simple Python datatypes

A simple object serialization library that is ORM/ODM/framework agnostic and can be used for validating input data, serializing and deserializing, and comes with a rich set of field types and supports multiple data formats. (star 6.8K)

  1. jake: Effortlessly create and deploy your own one-link website on GitHub

A one-link website is suitable for use as a personal homepage. This website template uses GitHub Pages for deployment, allowing you to easily and effortlessly build a beautiful personal homepage.

  1. docflow: DocFlow is a powerful Document Management API designed to streamline document handling, including seamless uploading, downloading, organization, versioning, sharing, and more

Simplify the handling of document types, supports authentication and authorization, list permission control, document CRUD, document preview, version control, etc.

  1. auto_job__find__chatgpt__rpa: This is a tool used to automatically generate a cover letter using chatgpt based on your resume and job description and send messages to bosses in China

A Chinese-made tool that automatically generates cover letters using ChatGPT based on your resume and job description, and sends messages to hiring managers in China. Good luck in your job search during this winter hiring season!

  1. oshit: Get your hit of HackerNews in the terminal

A simplified Hacker News reader for the terminal, without features like login, voting, or posting, but with support for viewing user and comment information.

Hacker News reader in the command line

  1. mixtral-offloading: Run Mixtral-8x7B models in Colab or consumer desktops

Enables efficient inference of Mixtral-8x7B models, requiring approximately 16 GB of VRAM and 11 GB of RAM. (1.4k stars)

  1. RecoverPy: Interactively find and recover deleted or overwritten files from your terminal

A file & data recovery tool for Linux that supports text search and interactive operation, allowing you to recover deleted or overwritten files. (1.1k stars)

  1. MobileVLM: MobileVLM: A Fast, Strong and Open Vision Language Assistant for Mobile Devices

A multimodal vision-language model (MMVLM) that runs on mobile devices, with 1.4B and 2.7B parameter sizes, achieving impressive performance of 21.5 tokens per second and 65.3 tokens per second on Qualcomm Snapdragon 888 CPU and NVIDIA Jeston Orin GPU, respectively.

Architecture diagram of MobileVLM

🐢Podcasts & Videos

  1. Snake Charmer Says Ep 44. Chatting with Tualatrix About Tech Stack for Indie Development

How do independent developers make technology selections? Why does Tualading use Python as the backend language for his projects? (Appendix: Another podcast two years ago ByteTalk 3. Chatting with Tualading About the Things of Independent Developers)

  1. An Introduction to Coding In Rust for Pythonistas

This video compares and contrasts Rust programming from the perspective of Python developers, highlighting key differences in features such as Python classes and Rust structs.

🐼Subscribe Welcome

  • Blog: Explore my independent blog where you can find a collection of original/translated technical articles over the years, along with some reflections since 2009.
  • Newsletter: Subscribe to my channel on Substack for a curated newsletter delivered straight to your inbox, keeping you updated on current affairs.
  • Github: Access the Markdown source files of this weekly digest on Github and feel free to use them for anything you have in mind!
  • Telegram: Beyond notifications for the weekly digest, I consider it an "extra edition," providing additional, more diverse information.
  • Twitter: Follow me on Twitter where my feed is filled with numerous accounts of developers and organizations in the Python community.

Top comments (0)