Python Trending Weekly
ISSUE 52

Python Resources for Excel Processing

2024-05-25 Season 2

TL;DR

Regex matching can be simple and fast, and implementing Llama 3 in pure NumPy is beautifully nerdy; PEP 667 brings consistent namespace views, plus the question of who owns AI-written code.

Articles 12 Projects 12
🦄

Articles & Tutorials

× 12
01 Regular Expression Matching Can Be Simple And Fast swtch.com

This article from 2007 introduces and compares two implementations of regular expressions: traditional methods and Thompson NFA methods. The latter can be millions of times faster than traditional methods on certain tasks, but isn't as widely adopted. The author advocates for programming languages to switch to the latter approach. The author also wrote 3 more articles about regex, detailed at the end of this piece.

Note the units in the chart - one is seconds, the other is microseconds
02 How to Recover Deleted Source Code from Running Code in Memory? gist.github.com

The author accidentally deleted local code and managed to recover it from a running Docker container. The libraries used were pyrasite and uncompyle6, and the article details the specific operational steps.

03 PEP-667: Consistent Views of Namespaces peps.python.org

This PEP is planned for inclusion in Python 3.13, with one of the authors being our domestic @Gaotian. In early Python, all namespaces were implemented using dictionaries, but later the function namespace implementation was changed for performance reasons, causing some weird bugs. This PEP proposes to keep all namespaces consistent again.

04 Replacing pyinstaller with 100 Lines of Code tushar.lol

The author developed a packaged project that can replace pyinstaller to package Python projects into executable files. The article introduces its iterative implementation process, with highlights including the use of python-build-standalone and the special use of the self-extracting compression tool makeself.

05 py.space: Develop Python Apps Online for Free jeff.glass

py.space is a recently launched website that's a streamlined version of Anvil, allowing development of Python applications that run on the web. This tutorial demonstrates the basic functionality of the website.

06 Statically Typed Functional Programming with Python 3.12 wickstrom.tech

The article uses Python 3.12's pattern matching, typing generics combined with data classes to implement functional programming-like features. Match-case usage scenarios are rare nowadays, and this article provides excellent examples.

07 How to Dynamically Generate GitHub Profile README with Python? tduyng.dev

GitHub supports adding personal README files, and there are many open source projects that can help beautify our profiles. The author uses Python to scrape their own blog articles and uses GitHub Actions for dynamic updates. I'm planning to try this when I have time.

08 Custom Linting with pyastgrep lukeplant.me.uk

pyastgrep is a library developed by the author that can query specific Python syntax elements using XPath syntax. The article introduces how to use it for custom code checking, enforcing coding standards that other tools can't satisfy.

09 Generating Code Snippet Images with pygments mostlypython.com

pygments is a library that can highlight code or text. To demonstrate code snippets during PyCon presentations, the author used this library to generate code images. The article covers the implementation process, advantages, and recommendations.

10 Implementing Llama 3 with Pure NumPy docs.likejazz.com

Llama 3 is currently a leader among open source large models. The article details the key components of this model and implements Llama 3 using pure NumPy without relying on deep learning frameworks.

11 Who Owns the Code AI Writes for You? theregister.com

The article raises a currently unsolvable question. AI-assisted programming has emerged, and humans will increasingly rely on AI-completed code. So how should intellectual property rights for this code be determined? AI-generated portions are legally copyright-free, which could bring legal risks.

12 Clever Code Is Probably the Worst Code You Could Write read.engineerscode.com

Clever code is likely not clear code. The article advises against overusing flashy one-liner code. Code readability is crucial - the article distinguishes between good and bad code and provides suggestions for writing clear code.

🐿️

Projects & Resources

× 12
01 Python Resources for Working with Excel python-excel.org

This website collects libraries for reading and writing Excel files (openpyxl, xlsxwriter, pyxlsb, pylightxl, xlrd, xlwt, xlutils) and libraries for writing Excel add-ins (PyXLL, xlwings).

02 yen: Python Virtual Environment Manager, No Python Pre-installation Required github.com

Claimed to be the simplest Python environment management tool, requiring no Python pre-installation. Half the code is written in Rust.

03 Tensor-Puzzles: 21 Tensor Puzzles github.com

This repository collects programming challenges to improve PyTorch skills. (2.8K stars)

04 dishka: Dependency Injection Framework github.com

Provides an IoC (Inversion of Control) container that simplifies object creation and management, avoiding manual object passing or global variables.

05 hstream: Convert Python Scripts to Web Apps github.com

Based on Django + HTMX, can convert Python scripts into interactive web applications.

06 cover-agent: AI Auto-generates Tests to Improve Code Coverage github.com

Let AI help generate test code to effectively improve code coverage. Currently focuses on unit tests and only supports terminal execution. (2.6K stars)

07 pygments: Universal Syntax Highlighter Developed in Python github.com

As mentioned earlier, this syntax highlighting tool supports over 500 languages and text formats, suitable for code repositories, forums, wikis, and other places that need to beautify source code. (1.7K stars)

08 hashquery: Define and Query BI Models in Data Warehouses github.com

Define and query BI models in data warehouses. Expressions are defined in Python and compiled to SQL, capable of expressing complex multi-layer queries beyond standard SQL capabilities.

09 What Metrics Monitoring Libraries Does Python Have? news.ycombinator.com

This is a Q&A thread on Hacker News mentioning projects like: pymetrics, ddtrace, datadog, statsd, pyformance, Prometheus Python client, etc.

10 stamina: Production-Ready Python Retry Library github.com

A retry library based on tenacity with highlights including: retry only on certain exceptions, exponential backoff, automatic async support, global disable for testing, and out-of-the-box Prometheus, structlog, and standard library logging support.

11 piku: Git Push Deploy to Your Own Servers github.com

Deploy your applications to personal servers via git push commands, regardless of server scale. Supports ARM and Intel architectures, suitable for any cloud provider or bare metal that can run Python, nginx, and uwsgi. (2.6K stars)

12 mql: Generate SQL Queries from Natural Language Input github.com

Generates executable SQL statements from natural language, supporting only PostgreSQL databases.

ESC
↑↓ select · ↵ open175 issues