Python Trending Weekly
ISSUE 44

Mojo Goes Open Source This Week; AI Learns to Generate Music

2024-03-30 Season 2

TL;DR

Mojo goes open source this week and Suno proves AI can write songs; devika arrives as an open Devin alternative, while the 'Montreal Effect' argues for language style czars.

Articles 12 Projects 13
🦄

Articles & Tutorials

× 12
01 The Montreal Effect: Why Programming Languages Need Style Czars earthly.dev

Discusses the style diversity problem that programming languages face as they scale, introducing the concept of a "Language Style Czar." The author mentions that Scala is too flexible, C++ has old and new standards coexisting, and Python's PEP-8 hasn't kept up with the times, calling for someone in the community (like the language creator) to guide the development of unified style standards.

02 Decentralized Edge Computing Platform fission.codes

Introduces "Everywhere Computer," which aims to distribute computing tasks across a broad open network including personal devices, other devices in LANs, cloud node clusters, etc. Shows how to write specific functions using Rust, JavaScript, and Python, and compile them into Wasm components.

03 Designing a Pure Python Web Framework reflex.dev

Reflex is a pure Python full-stack web framework (15K GitHub stars). Its author introduces Reflex's architecture, including implementation details and working principles of both frontend and backend.

Reflex architecture diagram
04 Fixing a Bug in PyPy's Incremental GC pypy.org

The author spent nearly a year tracking down a strange and hard-to-reproduce bug in PyPy. The article describes the various debugging methods used, the cause of the bug, and other issues discovered during debugging. The fix has now been merged into PyPy's main branch.

05 Reviving PyMiniRacer, V8 in Python bpcreech.com

How do you run JavaScript in Python projects? PyMiniRacer is one approach, but the old project was unmaintained. The author took it over and made many updates. The article covers the changes in the new version and future plans.

06 Data Communication Between Python and JavaScript juejin.cn

The article explains how to implement mutual calls between the two languages, enabling data transfer across language projects. Python calling JavaScript uses pyjsparser and PyV8, while the reverse uses node-python, WebSockets, and HTTP requests.

07 A Better Python Cache Implementation for Slow Function Calls docs.sweep.dev

Introduces a caching solution using files instead of memory, similar to lru_cache. It provides a file_cache decorator with the main advantage of persisting cache results. The article details the implementation code.

08 Speed Up Django's collectstatic Command with Collectfasta jasongi.com

Introduces a tool that can accelerate the execution speed of Django framework's collectstatic command, including how to install and configure it, and how to integrate it into Django projects to improve performance. Also provides performance improvement metrics and best practice recommendations.

09 Distributed Coroutines in Python with Native Extensions and Dispatch stealthrocket.tech

Distributed coroutines are functions that can be suspended, serialized, and resumed in another process. When combined with distributed schedulers (like Dispatch), they can simplify software creation. Python natively supports coroutines, but coroutines themselves cannot be serialized. The article explains how to solve this problem and how to handle non-serializable files and network handles, large objects, and global objects and code updates.

10 The Wrong Way to Speed Up Your Code with Numba pythonspeed.com

If NumPy-based code is too slow, sometimes Numba can be used for acceleration. However, due to its type annotations and compilation options, incorrect usage can lead to slower performance. The article analyzes related issues and provides optimization recommendations.

11 Optimizing Django's System Check Framework adamj.eu

Django's system check framework is a built-in mechanism that automatically checks and reports potential configuration and application state issues when running Django commands. Through performance analysis and code review, the author discovered and implemented multiple optimization measures, improving example runtime by about 50%. These optimizations will be released in Django 5.1.

12 Law of Large Numbers: Why Going to Casinos is a Bad Idea easylang.dev

The article uses data analysis methods (Monte Carlo method) to simulate coin flipping, roulette, lottery, and other games, finding that the probability of losing is very high. This teaches us a lesson that...

🎁Python Trending Weekly🎁 Every 30 issues makes a season, and the highlights from the first season have been compiled for easy reference. Online access: Python Trending Weekly Season 1 Highlights Collection (Issues 1~30)

🐿️

Projects & Resources

× 13
01 mojo: The Mojo Programming Language Goes Open Source github.com

Mojo is a new programming language that attempts to combine Python's syntax and ecosystem with systems programming and metaprogramming, bridging the gap between research and production. (18.5K stars)

02 Suno-API: Unofficial Suno API Based on Python and FastAPI github.com

Currently supports generating songs, lyrics, etc. Built-in token maintenance and keep-alive functionality, no need to worry about token expiration. (Also: another suno reverse engineering API)

03 blacken-docs: Run "black" on Python Code Blocks in Documentation github.com

A command-line tool that supports formatting Python code blocks with black in Markdown, reStructuredText, and LaTeX files. (Contributed by @Chao)

04 pathvalidate: Sanitize/Validate Strings Such as Filenames and File Paths github.com

A utility tool for handling filename and file path strings, supporting removal of invalid characters, replacement of platform reserved words, removal of unprintable characters, parameter validation, multi-byte characters, multi-platform support, etc. (Contributed by @Chao)

05 LunarLink: API Automation Testing Platform Based on HttpRunner + Django + Vue + Element UI github.com

Besides the mentioned technologies, it also uses: Nginx, RabbitMQ, Redis, MySQL, and Docker. Supports login, project management, interface management, case management, traffic recording, configuration management, scheduled tasks, report management, and other features.

LunarLink: API Automation Testing Platform Based on HttpRunner + Django + Vue + Element UI
06 leaping: Lightweight Python Test Debugger github.com

A simple, fast, lightweight Python test debugger that supports tracing code execution and allows retrospective examination of program state using LLM-based natural language debugger.

07 keepyourmouthshut: Record Podcasts with AI Capabilities github.com

Create podcasts in a developer-friendly way without any expensive equipment. It takes input from users to generate scripts and audio files based on those scripts. Depends on FFMPEG and llmOS.

08 MoneyPrinterTurbo: Generate HD Short Videos with AI Large Models in One Click github.com

Just provide a video topic or keyword, and it can automatically generate video scripts, video materials, video subtitles, video background music, then synthesize a high-definition short video. Supports multiple models including OpenAI, moonshot, Azure, gpt4free, one-api, Tongyi Qianwen, etc. (5.5K stars)

09 AIOS: LLM Agent Operating System github.com

Embeds large language models into operating systems to make the OS "soulful." Aims to optimize resource allocation, facilitate context switching across agents, enable concurrent agent execution, provide tool services for agents, and maintain agent access control.

AI Operating System Architecture
10 LaVague: Automation Using Large Action Model Framework github.com

Provides an engine that converts natural language queries into Selenium code, enabling users or other AI to easily automate and describe web workflows and implement automation in browsers. (3.5K stars)

11 Gmeek: A Blog Framework Completely Using GitHub github.com

Ultra-lightweight personal blog template, completely based on GitHub Pages, GitHub Issues, and GitHub Actions. No local deployment needed - from setup to writing, it only takes 18 seconds. 2 steps to set up the blog, step 3 is writing.

12 posthog: Open Source Product Analytics, Session Recording, Feature Flags and A/B Testing github.com

An open-source product analytics tool supporting self-hosting. Aims to provide enterprises with a controllable, customizable analytics solution that meets data privacy requirements. Has a free cloud version. (16.5K stars)

13 devika: Open Source Alternative to Cognition AI's Devin github.com

An open-source alternative to the recently popular Devin, capable of understanding high-level human instructions and breaking them down into steps, researching relevant information, and writing code to achieve given goals. It leverages large language models, planning and reasoning algorithms, and web browsing capabilities to intelligently develop software. (13K stars)

🐢

Book Giveaway

Irregular giveaway events! This week we're giving away 5 copies of "Illustrated Algorithms and Data Structures in Python". Drawing date: April 5th. Send the number "8044" to the Python Cat WeChat public account to get the lottery mini-program code.

Created by a giant in Japan's programming education world, the bestselling author of "Illustrated C Programming"! 136 code segments + 213 charts, thoroughly explaining the fundamentals of algorithms and data structures - more vivid and easier to understand than textbooks! The original series has sold over 1.2 million copies and won the Japan Society for Engineering Education Book Award.

ESC
↑↓ select · ↵ open175 issues