Python Trending Weekly #12

Welcome to the 12th issue of Python Trending Weekly, a weekly newsletter about Python, AI and general programming techniques. The original version of the weekly publication was written in Chinese, and what you are reading here is the English version translated by ChatGPT.

Most of the content shared here is in English, with a small portion in Chinese, which is indicated in the title. It took a lot of courage for me to publish this weekly publication, originally intended for Chinese readers, to the English-speaking world. Your feedback is welcome, and I appreciate your subscription and support!

🦄 Articles & Tutorials

  1. Debugging Crashes and Deadlocks in Python using PyStack

Introduces a powerful tool called PyStack that can solve difficult debugging problems such as deadlocks, program hangs, segmentation faults, and debugging Python and C/C++ mixed applications. It supports two debugging methods: attaching to a running process or analyzing core dump files of a crashed process.

  1. FastAPI Project Template

A comprehensive FastAPI project template with CI/CD, Docker, PostgreSQL, Makefile, unit/integration testing, linting, and type checking.

  1. Python FastAPI Microservices with Polylith

Polylith is a software architecture framework that decomposes a system into testable and reusable independent units. The author combines FastAPI with the Polylith architecture to develop a project template.

  1. Python Logging Module: Practical Applications and Best Practices (Chinese)

Provides a detailed analysis of the logging module, covering basic introduction, practical applications, and best practices. It explains how to efficiently use it for logging and how to avoid common pitfalls.

  1. Benchmarking Python and Rust Async Web Server Performance

The article uses JMeter to separately test the Rust Axum framework and the Python Blacksheep framework. Can you guess the outcome of the tests?

  1. dinov2_retrieval: An Image Retrieval Application Based on DINOv2 (Chinese)

Meta has released the DINOv2 visual pre-training model, which accurately understands the semantic information in images. This article develops a Python tool using it to retrieve the most similar images in a test dataset.

  1. CLI Tools Hidden in the Python Standard Library

What useful small tools are there in the Python standard library that can be invoked directly with python -m xxx? This article uses ripgrep to find dozens of modules and focuses on introducing http.server, base64, asyncio, tokenize, ast, json.tool, random, and other tools.

  1. How to Use TailwindCSS in a Python Project?

Tailwind is a CSS framework that has been popular in frontend development in recent years. How can it be applied to Python web projects? The article mainly introduces the tailwindpie library and demonstrates how to use it in a Flask project to achieve automatic installation and configuration of TailwindCSS.

  1. Practical Guide to Metaprogramming in Python

Introduces several mechanisms of metaprogramming in Python: decorators, metaclasses, function and class decorators, dynamic code generation, as well as keywords and built-in functions commonly used in metaprogramming.

  1. How Does CPython Print Stack Traces?

A hardcore long article that explains how CPython represents the call stack of a program and how it resolves bytecode addresses to source code line numbers. The article analyzes the internal mechanisms of CPython and provides useful information for CPython performance analysis and debugging.

  1. Pathlib for Path Operations

Pathlib is a library for directory-related operations in Python, and it should be the most user-friendly one. The article provides a detailed introduction to its common usage, compares it with other commonly used tools, and performs performance analysis for some scenarios.

  1. Software Architectures of Stack Overflow, Shopify, and Levels.fyi

The article discusses the software architectures of three major websites.

  1. 10 Tips for Writing Clean Python Code

The readability and maintainability of code cannot be emphasized enough! This article introduces some basic principles that reflect the programming literacy of programmers.

  1. Meta Developer Tools: A Programming System Supporting Large-Scale Collaboration

What developer tools do thousands of Meta developers use to support large-scale collaboration? The article introduces several open-source tools (Sapling version control, Buck2 build system, Infer/RacerD/Jest testing and static analysis), and Meta's official blog also has an article introducing the developer workflow Meta Developer Workflow: Exploring Tools Used to Code.

🐿️Projects & Resources

1、Which Python projects on GitHub are worth recommending for learning?

Which projects on Github have applied best practices and have a strong and good architecture? This is a post on Reddit, you can go and see what everyone recommends.

2、python-cheatsheet: Python Quick Reference Guide

A very comprehensive Python manual, in addition to the Github repository, there are also online websites and PDF versions. (star 33K)

3、pandora: Pandora, a ChatGPT that lets you breathe smoothly (Chinese)

A project open-sourced by Chinese developers, it implements the main operations of the web version of ChatGPT, which can solve many pain points of accessing ChatGPT in China. (star 18.6K)

4、py4web: Database-driven Web development framework

This framework can quickly develop database-driven Web applications. It is based on the popular full-stack framework web2py, but it is 10-20 times faster than the latter.

5、FastAPI-Vue-Admin: Agile development framework based on FastAPI+Vue (Chinese)

An agile development framework carefully crafted based on FastAPI, Vue2.x, ElementUI, MySQL, etc., implementing a pluggable component-based development method. A Chinese work (paid), with comprehensive Chinese support.

6、ChatALL: Chat with ChatGPT, Bing Chat, Bard, Alpaca, Claude, Xunfei Starfire, Wenxin Yiyi, etc. at the same time (Chinese)

The project, known in Chinese as "Qi Dao", allows for simultaneous chat with multiple AIs to obtain the best answer. (star 8.2K)

7、vectordb: A Python vector database

A vector database developed in pure Python, supporting CURD and powerful extensibility (sharding and replication). It uses DocArray as the engine to drive vector search logic, and uses Jina to ensure efficient and scalable indexing services.

8、python-sortedcontainers: Ordered container types (ordered lists, ordered dictionaries, and ordered sets)

An ordered container library implemented in pure Python, providing ordered versions of lists, sets, and dictionaries, with API compatibility, and often faster than C implementations. The user guide provides several performance comparison reports, and the data is impressive. (star 3K)

9、quart: An asynchronous Python Web framework

This is an asynchronous version of the Flask framework, supporting the quick transformation of Flask projects into asynchronous support. (star 2K)

10、ShortGPT: An AI framework for automatically generating short video content

A powerful automated content generation framework that simplifies video creation, material acquisition, subtitle generation, voiceover synthesis, and editing tasks. (star 1.4K)

🐢Podcasts & Videos

1、Snake Catcher Says Ep 41: Chat with Penguin about CPython optimization and the work of the compiler group in big companies (Chinese)

The guest of this podcast has appeared in the 7th issue of our weekly, he added return constant instruction to CPython, the program talked about his work on CPython and the situation of doing compiler development in Tencent.

2、The Python Show 07 - Interview with the author of Robyn Web framework

Robyn is a lightweight, high-performance Python Web framework developed in Rust. This podcast discussed topics related to Robyn.

3、80 videos of the 2023 Python Web Conference

The Python Web Conference (Python Web Conf) held its 5th edition this year, and related video materials were released last week, covering topics such as artificial intelligence/machine learning, big data, CI/CD, Serverless, security, containers, etc.

4、About AI content: 6 YouTube channels recommended

Want to understand AI? Want to watch videos related to ChatGPT? Want to discover the latest trendy AI tools? Here are 6 YouTube channels recommended.

5、Drop Your Weapon 013|I don't want to work either, I just want to find a shore (Chinese)

This is my favorite podcast I heard this week! This episode discussed topics related to employment and life choices. (If you are a college entrance examination graduate, you can listen to the 11th special issue of the college entrance examination 9 years after becoming the top scholar, I am still having nightmares about the college entrance examination)

🐱Sponsor & Support

If you find the weekly valuable, feel free to appreciate or buy me coffee to support!

If you like the weekly, please share it with others who need it, so that more people can benefit from it~

🐼Subscribe Welcome

WeChat| Blog| Email | Github | Telegram | Twitter