Python Trending Weekly
ISSUE 82

Python Weekly #82: How the CIA Uses Python?

2024-12-21 Season 3

TL;DR

How the CIA writes Python, what Claude's Model Context Protocol is actually for, and Tencent's open-source HunyuanVideo model.

Articles 12 Projects 12
🦄

Articles & Tutorials

× 12
01 How the CIA Writes Python compileralchemy.substack.com

The CIA uses Python for everything from hacking to building utility tools, with a surprising preference for versions 2.7 and 3.4. This article compiles the agency's Python practices, covering their adherence to Google's Python Style Guide, using pip2tgz for package downloads, maintaining a local PyPI, their PyCharm + pyenv setup, running tests on remote servers, and their CLI script templates.

02 From Chaos to Order: An Analysis of Python Dependency Management Tools cnblogs.com

Python's dependency management landscape is... diverse, to say the least. This post breaks down the pros and cons of 13 different tools. The author's TL;DR? If you just need Python packages, go with uv and pipx. If you're juggling multiple isolated environments, stick to the pip + venv + pip-tools + pyenv combo.

03 Tip of the Day: Why I Hate LangChain kingname.info

The author has a serious bone to pick with LangChain and LlamaIndex, seeing them as poster children for over-abstraction. The article cites LlamaIndex's use of dependency injection as a nightmare for customization. It also draws a comparison with SimpleMind (from the creator of requests) to show what a clean, non-over-engineered implementation looks like. (Bonus: Octomind's take on Why We No Longer Use LangChain for Building Our AI Agents)

04 Build a DNS Server in Python xer0x.in

A deep dive into implementing most of the DNS protocol functionality using Python. The result? A trustworthy, home-brewed local DNS server.

05 Top Python Web Frameworks for 2025 reflex.dev

A comparative analysis of the heavy hitters in the Python web framework arena: Reflex, Django, Flask, Gradio, Streamlit, Dash, and FastAPI. What are their strengths and weaknesses? Let's find out.

06 Python Meta-Circular Interpreter rahul.gopinath.org

A meta-circular interpreter is an interpreter for a language written in that language itself. Why bother? It gives you insane control over code execution and makes tracing a breeze. This long-form article details exactly what you can do with one and how to build it.

07 Should You Ditch Spark for DuckDB or Polars? milescole.dev

With lightweight engines like DuckDB and Polars gaining traction, is it time to say goodbye to Spark? This article benchmarks them across performance, execution cost, dev cost, and maturity. Spoiler: Spark still holds the crown for scalability and cost-efficiency, so don't delete it just yet.

08 Django Security: The Neglected Default Hardenings blog.hartwork.org

A case study on a Remote Code Execution (RCE) vulnerability caused by a Django misconfiguration. Some of Django's default behaviors can open up security holes. Despite the author's efforts being marked "wontfix," this post is a call to action for developers to be aware of these potential risks and push for official fixes.

09 Displaying Website Content on an E-Ink Display mfasold.net

To avoid constantly checking his phone, the author built an e-ink display for his son's school timetable. The stack? Playwright + Pillow to capture and convert content, Werkzeug for a simple web service, and Arduino to handle auto-wake and image updates.

10 A Circular Reference Caused by Monkeypatching frostming.com

A seemingly innocent line like foo.bar = foo.bar can create a circular reference and lead to memory leaks. This often happens with monkeypatching. The article shares a neat trick using weakref to dodge this bullet.

11 Why Do Primes Form Spirals in Polar Coordinates? jaketae.github.io

Here's a fun question: What happens when you plot prime numbers on a polar coordinate system? Using sympy to generate primes and matplotlib to visualize them, the author reveals a beautiful pattern. But what's the math behind it?

The first 10,000 primes plotted.

img
12 What's the Deal with Claude's MCP (Model Context Protocol)? sspai.com

MCP establishes a secure, two-way link between LLMs and data sources. But what does that actually mean, and what problems does it solve? The author walks through the official examples, explains the data interaction process, and tests it with real datasets. Verdict: It's actually pretty useful. (Bonus: Reflections on Building with MCP)

🐿️

Projects & Resources

× 12
01 markitdown: Convert Anything to Markdown github.com

Microsoft's latest open-source hit. It converts almost any file type to Markdown—Office docs, PDFs, images, audio, HTML, CSV, JSON, XML, ZIPs, you name it. (24.3K stars) (Bonus: An online tool built with it: Office to Markdown)

02 systemd-pilot: A GUI for systemd github.com

A desktop app for managing systemd services on GNU/Linux. View, filter, start, stop, and restart services with ease. It supports quick deployment via templates, simple search, and full integration with the GNOME desktop.

03 wowy: A Django 4.x E-commerce Platform github.com

A full-stack Python project. It's a fully functional e-commerce platform with a robust admin panel and modern UI. Features include multi-image uploads, shopping cart, wishlist, dashboard, PDF invoices, sales tracking, and more.

img
04 NarratoAI: AI Video Commentary & Editing github.com

A one-stop AI tool for video commentary and automated editing, built with Python. It uses LLMs to write scripts, then handles the editing, dubbing, and subtitles automatically. Content creation just got a whole lot faster. (2.6K stars)

05 HunyuanVideo: Tencent's Open Source Video Model github.com

Tencent's video generation model. Text-to-video is open sourced and ready to go, with image-to-video coming soon. (6.4K stars)

06 SeleniumBase: Web Automation, Testing & Bot Detection Bypass github.com

The all-in-one browser automation framework. Web scraping, automated testing, crawling, CAPTCHA bypassing—it does it all. (7.1K stars)

07 BlackSheep: Fast ASGI Web Framework github.com

An asynchronous Python web framework for building event-based applications. Inspired by Flask and ASP.NET Core. (2K stars)

08 PDFMathTranslate: AI-Powered Full-Text PDF Translation github.com

A Python tool for translating PDFs while keeping the layout intact. Supports Google, DeepL, Ollama, and OpenAI. Available as CLI, GUI, or Docker. It preserves formulas, charts, TOCs, and annotations perfectly. (10K stars)

09 Google Gemini API Cookbook github.com

The official collection of guides and examples for the Gemini API. Learn how to leverage Gemini's multimodal capabilities to reason seamlessly across text, images, code, and audio. (9K stars)

10 tkforge: Create Python GUIs in Figma github.com

Think Tkinter Designer, but better. Drag and drop your GUI in Figma, then use this tool to convert it into executable Python code.

11 MegaParse: Lossless Parsing for PDF, Docx, PPTx with LLMs github.com

A powerful, flexible parser that handles various document types with ease. No information loss, just fast and efficient parsing. (4.6K stars)

12 NoteFlow: Lightweight Python Note-Taking App github.com

A Markdown-based note-taking app with built-in task management. Clean interface, multiple themes, and support for tasks, images, files, and code snippets.

img
ESC
↑↓ select · ↵ open175 issues