How to Move Independent Work Through an asyncio Pipeline
A practical asyncio workflow for moving independent work through typed events, queues, concurrent tasks, and awaited API calls. Learn where validation and fallback belong.
Loading…
Topic
252 posts about Python. Every summary links to the original.
See the idea
A practical asyncio workflow for moving independent work through typed events, queues, concurrent tasks, and awaited API calls. Learn where validation and fallback belong.
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
The post compares Python and Go across language design, performance, tooling, and developer profiles, drawing on quantitative data from the JetBrains Developer Ecosystem 2026 survey of 28,945 respondents and qualitative interviews with developers who migrated production workloads from Python to Go. Python favors expressive code and rapid iteration, while Go emphasizes explicit, standardized code that is easy to maintain across teams. Go excels in raw performance and concurrency and is widely used in cloud infrastructure, whereas Python remains stronger for machine learning, data science, and scientific computing. Survey data shows that Go developers are typically more infrastructure-focused and senior, and that Go is rarely a first language, while Python is beginner-friendly with 10% of its developers coding for less than a year. Most teams use both languages, with Go for services and infrastructure and Python for AI and data workloads, and moving to Go rarely means abandoning Python.
Google tested Gemini 4 Argon on google/adk-python, a 205,000-line Python framework with 800 source files and 17,000 unit tests. The model ran unattended for 11 hours, guided by a /goal prompt and .agents/skills rulefiles that encoded maintainer conventions. Argon first wrote a benchmark script, spent 70 minutes measuring before editing code, and proposed six optimizations across 32 files; two shipped after human code review. The shipped changes cut in-memory session prep time by about 40% in long sessions and sped up cold package imports by 21% by filtering events before copying and using lazy module accessors. The other four proposals were rejected for relying on fragile state, private library internals, or synthetic-only gains, illustrating a division of labor where the agent explores and the maintainer subtracts.
HL7v2 is the dominant healthcare messaging standard but is difficult to parse due to its nested, delimiter-encoded structure. Existing workarounds like converting to FHIR or using third-party engines add cost and latency. Funke, the successor to the open-source Smolder library, is a new open-source Python and PySpark library under the Databricks License that parses HL7v2 messages directly into native Spark types, preserving the full hierarchy losslessly. It deploys as a Databricks Asset Bundle with a Declarative Pipeline that uses Auto Loader to ingest raw messages into a Unity Catalog volume, then parses them into structured silver tables following the medallion pattern. The library supports all HL7 message types and versions, includes accessor helpers for extracting fields by segment and component, and ships with a demo using synthetic ADT events to illustrate end-to-end ingestion and gold table creation, including a live census and bed utilization dashboard.
The Prime-Sentinel Command (PSC) architecture is an object-oriented master-agent pattern for coordinating edge diagnostic nodes via a centralized orchestrator. Many diagnostic setups tightly couple data polling with central processing, creating bottlenecks and complicating retry logic. PSC isolates agent-level diagnostics into self-contained SentinelProgram instances that sample CPU load, memory utilization, and network state flags, returning structured telemetry payloads. The PrimeProgram controller manages lifecycle dispatch, dynamic registration, batch execution passes, and reporting thresholds, using synchronous list comprehension for sweeps with notes on swapping to concurrent.futures.ThreadPoolExecutor or asyncio.gather for higher node counts. The reference implementation demonstrates three sentinels reporting metrics like CPU 24.15%, RAM 45.20%, and network status STABLE, with payloads designed for JSON serialization across WebSockets, gRPC, or message brokers.
Kube AuthKit is a lightweight Python library that unifies Kubernetes and OpenShift authentication behind a single API, eliminating conditional code paths across local, pod, notebook, and CI/CD environments. It supports four strategies—kubeconfig, in-cluster, OIDC, and OpenShift OAuth—auto-detected by an AuthFactory that probes environment variables and in-cluster markers in a defined order. The library handles token lifecycle transparently, with in-memory storage by default and optional OS keyring persistence for local development to avoid repeated logins. It provides two OIDC flows: device code for headless environments and authorization code with PKCE for interactive applications, both with automatic token refresh. Kube AuthKit returns a standard Kubernetes Python client ApiClient, ensuring full compatibility with the official library, and is actively maintained by the Open Data Hub community for OpenShift AI environments.
Accuracy is misleading for fraud detection because a model labeling everything legitimate can score 96% while catching zero fraud when fraud is only 4% of transactions. The post runs a hand-built Python grid search across algorithm, hyperparameters, feature set, class weight, and decision threshold, ranking by a custom cost metric balancing fraud savings against a US 6 analyst cost per flag. On a 480-transaction test split from a 2,400-transaction dataset with 4% fraud, the winning logistic regression caught 15 of 19 frauds, saving US 3,578 over a baseline that caught none. The winner’s evidence is passed to a local 1-billion-parameter LLM that drafts analyst notes, keeping the LLM downstream of the decision to avoid hallucination. The same workflow scales to Red Hat OpenShift AI by swapping local components for enterprise services like AutoML with AutoGluon and model serving via vLLM.
Cloudflare announced general availability of Python Workers, making Python a first-class language on its developer platform. The runtime now encapsulates type conversion so developers use Cloudflare bindings like D1 and Workers AI directly, without the previously required JavaScript glue code. Popular frameworks FastAPI, Django, and Flask run inside Workers via built-in ASGI and WSCI connectors that translate JavaScript requests into standard Python structures. A custom socket syscall implementation enables TCP connections for database drivers, unlocking Hyperdrive integration with PostgreSQL and MySQL, previously blocked by WebAssembly sandbox limits. Example projects include streaming from Bluesky Jetstream via Durable Objects, building an MCP server with the official Python MCP package, and creating a RAG system with Vectorize, with documentation now including Python examples alongside TypeScript.
Building a knowledge assistant over code requires more careful chunking than indexing ordinary business documents, because code has nested structure, cross-file dependencies, and multiple file formats. The comparison built three Databricks Knowledge Assistants over the Casper’s Kitchens repository: fixed-size character chunks, LangChain language-aware splitting, and AST-based splitting with structure and metadata headers. The AST approach used ASTChunk to preserve units such as functions, classes, or statement blocks and prepend file paths plus class/function hierarchies to chunks. MLflow GenAI evaluation ran 46 questions with retrieval sufficiency, groundedness, and custom answer-correctness judges; AST chunking achieved 89% retrieval sufficiency and 70% fully correct answers, versus 85% and 59% for the naive baseline. The advantage was strongest for disambiguating structurally similar code, while value lookups and complete definition retrieval were comparable across methods.
Apache Airflow users can now use an upstream ClickHouse provider, offering an officially maintained alternative to community plugins or custom integration code. The provider, apache-airflow-providers-clickhousedb, uses ClickHouse Connect over HTTP(S), integrates with Airflow’s common SQL framework, and supplies ClickHouseHook for bulk inserts, streaming, and client-specific operations. The post documents installation, connection setup, standard SQLExecuteQueryOperator DAGs, bulk insertion, and local or managed deployment through Astronomer, including TLS settings for ClickHouse Cloud. Production examples include Astronomer’s Astro Observe, Chartmetric’s 15-million-row playlist pipeline every five minutes, and ClickHouse’s warehouse, which schedules 76 DAGs across more than 40 sources and moves about 6 billion rows daily. The provider is available now, with future capabilities guided by community requests.
Red Hat Enterprise Linux 9.8 and 10.2 now provide a free-threaded Python 3.14 build alongside the regular interpreter, enabling developers to test parallel CPU execution with threads. The build disables the GIL, allowing Python threads to execute on multiple CPU cores in one process, while built-in dict, list, and set operations retain internal locking for individual operations. Developers install the python3.14-freethreading package from the CodeReady Linux Builder repository; it provides the separate python3.14t executable and commands to verify free-threading support and GIL status. Existing code may expose race conditions, and unsupported C-extension dependencies can re-enable the GIL, so the source recommends testing, dependency checks, explicit synchronization, and workload measurement. The build carries a stated 5%-10% single-threaded performance overhead and mainly targets CPU-bound threaded workloads.
The tutorial builds a Python FastAPI voice service that preserves caller context, preferences, and action history across separate inbound calls using Twilio Conversation Memory. It connects a Twilio phone number to a /voice webhook and /ws WebSocket through Conversation Relay, then uses an asynchronous OpenAI client with gpt-4o-mini to generate streamed responses. A memory service retrieves stored information by caller number, while each completed call is summarized and written back to the configured memory store. The example uses an auto-repair assistant whose system prompt incorporates prior context before the next call, and the test procedure checks that a second call recalls details from the first. The setup requires Python 3.11 or later, Twilio and OpenAI credentials, a memory-store and configuration ID, and ngrok for exposing local webhooks.
Voice agents can converse, but need external APIs to retrieve live data or take actions such as checking inventory and booking appointments. This tutorial builds a Python and FastAPI voice agent with Twilio Conversation Relay, OpenAI tool calling, and an unauthenticated Cat Facts REST API. A FastAPI webhook returns TwiML that connects callers to a websocket, while Conversation Relay messages are converted into conversation history and streamed responses. When the model requests a cat fact, the application executes the tool, sends its result back to OpenAI, and streams the follow-up answer to the caller. The setup uses environment variables for the OpenAI key, httpx for asynchronous external requests, and ngrok to expose local webhooks; the completed test lets a caller ask for and receive a cat fact.
Managing hundreds of persistent outbound WebSocket connections requires explicit ownership because a failed worker can drop connections and stop data flow until they are reassigned. The described fleet-management pattern uses Amazon DynamoDB leases, conditional writes, and a global secondary index to ensure one worker owns each connection, renew ownership with heartbeats, and find expired leases for reconciliation. Amazon ECS on AWS Fargate workers poll Amazon SQS for notifications, maintain the WebSockets, and release or transfer ownership during graceful shutdown, failures, and scaling. The design also records desired state, the upstream URL, and the last processed sequence number in the lease item, while clock synchronization supports its time-based expiry. The post identifies heartbeat writes as the dominant DynamoDB cost and recommends provisioned capacity with Auto Scaling for sustained high connection counts, while noting that longer intervals reduce cost but extend failover.
This tutorial shows how to build a phone-based voice AI agent with OpenAI's GPT-Live, Twilio Agent Connect, and Python. It configures TAC's GPTLiveProvider to bridge Twilio Programmable Voice Media Streams to GPT-Live-1 in the OpenAI API, using 8kHz mu-law audio and avoiding custom WebSocket plumbing. The tutorial sets a proactive greeting, exposes a Python weather function through Responses delegation, and runs the function outside the real-time voice loop so a simulated three-second backend delay does not block the conversation. The resulting setup handles inbound calls through a Twilio webhook and outbound calls with an E.164 number, while the tutorial also notes per-call customization and alternative voice providers.
The post introduces a Twilio Agent Connect integration for building production-ready voice AI experiences with OpenAI’s GPT-Live-1 speech-to-speech model. It addresses the gap between real-time speech intelligence and customer-facing communications by connecting GPT-Live-1 to Twilio Voice and Conversations while preserving context across channels and supporting reliable scale. The SDK supplies a native GPTLiveProvider that links Twilio Voice Media Streams directly to the OpenAI API without custom WebSocket plumbing, and handles turn-taking, audio streaming, interruption handling, and tool delegation. Tutorials, documentation, and example repositories cover inbound and outbound agents implemented with Python and Node.js, giving developers materials to build, test, and deploy voice applications.
Workflow1111 rebuilds most of AUTOMATIC1111’s stable-diffusion-webui feature set as a single Gradio Workflow canvas. It combines eleven media pipelines and 73 nodes for text-to-image, refinement, image-to-image, prompting, interrogation, detection masks, annotators, upscaling, background removal, PNG metadata, and image-to-video. The implementation uses four operator kinds—Python fn functions, model calls through InferenceClient, Space calls, and Hub dataset rows—with parallel branches for independent work; 32 of 36 operator nodes are fn nodes, and 22 run in-process without network calls. Models can run through Inference Providers, Spaces, or a local GPU, while output nodes automatically become REST endpoints and MCP tools. The result is a browser-accessible, OAuth-enabled workflow that can also be duplicated, rewired, deployed, and called from code.
CUDA Toolkit 13.4 extends CUDA application support to Windows on Arm and provides preview support for NVIDIA Rubin (compute capability 107), alongside updates to GPU management, CUDA Python, CCCL, Nsight tools, and core math libraries. Multi-Process Service V3 adds a scriptable CLI, named server instances, namespaces, TOML configuration, streaming multiprocessor partition controls, and cgroup-integrated GPU memory limits for shared, containerized GPU workloads. CUDA Compute Fabric Transport lets communication-library developers address named NVLink endpoints and issue asynchronous put, get, and reduction operations without mapping every remote allocation into virtual address space; it is exposed only through the Driver API. The release also decouples driver installation from the toolkit, exposes locality and unified-memory residency queries, and changes coherent platforms to CDMM by default while retaining NUMA support.
IBM has released Granite Time Series PatchTST-FM-r2, a roughly 385-million-parameter foundation model for zero-shot forecasting across demand, prices, energy loads, traffic, telemetry, and other time series. The model uses conformer blocks combining multi-head self-attention with temporal convolution, 50% overlapping patches with Hamming-window weighting, overlap-and-add forecasting, contexts up to 8,192 steps, and a 99-quantile prediction head for probabilistic outputs and imputation support. On GIFT-Eval, it ranks second for both CRPS and MASE among replicable zero-shot models as of September 8, 2026, and first in that category among permissively licensed models; including pretrained models, it ranks third for CRPS and fourth for MASE. IBM provides open weights, architecture, inference code, and reproducibility code under Apache 2.0 and OpenMDW 1.0. The release also describes Python use and streaming integration through Apache Flink on Confluent Cloud.
An interview with Python educator Ardit Sulce examines how beginners should learn programming as AI changes development and teaching. Sulce says AI now handles many small questions, while teachers provide curated learning paths, judgment, and context; he also argues that students should preserve productive struggle while outsourcing setup friction. He recommends evaluating understanding through code explanation, review, and debugging rather than treating working code as proof, and identifies reading unfamiliar code, debugging, and system understanding as important junior skills. His proposed three-stage path moves from writing syntax by hand in a professional IDE, to using AI as a tutor, and finally to using it as a co-worker while reviewing increasingly complex projects.
This practical comparison examines how YOLO12, YOLO26, and RF-DETR behave when moved from COCO to specialized real-world object-detection datasets, and how fine-tuning changes the outcome. The authors first evaluate six pretrained checkpoints on COCO val2017, then use cable-damage, bone-fracture, and soda-bottles datasets from RF100-VL for zero-shot testing, fine-tuning, and accuracy/latency comparison. Because the model implementations require incompatible dependencies, the workflow uses one PyCharm project with three isolated uv environments and remote GPU execution; the reported latency stays in native frameworks rather than TensorRT. All models perform well on COCO, but direct performance on specialized data falls close to zero, while 10 fine-tuning epochs adapt the detectors well to cable damage and soda bottles. Bone-fracture remains difficult despite fine-tuning, with RF-DETR performing best, indicating that domain shift may require more data, longer training, or domain-specific pretraining.
The best engineering reads, once a week.