Python Trending Weekly
ISSUE 19

Python Trending Weekly #19 (2023-09-09)

2023-09-09 Season 1

TL;DR

Mojo is finally available for download, Falcon 180B lands on the Hugging Face Hub and Baichuan2's 53B model goes live—plus a C compiler written in 500 lines of Python.

Articles 12 Projects 8
🦄

Articles & Tutorials

× 12
01 Mojo🔥 is finally available for download! modular.com

Mojo, the “high-performance Python++” language released this year, just released its Linux installer this week, following its $100 million funding announcement in Trending Weekly issue #17. In addition to compiler functionality, it also offers some IDE tooling (terminal shell, VS Code extension, Jupyter kernel), although debugging is not yet supported and there are no Mac or Windows builds available.

02 What Can We Learn from PEP-703? cnblogs.com

PEP-703 is a proposal for the no-gil project, which we have introduced many times. The author discusses some topics in this PEP, such as minimizing reliance on atomic reference counting, lazy reference counting, gc will no longer be generational, object locks, etc. From this, we can see the trade-offs that the Python community makes in terms of performance and compatibility.

03 Writing a C Compiler in 500 Lines of Python vgel.me

How many lines of Python code does it take to implement a C compiler? This article introduces the architecture of the compiler, the code parsing and generation process, and attempts to implement a simple C compiler in 500 lines of code.

04 An Intro to Protocol Buffers with Python blog.pythonlibrary.org

Protocol buffers are a language-neutral data serialization format, similar to Python's pickle format. This article introduces how to create and compile protocol buffer files with Python and communicate with other languages that support the protocol.

05 How to Create a Beautiful Polar Histogram with Python and Matplotlib dev.to

A polar histogram is a type of chart used to visualize and analyze the distribution of data. It divides the data into sectors, with the length or area of each sector representing the frequency or quantity of data within that angular range. This article explains how to create a polar histogram in Python.

06 Bloom Filter Diagram and Python Implementation codeconfessions.substack.com

Bloom Filter is a data structure that can be used to quickly determine whether an element is in a set. Use cases include: deduplication, caching and fast lookups, preventing cache penetration, and filtering spam. The article introduces what it is, how it works, Python implementation, how to tune Bloom Filter, etc.

07 Heap Data Structure in Python: Min and Max Heap Implementation favtutor.com

Heap is an essential data structure that is often used for fast access to extreme values, heapsort, scheduling and task allocation, graph algorithms, data compression and encoding, etc. The article introduces its basic concepts, how to implement a max heap and a min heap in Python, and the differences between them.

08 Beginner's Guide to Python Containers developers.redhat.com

Containers are a lightweight virtualization technology that enable efficient packaging and deployment of Python applications. This tutorial from Red Hat shows you how to build, run, and manage Python containers using Podman.

09 A Practical Guide to Python Packaging in 2023 robamu.github.io

This article summarizes some of the best practices that are currently applicable when managing Python packages, such as using pyproject.toml, using setuptools as a distribution and build tool, writing documentation with Sphinx + reStructuredText + sphinx-rtd-theme, listing version changes with CHANGELOG, and using black and flake8, among others.

10 Tracking Down a Python Application Memory Leak juejin.cn

The author uses Airflow as a task scheduler, and after going live, the Scheduler memory OOM issue appears every once in a while. This article provides a detailed account of the process of locating and analyzing the problem. Three tools are introduced: objgraph, pympler, tracemalloc.

11 Introducing flake8-logging adamj.eu

The author believes that the standard library logging is relatively difficult to use, and that necessary logs are often missing when a program errors out, so the flake8-logging plugin was developed. It has 12 rules, and this article introduces 3 of them: instantiating a logger using logging.getLogger(), using exception() when handling exceptions, and avoiding pre-formatting log messages.

12 Falcon 180B is Now Officially Released on Hugging Face Hub segmentfault.com

As the largest open-source large model to date, Falcon has 180B parameters and was trained on the TII RefinedWeb dataset with 35 trillion tokens, making it the longest single-segment pre-training among current open-source models. The article introduces its advantages and how to get started with it.

🎁 Python Trending Weekly 🎁 organizes its content into seasons, with every 30 issues forming a season. The highlights from the first season have been compiled for your convenience. You can access them online here (Chinese).

🐿️

Projects & Resources

× 8
01 pkuseg-python: A multi-domain Chinese word segmentation tool, more accurate than jieba github.com

Unlike other general Chinese word segmentation tools, it supports multi-domain word segmentation, has a higher word segmentation accuracy, supports user-trained models, and supports part-of-speech tagging. The accuracy exceeds the two Chinese word segmentation tools jieba and THULAC. (6.2K stars)

02 pysentation: Display presentations in your CLI github.com

Create and display presentations in your command-line terminal, with support for titles, colors, themes, zooming, explanations, keyboard shortcuts, and more.

03 compress: A fast input tool based on your personal corpus github.com

After importing your personal corpus, you can type long content with abbreviations. It uses Autokey to implement keyboard shortcuts for Linux. (star 1.3K)

04 textbase: A simple framework for building AI chatbots github.com

A framework for building chatbots using NLP and ML, making it easy to develop and deploy web applications. Plans to integrate SMS, native integration of large language models (Claude, Llama). (1.2k stars)

05 reader: A Python-based feed reader library github.com

A feature-rich feed reader that supports fetching, storing, and managing Atom, RSS, and JSON feeds; marking articles as read or starred; filtering feeds and articles; full-text search; user activity statistics; and plugins.

06 Baichuan2: Baichuan 53B Large Model Online Dialogue Platform github.com

Baichuan Intelligence launched a new generation of open-source large language models, trained with 2.6 trillion tokens of high-quality corpora. The model was extensively tested on authoritative Chinese-English and multilingual datasets in six domains: general, law, medical, mathematics, code, and multilingual translation.

07 svcs: A flexible Python service locator github.com

A dependency injection container for Python that provides a mechanism to register factories for types/interfaces, enforcing that instances of these types are acquired via automatic cleanup and health checks. Use dependency injection and service location to achieve inversion of control, eliminating a lot of repetitive boilerplate code.

08 gpt_academic: A practical interactive interface for ChatGPT/GLM github.com

GPT Academic is optimized for academic use, especially for reading, polishing, and writing papers. It features a modular design, supports custom shortcut buttons and function plug-ins, and supports project analysis and self-translation functions for Python and C++. It also supports PDF/LaTex paper translation and summarization, and can query multiple LLM models in parallel, including local models such as chatglm2. It is compatible with Wenxin Yanyi, moss, llama2, rwkv, claude2, Tongyi Qianwen, Shusheng, Xunfei Xinghuo, and others. (41K stars)

ESC
↑↓ select · ↵ open175 issues