An open letter to the PSF from Python community organizers in over a dozen African countries. The letter was prompted by the PSF's delayed disbursement of a $9,000 grant to Africa's first DjangoCon, and it highlights other issues within the PSF, including racism, lack of attention to marginalized groups, and non-compliance with local laws. (As an aside, the PSF gave 1% of its grants to Asia in 2022, compared to 16% to Africa...)
TL;DR
African Python communities publish an open letter to the PSF that stirs debate; Django 5.0 ships, and Apple's mlx array framework for Apple silicon is another heavyweight release.
Articles & Tutorials
× 12Django 5.0 was released this week, and it only supports Python 3.10 and later. Key new features: The new Field.db_default parameter allows you to set a default value that is calculated by the database; GeneratedField allows you to create columns that are generated by the database; Field groups and field group templates have been introduced, which simplify the rendering of related elements for form fields. (Bonus: Video introducing new features in Django)
Lex/Flex can be used to generate lexical analyzers that process lexical structures in source code. The author implemented a general rule-based lexical analyzer by modifying a program in the official Python documentation, which can be used to handle simple lexical analysis requirements.
This article points out two wrong ways people use dependency injection in FastAPI and introduces how to implement dependency injection in FastAPI using python-dependency-injector.
Using list comprehensions appropriately can make your code more concise and elegant, but overusing them will severely impair the readability of your code. The author provides three examples, each implemented with list comprehensions and a conventional approach, allowing readers to appreciate how easy-to-understand code is superior to fancy showmanship.
In his latest post, Armin Ronacher, the creator of Flask, discusses the topic of types in Python. The central thesis is that Python's dynamic typing is an advantage due to its inherent philosophy, which clashes with typing. Typing has its merits, but it also comes with a cost. The author reminisces about the Python of the past.
A very detailed tutorial on adding full-text search capabilities to your Django project using django-watson and PostgreSQL. The library supports searching across multiple models and sorting by relevance. (star 1.2K)
The Celery fanout pattern is a task distribution pattern where a single task triggers multiple child tasks to be executed in parallel. The author introduces a practical use case of this pattern, arguing that it is a good way to implement dynamic workflows in task signatures.
Asyncio is Python's standard library for asynchronous programming, but it's not your only option. This article introduces and compares seven alternatives, including older libraries like Tornado, Twisted, and Gevent, as well as newer ones like Curio, Trio, AnyIO, and UVloop.
A deep dive into the inner workings of CPython's dynamic dispatch mechanism. Dynamic dispatch is the process of determining which method or function to call at runtime (rather than at compile time). Something as simple as a+b can have multiple combinations of types, and the actual computation can be quite different.
GIF is an image format that supports animation without audio. Are there any Python libraries that can display animated GIFs programmatically? This article introduces three approaches using tkinter, PySimpleGUI, and Jupyter Notebook.
REPL (Read-Eval-Print Loop) is an interactive environment for a programming language. Python's standard library includes a code module that provides the functionality to implement a REPL. This article demonstrates how to build a simple REPL by incrementally introducing requirements.
🎁 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
× 12This is one of the hottest recent projects based on GPT-4v. It allows large language models to view screen content, operate the mouse and keyboard to achieve specific goals, just like humans. The current challenge is that GPT-4v has a high error rate in mouse click location. (5.1k stars)
A Markdown parser that focuses on extending the developer experience, following the CommonMark spec v0.30 spec. Speed is not its strength, but it makes it easy to inspect the AST, implement your own elements and renderers. (Submitted by @frostming)
This project, created by a college student, has been trending on WeChat Moments this week. It allows users to export their WeChat chat history and generate an annual chat report. Its slogan, "My data, my choice," resonates with many users. The exported data can be used to train personal AI! (12.5K stars)
This is a dependency of the previous project, which can decrypt the database, view and export chat records, and support multi-user information acquisition in the WeChat multi-open scenario. (star 1.6K) (PS. I always feel that these two projects will be targeted by WeChat, what do you think?)
A machine learning array framework for Apple silicon with a Python API similar to Numpy. (7.2k stars)
A curated repo of awesome data structures and algorithms questions, solved in Python. It also contains a collection of interview questions from big companies and study notes for computer science. (star 1.7K)
An online version of the Python interpreter in a web browser, supporting Python versions 2.7, 3.3-3.10, and pre-installed with most commonly used libraries, including Turtle, Tkinter, Pygame, Numpy, Matplotlib, Pandas, Scipy, etc.
It collects libraries related to asynchronous IO in the Python community, including aiohttp, aiopg, aiomysql, yarl, aiokafka, and more.
A VSCode extension that features frame visualization, beautiful flame graphs, shows the line of code that executed a SQL query, allows jumping directly to the exception location, and more.
A tiny tool with only 200+ lines of code that fakes a DNS server to exfiltrate files hidden in DNS requests. It supports multiple files, Gzip compression, custom subdomain information, and more. (1.6k stars)
Generate contribution calendars, lines of code analysis, contribution graphs in various dimensions, and more for your GitHub profile. Easily embed dynamic badges in your profile page. (6.4k stars)
Think pixelating a screenshot makes it secure? Think again! This library recovers plaintext information from images with high accuracy. The repository includes an explanation of the technique and a note on its limitations. (24.7k stars)