Skip to content

Latest commit

 

History

History
137 lines (69 loc) · 11 KB

File metadata and controls

137 lines (69 loc) · 11 KB

Python Trending Weekly #83: uv Usage Tips

Hey there! I'm Python Cat. Here I share quality Python, AI, and general tech content weekly, mostly in English. The newsletter is open source on Github - if you like it, please give us a star! ⭐

This week we're sharing 12 articles, 12 open source projects, and 2 trending discussions.

1、UV tricks

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.

2、Building a Tiny CDN With pyinfra and Chimera Linux

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.

3、Effective Python Developer Tooling in December 2024

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.

4、Fake Debugging II: The Race Condition Strikes Back

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.

5、A from-scratch tour of Bitcoin in Python

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.

6、Poetry(-core), or the ultimate footgun

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.

7、Python packaging: Why we can't have nice things, Part 1

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.

8、Python Performance Optimization Behind the Scenes: pycache and Bytecode Caching Mechanisms

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

9、Writing down (and searching through) every UUID

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

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

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

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.

1、browser-use: Make websites accessible for AI agents

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)

2、monolith: A Lightweight Recommendation System

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)

3、FindMy.py: Everything you need to query Apple's FindMy network!

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)

4、ShortMoji: insert emojis anywhere with simple keyboard shortcuts

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

5、ha_xiaomi_home: Xiaomi Home Integration for Home Assistant

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

6、After 3 Years, I Failed. Here's All My Startup's Code

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)

7、ai-vocabulary-builder: An AI-powered smart vocabulary tool

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.

8、Genesis: A generative world for general-purpose robotics & embodied AI learning

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)

9、PromptWizard: Task-Aware Agent-driven Prompt Optimization Framework

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)

10、Protocol: Open-source framework for exporting your personal data

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

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

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.

1、The hand-picked selection of the best Python libraries and tools of 2024 – 10th edition!

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

2、Seeking help with Python problem that neither GPT o1 nor Gemini 2.0 could solve

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

Python Trending Weekly #33: FastAPI is Great, Flask Isn't Dead, They Both Have a Future (2023.12.30)

Tech newsletters are smart tools for smart people to filter quality knowledge in the information overload era. This is a curated platform tailored for Python developers in China, selecting the most valuable articles, tutorials, open source projects, software tools, podcasts and videos, trending topics, and rich content. Subscribe now to receive weekly article updates and make progress bit by bit.

Feel free to leave comments about which share you liked most this week! The more feedback everyone gives, the more I'll share in the future!

Welcome to share this newsletter with fellow learning enthusiasts. When someone purchases the newsletter through your shared poster or link, you'll receive a 50% commission.

Python Trending Weekly Season 2 Concluded, Sharing Several Summaries

Python Trending Weekly Season 1 Highlights Collection (Issues 1-30)

10,000-Word Condensed Version: 800 Links from Python Trending Weekly Season 1!