Python Trending Weekly
ISSUE 43

Choosing Family Over Open Source

2024-03-23 Season 2

TL;DR

A maintainer chooses family over open source with disarming honesty; Musk open-sources Grok, CPython without the GIL gets a hands-on test, and ruff and uv keep rising.

Articles 12 Projects 12 Media 2
🦄

Articles & Tutorials

× 12
01 My Shifting Open Source Priorities gregoryszorc.com

The author has open-sourced multiple Python projects including PyOxidizer and python-build-standalone. However, with his programming interests shifting toward Rust and his new roles as husband and father taking up time and energy, he's choosing to prioritize family and is looking for new maintainers for these open source projects.

02 Waking my computer from afar bernsteinbear.com

How do you remotely wake up your home computer when it's in sleep mode? The author used a Raspberry Pi single-board computer + a simple Python web page + systemd service to send data packets to the computer's network controller, achieving remote machine wake-up.

03 The memory footprint of your Python application codebeez.nl

Compared to statically typed languages, Python consumes a lot of memory. This article explores Python's memory model: how objects are allocated, where they're stored, and how they're eventually cleaned up. It introduces simple techniques to significantly improve memory usage.

04 Regex character "$" doesn't mean "end-of-string" sethmlarson.dev

What does the "$" symbol match in regular expressions? How does Python's re.MULTILINE mode affect string matching? Do different programming languages behave the same way? When should you use "\z" and "\Z"?

Different programming languages matching string endings
05 Every dunder method in Python pythonmorsels.com

Dunder methods are special methods that start and end with double underscores, like __init__(). Python has over 150 special dunder methods. This article categorizes and provides a comprehensive list of them.

06 Python Multi-language Support: Best Practices for Internationalization and Localization juejin.cn

Python has rich libraries for internationalization and localization support. This article explains how to use the gettext library for language internationalization and how to manage localization resources.

07 Building a ChatGPT-style Q&A Assistant with Qwen Large Model on Windows juejin.cn

Qwen is a large language model released by Alibaba. The author built a Qwen-based AI Q&A assistant on a Win10 system. The content includes environment setup, model downloading, and using transformers to implement model conversation functionality.

08 (How to Write a (Lisp) Interpreter (in Python)) norvig.com

"If you don't know how compilers work, then you don't know how computers work." The author develops a Lisp interpreter using Python, providing detailed coverage of Scheme syntax and deep exploration of how interpreters/computers work.

09 Parsing URLs in Python tkte.ch

Correctly parsing URLs is harder than you might think - they've changed dramatically since being introduced in 1994. Python's standard library urllib doesn't follow any URL specification. This article introduces two WHATWG-compliant parsing libraries: ada-python and can_ada. The latter is 2x faster than the former, and the former is 2x faster than urllib.parse.

10 Duck Typing in Python: Writing Flexible and Decoupled Code realpython.com

The core idea of duck typing is "if it walks like a duck and quacks like a duck, then it is a duck." Type is determined by an object's behavior, not by rigid definitions. This comprehensive article provides detailed coverage of duck typing: what it is, how to use it, its pros and cons, and solutions to address duck typing's shortcomings.

11 Pretending to be PostgreSQL with Python ivdl.co.za

Introduces the communication flow between PostgreSQL server and client, implementing a minimal server using Python.

12 Building for Builders deven.codes

The author developed two Python frameworks last year. This article shares what he learned while building frameworks. Some advice includes: define your anti-goals, understand what already exists, think interface-first, use it before it's ready, one sample isn't enough, prioritize documentation, etc.

🎁Python Trending Weekly🎁 Every 30 issues makes a season, and the highlights from the first season have been compiled for easy reference. Online access: Python Trending Weekly Season 1 Highlights Collection (Issues 1~30)

🐿️

Projects & Resources

× 12
01 grok-1: Musk's Open Source Grok github.com

This week's hottest project is definitely Musk's almost-delayed Grok large language model, with an impressive 314B parameters, a mixture of 8 experts, and a maximum context length of 8192 tokens. (43K stars)

02 DarkGPT: Query Leaked Databases Based on GPT-4-200K github.com

An open source intelligence assistant based on GPT-4 that efficiently collects and analyzes information from the paid DeHashed service, helpful for cybersecurity and data breach investigations.

03 structlog: Simple, Powerful, and Fast Python Logging github.com

A Python logging library emphasizing structured and type-safe logging, compatible with the logging standard library, supporting JSON, logfmt, and beautiful console log output. (3.1K stars)

04 pydumpling: Exception Debugger for Python github.com

A Python debug tool that, like debugging core dump files in Linux, supports preserving current call stack frames when exceptions occur or at any point in the program, then debugging through pdb. Supports global hooks and remote server debugging. (Contributed by @cocolato)

05 can_ada: Fast and Spec-Compliant URL Parsing Library github.com

A WHATWG-compliant URL parser also used in projects like Node.js. 4x faster than the standard library urllib.

06 Mindgraph: Generate and Query Ever-Expanding Knowledge Graphs with AI github.com

A proof-of-concept project that can serve as a template for building and customizing your own CRM solutions, focusing on easy integration and scalability.

Mindgraph: Generate and Query Ever-Expanding Knowledge Graphs with AI
07 speechbrain: PyTorch-based Speech Toolkit github.com

A PyTorch toolkit designed for quickly and easily creating advanced speech and text processing technologies, accelerating conversational AI development (i.e., voice assistants, chatbots, and large language models). (7.7K stars)

08 python-anyconfig: Load and Dump Configuration Files in Various Formats with a Common API github.com

Provides a very simple and unified API for handling configuration files in various formats, supporting JSON, ini, Pickle, XML, Java properties, YAML, TOML, and more.

09 Llama-Chinese: Chinese Llama Community, the Best Chinese Llama Large Models github.com

An advanced technical community focused on optimizing Llama models for Chinese and building upper-layer applications. Regularly organizes online events, technical seminars, and experience sharing to promote innovative exchanges among members. (9K stars)

10 python-for-android: Turn Python Programs into Android APKs github.com

Packages Python applications into binaries (APK, AAB, and AAR) that run on Android devices, supporting multiple CPU architectures and most pure Python packages plus some popular C-dependent packages (like numpy, sqlalchemy). (8K stars)

11 img2img-turbo: Stable Diffusion Turbo Implementation for sketch2image, day2night, etc. github.com

Quickly generate images from sketches, convert night images to day (or vice versa), convert sunny images to rainy, and more.

12 ludic: Lightweight Framework for Building Dynamic HTML Pages with Pure Python github.com

Build HTML pages using React-like components, designed to work with htmx.org with almost no JavaScript required. Backend based on the Starlette framework.

🐢

Podcasts & Videos

× 2
01 Experience CPython Without GIL bilibili.com

The CPython main branch has merged a switch to disable GIL. This video shows what Python performance looks like without GIL.

02 ruff, uv and Astral: Python toolchain, speeding up with Rust podcast.pythontest.com

ruff and uv come from the same team, bringing very promising impact to Python's foundational toolchain. This podcast features a conversation with Charlie Marsh. (Also: another similar topic podcast uv - The Next Evolution in Python Packages?)

🐢

Book Giveaway

Irregular giveaway events! This week we're giving away 5 copies of "Problem Solving with Algorithms and Data Structures using Python (3rd Edition)". Drawing date: March 29th. Send the number "8043" to the Python Cat WeChat public account to get the lottery mini-program code.

This book is a pioneering work describing data structures and algorithms using Python, gathering the author's years of practical experience and thoroughly explaining how to efficiently implement various algorithms through a series of storage mechanisms in Python. This book gives you deep understanding of Python data structures, recursion, searching, sorting, trees and graph applications, and more.

ESC
↑↓ select · ↵ open175 issues