A comprehensive Python development practices guide covering Python selection and management, development tools (package management, formatting, and code checking), language syntax usage, testing tools, packaging tools, logging, virtual environments, and more. It's pretty much all-encompassing.
TL;DR
Modern best practices for Python development cap 2024 alongside a Flask year in review, and minimind trains a 26M-parameter GPT from scratch in three hours.
Articles & Tutorials
× 12What are the best practices for creating Python projects in 2024? What tools are recommended? The author's list includes uv, ruff, pyproject.toml, pyright, pydantic, pytest, and click. The article received lots of upvotes and replies on Reddit.
What interesting things happened in the Flask community in 2024? The author reviews Flask's development from several perspectives, including version releases, framework development speed, new features, backward compatibility, competition, and popularity.
GitHub's vulnerability management team has open-sourced a new logging library called Annotated Logger. It uses decorators to log function and class execution, supports custom log objects, sends JSON-formatted logs, and supports adding fields like Git branch and vulnerability names to logs.
How do you debug memory leak issues in Python? The author shares the objgraph library, which can view memory object growth and trigger runtime checks through signals. The article shows how to use it to locate and visualize memory leaks, helping to quickly identify and resolve memory leak problems.
How do you use shiv to package a Python project and its dependencies into an executable zip file (zipapp)? How does shiv improve runtime speed? What other features does shiv support, and what issues should you watch out for when using it?
The official PyPI blog introduces the project quarantine feature, which allows administrators to flag potentially harmful projects and prevent malicious software from being installed. The article covers implementation details of this feature. Since August 2024, about 140 projects have been flagged for quarantine, with only one being corrected.
How do you set up and use debugging features in VS Code? The article covers installing extensions, configuring debug environments, using breakpoints, adding variable monitoring, handling common exceptions like FileNotFoundError and JSONDecodeError, and shows how to use Sentry for continuous monitoring and debugging in production environments.
Introduces using Solara's UI components to create an interactive dashboard in Jupyter, with the final product allowing users to filter, visualize, and explore datasets on a map. The second part of the series covers how to deploy the service, and the third part introduces adding more components to extend the dashboard.
juv is a tool for simplifying Python environment management in Jupyter notebooks, allowing dependencies to be embedded directly in notebook files for easier setup and sharing. The article also covers integrating juv with pyds-cli for temporary data analysis, enhancing reusability and reducing environment conflicts.
The sys.monitoring introduced in Python 3.12 can listen for specific events on particular code lines, providing fine-grained control. The article demonstrates through practical examples how to use it to monitor changes to sys.path, how to set up monitoring callback functions, and shows its powerful utility in debugging complex code.
The Boids algorithm is an artificial life program that simulates flocking behavior in birds, producing realistic natural bird dynamics. The article provides an in-depth explanation of Boids algorithm implementation, introduces how to implement Boids animation on TFT displays, and explores possibilities for adding complex behaviors like predators and roosting behavior.
Projects & Resources
× 12A Python console colored progress bar library with the advantage of writing directly to stdout and stderr, supporting Jupyter Notebooks.
Helps you quickly migrate Poetry/Pipenv projects to the currently popular uv package manager.
A modern, production-ready FastAPI project template supporting CRUD, async SQLAlchemy with PostgreSQL, custom exception handling, CI and testing pipelines, pre-commit code checking, and one-click Railway deployment.
Train a tiny language model under 30M parameters completely from scratch, with fast inference and even training possible on regular personal GPUs. Not just an open-source model implementation, but also a tutorial for getting started with Large Language Models (LLMs). (3.2K stars)
Enables Django to support async class and function-based views, supporting Django 4.1+.
A lightweight framework for consistency distillation of video diffusion models, achieving 8x inference acceleration. Supports distillation/fine-tuning/inference of state-of-the-art open video DiTs.
A local gateway that ensures AI-generated suggestions follow best practices while protecting code integrity and safeguarding personal privacy. Use AI with confidence without worrying about security and productivity.
An open-source URL shortening service implemented in Python, providing a free website. Supports creating and customizing short links, link management and tracking, and social media preview effects. Backend built with Flask + SQLite, frontend JavaScript supports mobile responsive design.
Uses AWS CloudWatch event rules to trigger Lambda functions, leveraging databases and ChatGPT to get Dutch words, English translations, and example sentences, automatically sending emails.
A new mixing method for natural color blending that generates saturated gradients with hue variations and natural secondary colors during mixing, closer to real pigment colors. (2.7K stars)
A lightweight, easy-to-use, extensible framework for time series analysis, from understanding key statistics and features, detecting change points and anomalies, to forecasting future trends. (5.4K stars)
A modular server management panel for Linux and BSD, developed with Python3 and AngularJS. Low memory footprint and CPU usage. Can run on low-end machines, wall plugs, routers, and other devices. (7.6K stars)