Python Trending Weekly
ISSUE 83

uv Usage Tips

2024-12-28 Season 3

TL;DR

A bag of uv tricks lands as Poetry gets slammed as an ultimate footgun, browser-use makes websites accessible to AI agents, and FindMy.py taps Apple's Find My network.

Articles 12 Projects 12 Discussions 2
🦄

Articles & Tutorials

× 12
01 UV tricks bitecode.dev

This article shares some practical tricks for the uv tool, including temporarily adding dependencies without polluting virtual environments, creating nearly standalone scripts, quickly testing and running Python tools, running one-off Python tools, and cleaning uv cache.

02 Building a Tiny CDN With pyinfra and Chimera Linux wezm.net

Content Delivery Networks (CDNs) can boost website access speed. The author built a self-hosted CDN that reduced their blog's average response time from 807ms to 189ms. The article details network architecture, server configuration, TLS certificate management, and how to use GeoDNS to minimize access latency.

03 Effective Python Developer Tooling in December 2024 pydevtools.com

What are the latest trends and best practices for Python developer tools in 2024? The author shares anti-patterns, recommended practices, and tools including uv, ruff, Mypy, Pytest, Cookiecutter, and Cruft.

04 Fake Debugging II: The Race Condition Strikes Back ankush.dev

Two years ago, the author encountered a multithreading bug, analyzed the code to find a suspected cause, and solved the issue despite not being able to reproduce it. However, two years later the same problem appeared again. This time they dug deeper, finally found the root cause and could reliably reproduce it, truly solving this tricky bug.

05 A from-scratch tour of Bitcoin in Python karpathy.github.io

How do you implement Bitcoin transactions in Python? This article introduces cryptocurrency concepts, Bitcoin's transaction mechanisms, and how to use Python to implement cryptographically creating, signing, and broadcasting Bitcoin transactions.

06 Poetry(-core), or the ultimate footgun blogs.gentoo.org

The author believes Poetry is counterintuitive and error-prone when used as a build tool. The article points out common issues including nightmarish address operators, misleading include keys, and Schrödinger-like optional dependencies.

07 Python packaging: Why we can't have nice things, Part 1 zahlman.github.io

The first part of a series on Python packaging, discussing the current state of Python packaging, existing problems, and how to deal with these issues. It covers package name vs import name inconsistencies, dependency hell, installation failures, and emphasizes the importance of virtual environments.

08 Python Performance Optimization Behind the Scenes: __pycache__ and Bytecode Caching Mechanisms juejin.cn

What's the purpose of __pycache__ folders and .pyc files? How can you properly leverage Python's bytecode caching mechanism to improve application performance?

09 Writing down (and searching through) every UUID eieio.games

The author developed a website that can display and search all UUIDs. The article introduces several major challenges and solutions, including browser rendering limitations, UUID generation order, and full search functionality.

10 The Inner Workings of Python Dataclasses Explained jacobpadilla.com

Python dataclasses are pretty cool, but what's their implementation mechanism? This article attempts to explain the inner workings, including __annotations__, exec, custom dataclass decorators, and the frozen parameter, helping readers better understand how dataclasses work.

11 Symbolic Execution by Overloading __bool__ philipzucker.com

Symbolic Execution is a software testing and analysis technique that executes programs by representing program inputs as symbols (rather than concrete values). The article introduces a method to make Python's non-overloadable syntax overloadable without modifying the compiler, using metaprogramming techniques to transform Python code into Z3 expressions.

12 Cron jobs inside your web app ricardoanderegg.com

How do you implement cron-like scheduled tasks in a Python FastAPI application? The author leverages FastAPI's async features to create background tasks, avoiding the need to write separate scripts and CLI commands, and without needing to run tasks outside containers.

🐿️

Projects & Resources

× 12
01 browser-use: Make websites accessible for AI agents github.com

Makes it easy for AI agents to interact with browsers, supporting visual + HTML extraction, automatic multi-tab management, XPath extraction for precise LLM operations, custom actions, self-correction, LangChain support, and parallelizing as many agents as possible. (7.2K stars)

browser-use: Make websites accessible for AI agents
02 monolith: A Lightweight Recommendation System github.com

An open-source deep learning framework from ByteDance for large-scale recommendation models, built on TensorFlow, supporting batch/real-time training and deployment. (3.7K stars)

03 FindMy.py: Everything you need to query Apple's FindMy network! github.com

Integrates resources from different open-source projects, containing everything needed to query Apple FindMy devices, providing unified foundational components. Cross-platform, retrieves and decrypts locations, scans nearby FindMy devices. (1.5K stars)

04 ShortMoji: insert emojis anywhere with simple keyboard shortcuts github.com

A Python-developed utility that organizes 137 different emojis, letting you quickly insert emojis with keyboard shortcuts. Windows only.

05 ha_xiaomi_home: Xiaomi Home Integration for Home Assistant github.com

An official integration component from Xiaomi that lets you use Xiaomi IoT smart devices in Home Assistant. (15.4K stars)

06 After 3 Years, I Failed. Here's All My Startup's Code dylanhuang.com

Konfig was a developer tools startup focused on making API integration simpler. They've now open-sourced all their product code, documentation resources, and other byproducts. (1.2K stars)

07 ai-vocabulary-builder: An AI-powered smart vocabulary tool github.com

An intelligent English vocabulary tool powered by AI technology that helps you quickly build your own English vocabulary database. Features an innovative efficient vocabulary collection mode, helping you master new words through engaging story mode and test mode.

08 Genesis: A generative world for general-purpose robotics & embodied AI learning github.com

A physics platform specifically designed for robotics/embodied AI/physical AI applications, serving as a novel general-purpose physics engine, robotics simulation platform, photorealistic rendering system, and generative data engine. (19.8K stars)

09 PromptWizard: Task-Aware Agent-driven Prompt Optimization Framework github.com

Microsoft's open-source discrete prompt optimization framework with self-optimization mechanisms. Key components: feedback-driven optimization, evaluating and synthesizing diverse examples, self-generating chain-of-thought steps. (1K stars)

PromptWizard: Task-Aware Agent-driven Prompt Optimization Framework
10 Protocol: Open-source framework for exporting your personal data github.com

Exports your personal data from applications like iMessages, Twitter bookmarks, ChatGPT, Gmail, and LinkedIn, providing both a Python SDK and a desktop application. (1.3K stars)

11 awesome-llm-apps: Collection of awesome LLM apps with RAG using OpenAI, Anthropic, Gemini and opensource models github.com

A collection of applications built with OpenAI, Anthropic, Google's large models, and LLaMA open-source models. Learn AI applications across different domains from excellent projects. (9.8K stars)

12 python-hiccup: a Python implementation of the Hiccup syntax github.com

A Python implementation of Hiccup syntax, using Python lists or tuples to represent HTML elements and dicts to represent element attributes. Aims to make HTML rendering programmatic, simple, and easy to read.

🥂

Discussions & Questions

× 2
01 The hand-picked selection of the best Python libraries and tools of 2024 – 10th edition! reddit.com

Annual curated recommendations for this year's Python libraries/tools, including general-purpose and AI/ML/data categories, totaling 20 items.

02 Seeking help with Python problem that neither GPT o1 nor Gemini 2.0 could solve v2ex.com

Python's chained assignment operation "a=b=c" might not work the way you think it does!

ESC
↑↓ select · ↵ open175 issues