Python Trending Weekly
ISSUE 63

Developing Python Web Projects

2024-08-03 Season 3

TL;DR

The ultimate guide to web apps with Vue and Django, fasthtml chasing the fastest way to build an HTML app, plus eBPF instrumentation of the GIL and MicroPython shining on embedded hardware.

Articles 10 Projects 13 Discussions 2
🦄

Articles & Tutorials

× 10
01 Building web apps with Vue and Django (2024) - The Ultimate Guide dafoster.net

How can you efficiently combine Vue and Django, especially when small teams need to develop full-stack projects on a budget? The author focuses on scenarios where both frontend and backend services are deployed on a single server, covering topics like resource binding strategies, server-side rendering for SEO-friendly HTML, and client-side enhancement of dynamic HTML content.

02 Visual Low/No Code Data Preparation and Analysis Web App Built with Pyodide and React blog.pyodide.org

Straight from the official Pyodide blog, this showcases a web project that lets users work with pandas without any coding, while also supporting matplotlib plotting and scikit-learn for linear regression. The article breaks down some implementation details and demos the key features.

Visual Low/No Code Data Preparation and Analysis Web App Built with Pyodide and React
03 The trouble with __all__ gauge.sh

Unlike Java and other languages that use public/private keywords to control class function visibility, Python uses __all__ to explicitly declare what can be exported - but it's not mandatory. The author points out the problems with this approach and shares a method to enforce that only __all__ declared content can be exported.

04 Why does "python -m json" not work? Why is it "json.tool"? treyhunner.com

"python -m json.tool xxx" is used to pretty-print JSON content in the command line, but why isn't this command simplified to "python -m json xxx"? The author digs into the history of the "-m" flag and the early development of the json library to solve this mystery.

05 tea-tasting: a Python package for the statistical analysis of A/B tests e10v.me

The author open-sourced the tea-tasting library for statistical analysis of A/B tests. The article provides a detailed walkthrough of the library's features and basic usage.

06 Asyncio Event Loop in Separate Thread - Super Fast Python superfastpython.com

Asyncio event loops typically run in the main thread, but they can also run in new threads or daemon threads. The article covers three methods for using asyncio event loops in separate threads.

07 Instrumenting Python GIL with eBPF coroot.com

As we all know, Python's GIL limits the performance of multithreading and CPU-intensive tasks. But how do you measure the GIL's impact? This article uses eBPF to measure the time from acquiring to releasing the GIL lock, analyzing its timing distribution.

08 Embedded Python: MicroPython Is Amazing hackaday.com

Not long ago, MicroPython celebrated its 11th birthday. The author, an early user and evangelist, explains why MicroPython is an incredibly valuable hacker tool.

09 Tracing the evolution of a Python function with git log nerderati.com

"git log" is the command for viewing repository commit history, but can you use it to see only the modification history of a specific function? The article introduces the usage of "git log -L :<funcname>:<file>", which lets you specifically track a function's evolution over time.

10 OpenCV and the Wild Kingdom scottsexton.co

The author used OpenCV to develop a motion detection program to monitor who was stealing their cat's food using thermal imaging. Haha, turns out the culprits were the neighbor's cat, opossums, and raccoons! (Imagine waking up to find your food bowl completely ransacked...)

🐿️

Projects & Resources

× 13
01 fasthtml: The fastest way to create an HTML app github.com

A new next-generation lightweight Python web framework that integrates HTMX for developing fast, scalable, and expressive web applications. (2.6K stars) Here's how to create a simple "Hello World" page:

from fasthtml.common import *

app,rt = fast_app()

@rt('/') def get(): return Div(P('Hello World!'), hx_get="/change")

serve() ```

02 datachain: Process and curate unstructured data using local ML models and LLM calls github.com

AI-powered tool that can process tens of millions of unstructured multimodal files in parallel, using strictly typed Pydantic objects instead of JSON, with offline operation support.

03 Elements of Data Science allendowney.github.io

A data science primer for those with no programming experience, presented in Jupyter notebook format that you can read online, modify code, run, and test.

04 treescope: An interactive HTML pretty-printer for machine learning research in IPython notebooks github.com

Designed specifically for machine learning and neural network research in IPython notebooks, with expandable and collapsible subtrees, copy buttons, and automatic visualization of arbitrary dimensional arrays.

05 cardie: An open source business card designer and sharing platform github.com

Create business or personal cards, share links and QR codes, and track card visit analytics.

06 PyDPainter: A usable pixel art paint program written in Python github.com

A retro pixel art drawing tool built with PyGame, featuring toolbars, menus, and mouse shortcuts.

PyDPainter: A usable pixel art paint program written in Python
07 cloudflare-noip: free alternative to paid dynamic DNS services like NoIP.com github.com

Use a free Cloudflare account and local cronjob to automatically update DNS records on Cloudflare, replacing paid dynamic DNS services.

08 peerfetch: Peer-to-peer HTTP over WebRTC github.com

Implements HTTP client wrapper and corresponding server-side HTTP proxy via WebRTC DataChannel, enabling direct secure access to edge devices (IoT or servers) hidden behind firewalls from web browsers.

09 yark: YouTube archiving made simple github.com

Download, update, manage, and play YouTube videos with statistical reports, timestamped and permalinked annotations, supporting both light and dark modes. (2K stars)

10 patchwork: Automate development gruntwork like code reviews, patching and documentation with LLM workflows github.com

Improve your coding workflow with AI, runnable in CLI and IDE, or as part of CI/CD pipelines. Features ready-to-use common workflow templates and supports custom workflows.

11 RestrictedPython: A restricted execution environment for Python to run untrusted code github.com

This isn't a sandbox system or security environment, but it can define trusted environments and execute untrusted code within them. Only supports CPython, not other implementations.

12 metahuman-stream: Real time interactive streaming digital human github.com

Creates audio-video synchronized conversational digital humans, supporting multiple digital human models (ernerf, musetalk, wav2lip), voice cloning, interruption handling, full-body video stitching, video orchestration, and more. (2.3K stars)

13 Chenyme-AAVT: Fully Automated Audio-Video Translation Project github.com

A simple and easy-to-use automatic recognition, translation, and video assistance tool that can quickly identify video subtitles, translate subtitles, assist with graphics and text, supports multiple languages and file formats, AI summarization Q&A, and more.

Chenyme-AAVT: Fully Automated Audio-Video Translation Project
🥂

Discussions & Questions

× 2
01 Whatever happened to "explicit is better than implicit"? reddit.com

Hot Reddit thread. The author noticed that some popular libraries (FastAPI and PyTest) don't follow the "explicit is better than implicit" principle, instead using quite a bit of implicit behavior and hard-to-observe magic operations. Why is this happening? Is there something wrong with this principle?

02 What are some unusual but useful Python libraries you've discovered? reddit.com

What new, interesting, lesser-known but practical Python libraries would you recommend? Our weekly has shared many, and there are tons in this thread too! (PS: The author also asked the same question on Hacker News)

ESC
↑↓ select · ↵ open175 issues