Python Trending Weekly
ISSUE 56

Faster String Functions in NumPy 2.0

2024-06-15 Season 2

TL;DR

Faster string functions arrive in NumPy 2.0; CPython's garbage collector gets dissected, Chinese textbooks take heat for conceptual errors, and OpenRecall answers Windows Recall.

Articles 12 Projects 12
🦄

Articles & Tutorials

× 12
01 Implementing Faster String Functions for NumPy 2.0 labs.quansight.org

NumPy 2.0 is about to drop – the first major release since 2006! The authors walk us through how they redesigned string functions (isalpha, add, find, and startswith), explain the execution principles behind them, and share some impressive performance improvement stats.

Implementing Faster String Functions for NumPy 2.0
02 What Is the __pycache__ Folder in Python? realpython.com

Ever noticed those mysterious __pycache__ folders popping up in your project files? What are they for, and when do they get created? This article breaks down everything you need to know: what they do, what's inside them, when they're generated, how to recursively delete them, how to prevent their creation, and how to read/execute and decompile cached bytecode.

03 CPython Garbage Collection: Internals and Implementation Algorithms blog.codingconfessions.com

How does CPython handle memory management (including reference counting and garbage collection)? This is the latest installment in the deep-dive CPython interpreter series, analyzing the implementation principles of reference counting and generational garbage collection, examining core data structures, algorithms, and source code, plus the latest memory management changes when removing the GIL.

04 Building Your Own Similar Image Search Engine from Scratch juejin.cn

This guide shows you how to build an image search engine from the ground up using vector embeddings, the qdrant vector database, and OpenAI's CLIP model. The article also covers using scrapy+selenium to crawl images from the web and developing a simple interface with Flask.

05 Fire Up Your Logging Needs with Pydantic Logfire kadermiyanyedi.medium.com

The Pydantic team just dropped a new logging tool called LogFire! Beyond simple log printing, it can track and analyze program execution info, record FastAPI request parameters and return values, collect metrics like exception counts, connection numbers, and memory usage. This looks incredibly useful!

06 FastAPI Deep Dive: Efficient Web Development Guide juejin.cn

A comprehensive FastAPI column that covers everything from basics to advanced topics, providing a complete guide to using FastAPI.

07 Understanding HTTP Servers by Building One in Python muhammadraza.me

The author builds a simple HTTP server in Python to understand how it works under the hood. The article covers handling requests, processing them, sending responses, and all the key concepts involved in the process.

08 My Thoughts on "Python in Excel" xlwings.org

Microsoft launched the "Python in Excel" preview last year, but how good is it really? This article comes from the author of the xlwings library and "Python for Excel" book, sharing his insights after extensive use. He argues it's not a VBA replacement but rather an Excel formula replacement, and that integrating Jupyter notebook cells into Excel grids was a mistake, among other observations.

09 Extracting Curved Text from Images to PDF with Python mzucker.github.io

How do you extract text content from photos of book pages that have some degree of curvature and turn it into a PDF? The author uses a "cubic sheet" model for page dewarping and implements text extraction with OpenCV+PIL. This 8-year-old article has its code open-sourced at page_dewarp, which has already garnered 1.4K stars.

10 Problems with Python Celery docs.hatchet.run

Celery is a widely-used distributed task queue, but the author believes it has numerous issues. The article discusses three categories: missing or unimplemented features, problematic default behaviors, and insufficient observability.

11 Event-Driven Ansible: What, Why, and How? anweshadas.in

Ansible is an automation tool built with Python, commonly used for network configuration management and application deployment in DevOps scenarios. This article introduces its latest Rulebook feature, which can receive event notifications from multiple event sources and trigger specific operations accordingly.

12 Almost All Python Textbooks Published in China Have Basic Conceptual Errors zhuanlan.zhihu.com

The article claims that many Python textbooks apply knowledge frameworks from other languages, leading to basic conceptual errors like those around variables and assignment. What Python textbooks are being used in schools? Are there any current students who can share examples of errors in their textbooks? (Shared by @LaoBuLao) (Note: Popular Python books also have some outdated expressions, see Python Now Supports Chinese Variable Names!)

🐿️

Projects & Resources

× 12
01 WeasyPrint: Awesome Tool for Converting Web to PDF Documents github.com

Transforms simple HTML pages into gorgeous statistical reports, invoices, tickets, books, and more. Can read from regular files, HTTP, FTP, and data URIs. (6.8K stars)

02 oxo: Modern Security Scanning Orchestrator github.com

A security scanning framework that can find vulnerabilities and perform reconnaissance, enumeration, fingerprinting, and other operations.

03 jupyterlab-desktop: JupyterLab Desktop Edition Built on Electron github.com

A cross-platform desktop application for JupyterLab, supporting Windows, Mac, and Linux with simple usage. (3.5K stars)

jupyterlab-desktop: JupyterLab Desktop Edition Built on Electron
04 teo: Schema-Driven Web Server Framework github.com

A schema-driven web server framework. The server API is native to Rust, Node.js, and Python, inspired by GraphQL and Prisma, with automatic database migrations. (1.1K stars)

05 aiosql: Simple SQL in Python github.com

Treat SQL as code by writing it in ".sql" files that can be loaded into Python programs as function calls. Highly reusable and centrally manageable. (1.3K stars)

06 thread: AI-Powered Python Notebook Built with React github.com

Combines OpenAI's code interpreter with a Python Notebook development environment. Beyond regular features, it can generate cells using natural language, edit code, answer questions, and fix bugs.

07 OpenRecall: Open Source Alternative to Windows Recall github.com

An open-source alternative to Windows Recall and Limitless Rewind.ai, privacy-first and supporting Windows, macOS, and Linux. Regularly captures screenshots, analyzes their text and images, allowing you to quickly find information and review browsing history through semantic search. (1.3K stars)

08 requests-futures: Asynchronous Python HTTP Requests Using Futures github.com

requests doesn't support async, so this library adds concurrent.futures async implementation to it. (2.1K stars)

09 websocket-client: WebSocket Client for Python github.com

Provides access to low-level WebSocket APIs, implementing the hybi-13 version of the WebSocket protocol. Currently doesn't support the permessage-deflate extension from RFC 7692. (3.5K stars)

10 Freeway: WiFi Penetration Testing and Auditing Tool github.com

A WiFi penetration tool implemented in Python, helping white hat hackers and testers audit and secure home and enterprise networks. Only supports Linux systems, requires network cards that support monitor mode and frame injection.

11 cibuildwheel: Build Python Wheels for All Platforms with Minimal Configuration github.com

Runs on CI servers to build and test your wheel packages, currently supporting GitHub Actions, Azure Pipelines, Travis CI, AppVeyor, CircleCI, and GitLab CI. (1.8K stars)

12 Over 6,000 Free Cheat Sheets cheatography.com

A website dedicated to collecting cheat sheets, categorized into programming, software, business & marketing, education, home & health, games & hobbies, and more. The Python category has 446 sheets, the most of any category.

Over 6,000 Free Cheat Sheets
ESC
↑↓ select · ↵ open175 issues