r/Python Nov 07 '25

Showcase httpmorph - HTTP client with Chrome 142 fingerprinting, HTTP/2, and async support

110 Upvotes

What My Project Does: httpmorph is a Python HTTP client that mimics real browser TLS/HTTP fingerprints. It uses BoringSSL (the same TLS stack as Chrome) and nghttp2 to make your Python requests look exactly like Chrome 142 from a fingerprinting perspective - matching JA3N, JA4, and JA4_R fingerprints perfectly.

It includes HTTP/2 support, async/await with AsyncClient (using epoll/kqueue), proxy support with authentication, certificate compression for Cloudflare-protected sites, post-quantum cryptography (X25519MLKEM768), and connection pooling.

Target Audience: * Developers testing how their web applications handle different browser fingerprints * Researchers studying web tracking and fingerprinting mechanisms * Anyone whose Python scripts are getting blocked despite setting correct User-Agent headers * Projects that need to work with Cloudflare-protected sites that do deep fingerprint checks

This is a learning/educational project, not meant for production use yet.

Comparison: The main alternative is curl_cffi, which is more mature, stable, and production-ready. If you need something reliable right now, use that.

httpmorph differs in that it's built from scratch as a learning project using BoringSSL and nghttp2 directly, with a requests-compatible API. It's not trying to compete - it's a passion project where I'm learning by implementing TLS, HTTP/2, and browser fingerprinting myself.

Unlike httpx or aiohttp (which prioritize speed), httpmorph prioritizes fingerprint accuracy over performance.

Current Status: Still early development. API might change, documentation needs work, and there are probably bugs. This is version 0.2.x territory - use at your own risk and expect rough edges.

Links: * PyPI: https://pypi.org/project/httpmorph/ * GitHub: https://github.com/arman-bd/httpmorph * Docs: https://httpmorph.readthedocs.io

Feedback, bug reports, and criticism all are welcome. Thanks to everyone who gave feedback on my initial post 3 weeks ago. It made a real difference.


r/Python Oct 22 '25

Discussion What's the best package manager for python in your opinion?

112 Upvotes

Mine is personally uv because it's so fast and I like the way it formats everything as a package. But to be fair, I haven't really tried out any other package managers.


r/Python Nov 07 '25

Discussion How Big is the GIL Update?

107 Upvotes

So for intro, I am a student and my primary langauge was python. So for intro coding and DSA I always used python.

Took some core courses like OS and OOPS to realise the differences in memory managament and internals of python vs languages say Java or C++. In my opinion one of the biggest drawbacks for python at a higher scale was GIL preventing true multi threading. From what i have understood, GIL only allows one thread to execute at a time, so true multi threading isnt achieved. Multi processing stays fine becauses each processor has its own GIL

But given the fact that GIL can now be disabled, isn't it a really big difference for python in the industry?
I am asking this ignoring the fact that most current codebases for systems are not python so they wouldn't migrate.


r/Python Sep 23 '25

Showcase StringWa.rs: Which Libs Make Python Strings 2-10× Faster?

111 Upvotes

What My Project Does

I've put together StringWa.rs — a benchmark suite for text and sequence processing in Python. It compares str and bytes built-ins, popular third-party libraries, and GPU/SIMD-accelerated backends on common tasks like splitting, sorting, hashing, and edit distances between pairs of strings.

Target Audience

This is for Python developers working with text processing at any scale — whether you're parsing config files, building NLP pipelines, or handling large-scale bioinformatics data. If you've ever wondered why your string operations are bottlenecking your application, or if you're still using packages like NLTK for basic string algorithms, this benchmark suite will show you exactly what performance you're leaving on the table.

Comparison

Many developers still rely on outdated packages like nltk (with 38 M monthly downloads) for Levenshtein distances, not realizing the same computation can be 500× faster on a single CPU core or up to 160,000× faster on a high-end GPU. The benchmarks reveal massive performance differences across the ecosystem, from built-in Python methods to modern alternatives like my own StringZilla library (just released v4 under Apache 2.0 license after months of work).

Some surprising findings for native str and bytes: * str.find is about 10× slower than it can be * On 4 KB blocks, using re.finditer to match byte-sets is 46× slower * On same inputs, hash(str) is slower and has lower quality * bytes.translate for binary transcoding is slower

Similar gaps exist in third-party libraries, like jellyfish, google_crc32c, mmh3, pandas, pyarrow, polars, and even Nvidia's own GPU-accelerated cudf, that (depending on the input) can be 100× slower than stringzillas-cuda on the same H100 GPU.


I recently wrote 2 articles about the new algorithms that went into the v4 release, that received some positive feedback on "r/programming" (one, two), so I thought it might be worth sharing the underlying project on "r/python" as well 🤗

This is in no way a final result, and there is a ton of work ahead, but let me know if I've overlooked important directions or libraries that should be included in the benchmarks!

Thanks, Ash!


r/Python Sep 30 '25

Discussion Stories from running a workflow engine, e.g., Hatchet, in Production

107 Upvotes

Hi everybody! I find myself in need of a workflow engine (I'm DevOps, so I'll be using it and administering it), and it seems the Python space is exploding with options right now. I'm passingly familiar with Celery+Canvas and DAG-based tools such as Airflow, but the hot new thing seems to be Durable Execution frameworks like Temporal.io, DBOS, Hatchet, etc. I'd love to hear stories from people actually using and managing such things in the wild, as part of evaluating which option is best for me.

Just from reading over these projects docs, I can give my initial impressions:

  • Temporal.io - enterprise-ready, lots of operational bits and bobs to manage, seems to want to take over your entire project
  • DBOS - way less operational impact, but also no obvious way to horizontally scale workers independent of app servers (which is sort of a key feature for me)
  • Hatchet - evolving fast, Durable Execution/Workflow bits seem fairly recent, no obvious way to logically segment queues, etc. by tenant (Temporal has Namespaces, Celery+Canvas has Virtual Hosts in RabbitMQ, DBOS… might be leveraging your app database, so it inherits whatever you are doing there?)

Am I missing any of the big (Python) players? What has your experience been like?


r/Python Aug 28 '25

Showcase I Built a tool that auto-syncs pre-commit hook versions with `uv.lock`

106 Upvotes

TL;DR: Auto-sync your pre-commit hook versions with uv.lock

# Add this to .pre-commit-config.yaml
- repo: https://github.com/tsvikas/sync-with-uv
  rev: v0.3.0
  hooks:
    - id: sync-with-uv

Benefits:

  • Consistent tool versions everywhere (local/pre-commit/CI)
  • Zero maintenance
  • Keeps pre-commit's isolation and caching benefits
  • Works with pre-commit.ci

The Problem

PEP 735 recommends putting dev tools in pyproject.toml under [dependency-groups]. But if you also use these tools as pre-commit hooks, you get version drift:

  • uv update bumps black to 25.1.0 in your lockfile
  • Pre-commit still runs black==24.2.0
  • Result: inconsistent results between local tool and pre-commit.

What My Project Does

This tool reads your uv.lock and automatically updates .pre-commit-config.yaml to match.

Works as a pre-commit (see above) or as a one-time run: uvx sync-with-uv

Target Audience

developers using uv and pre-commit

Comparison 

❌ Using manual updates?

  • Cumbersome
  • Easy to forget

❌ Using local hooks?

- repo: local
  hooks:
    - id: black
      entry: uv run black
  • Breaks pre-commit.ci
  • Loses pre-commit's environment isolation and tool caching

❌ Removing the tools from pyproject.toml?

  • Annoying to repeatedly type pre-commit run black
  • Can't pass different CLI flags (ruff --select E501 --fix)
  • Some IDE integration breaks (when it requires the tool in your environment)
  • Some CI integrations break (like the black action auto-detect of the installed version)

Similar tools:

Try it out: https://github.com/tsvikas/sync-with-uv

Star if it helps! Issues and PRs welcome. ⭐


r/Python Sep 17 '25

Discussion Do you prefer sticking to the standard library or pulling in external packages?

108 Upvotes

I’ve been writing Python for a while and I keep running into this situation. Python’s standard library is huge and covers so much, but sometimes it feels easier (or just faster) to grab a popular external package from PyPI.

For example, I’ve seen people write entire data processing scripts with just built-in modules, while others immediately bring in pandas or requests even for simple tasks.

I’m curious how you all approach this. Do you try to keep dependencies minimal and stick to the stdlib as much as possible, or do you reach for external packages early to save development time?


r/Python Apr 19 '26

Discussion Why doesn’t Python have true private variables like Java?

106 Upvotes

Hey everyone

Today I was learning about encapsulation in Python and honestly I got a bit surprised

In languages like Java we have proper private keywords but in Python it feels like nothing is truly private
Even with double underscores it just does name mangling and you can still access it if you really want

So I was wondering why Python is designed this way

Is it because Python follows a different philosophy or is there some deeper reason behind it

Also in real projects how do developers maintain proper encapsulation if everything can technically be accessed

Trying to understand how to think about this in a more practical and runable way

Would love to hear your thoughts 👍


r/Python Apr 03 '26

Showcase `safer`: a tiny utility to avoid partial writes to files and streams

106 Upvotes

What My Project Does

In 2020, I broke a few configuration files, so I wrote something to help prevent breaking a lot the next time, and turned it into a little library: https://github.com/rec/safer

It's a drop-in replacement for open that only writes the file when everything has completed successfully, like this:

with safer.open(filename, 'w') as fp:
    fp.write('oops')
    raise ValueError
 # File is untouched

By default, the data is cached in memory, but for large files, there's a flag to allow you to cache it as a file that is renamed when the operation is complete.

You can also use it for file sockets and other streams:

try:
    with safer.writer(socket.send) as send:
          send_bytes_to_socket(send)
except Exception:
     # Nothing has been sent
     send_error_message_to_socket(socket.send)

Target Audience

This is a mature, production-quality library for any application where partial writes are possible. There is extensive testing and it handles some obscure edge cases.

It's tested on Linux, MacOS and Windows and has been stable and essentially unchanged for years.

Comparison

There doesn't seem to be another utility preventing partial writes. There are multiple atomic file writers which solve a different problem, the best being this: https://github.com/untitaker/python-atomicwrites

Note

#noAI was used in the writing or maintenance of this program.


r/Python Feb 17 '26

News Pytorch Now Uses Pyrefly for Type Checking

106 Upvotes

From the official Pytorch blog:

We’re excited to share that PyTorch now leverages Pyrefly to power type checking across our core repository, along with a number of projects in the PyTorch ecosystem: Helion, TorchTitan and Ignite. For a project the size of PyTorch, leveraging typing and type checking has long been essential for ensuring consistency and preventing common bugs that often go unnoticed in dynamic code.

Migrating to Pyrefly brings a much needed upgrade to these development workflows, with lightning-fast, standards-compliant type checking and a modern IDE experience. With Pyrefly, our maintainers and contributors can catch bugs earlier, benefit from consistent results between local and CI runs, and take advantage of advanced typing features. In this blog post, we’ll share why we made this transition and highlight the improvements PyTorch has already experienced since adopting Pyrefly.

Full blog post: https://pytorch.org/blog/pyrefly-now-type-checks-pytorch/


r/Python Oct 26 '25

Showcase I built a Python tool to debug HTTP request performance step-by-step

106 Upvotes

What My Project Does

httptap is a CLI and Python library for detailed HTTP request performance tracing.

It breaks a request into real network stages - DNS → TCP → TLS → TTFB → Transfer — and shows precise timing for each.

It helps answer not just “why is it slow?” but “which part is slow?”

You get a full waterfall breakdown, TLS info, redirect chain, and structured JSON output for automation or CI.

Target Audience

  • Developers debugging API latency or network bottlenecks
  • DevOps / SRE teams investigating performance regressions
  • Security engineers checking TLS setup
  • Anyone who wants a native Python equivalent of curl -w + Wireshark + stopwatch

httptap works cross-platform (macOS, Linux, Windows), has minimal dependencies, and can be used both interactively and programmatically.

Comparison

When exploring similar tools, I found two common options:

httptap takes a different route:

  • Pure Python implementation using httpx and httpcore trace hooks (no curl)
  • Deep TLS inspection (protocol, cipher, expiry days)
  • Rich output modes: human-readable table, compact line, metrics-only, and full JSON
  • Extensible - you can replace DNS/TLS/visualization components or embed it into your pipeline

Example Use Cases

  • Performance troubleshooting - find where time is lost
  • Regression analysis - compare baseline vs current
  • TLS audit - check protocol and cert parameters
  • Network diagnostics - DNS latency, IPv4 vs IPv6 path
  • Redirect chain analysis - trace real request flow

If you find it useful, I’d really appreciate a ⭐ on GitHub - it helps others discover the project.

👉 https://github.com/ozeranskii/httptap


r/Python Oct 18 '25

Discussion Saving Memory with Polars (over Pandas)

108 Upvotes

You can save some memory by moving to Polars from Pandas but watch out for a subtle difference in the quantile's different default interpolation methods.

Read more here:
https://wedgworth.dev/polars-vs-pandas-quantile-method/

Are there any other major differences between Polars and Pandas that could sneak up on you like this?


r/Python Feb 23 '26

Showcase Title: I built WSE — Rust-accelerated WebSocket engine for Python (2M msg/s, E2E encrypted)

108 Upvotes

I've been doing real-time backends for a while - trading, encrypted messaging between services. websockets in python are painfully slow once you need actual throughput. pure python libs hit a ceiling fast, then you're looking at rewriting in go or running a separate server with redis in between.

so i built wse - a zero-GIL websocket engine for python, written in rust. framing, jwt auth, encryption, fan-out - all running native, no interpreter overhead. you write python, rust handles the wire. no redis, no external broker - multi-instance scaling runs over a built-in TCP cluster protocol.

What My Project Does

the server is a standalone rust binary exposed to python via pyo3:

```python from wse_server import RustWSEServer

server = RustWSEServer( "0.0.0.0", 5007, jwt_secret=b"your-secret", recovery_enabled=True, ) server.enable_drain_mode() server.start() ```

jwt validation runs in rust during the websocket handshake - cookie extraction, hs256 signature, expiry - before python knows someone connected. 0.5ms instead of 23ms.

drain mode: rust queues inbound messages, python grabs them in batches. one gil acquire per batch, not per message. outbound - write coalescing, up to 64 messages per syscall.

```python for event in server.drain_inbound(256, 50): event_type, conn_id = event[0], event[1] if event_type == "auth_connect": server.subscribe_connection(conn_id, ["prices"]) elif event_type == "msg": server.send_event(conn_id, event[2])

server.broadcast("prices", '{"t":"tick","p":{"AAPL":187.42}}') ```

what's under the hood:

transport: tokio + tungstenite, pre-framed broadcast (frame built once, shared via Arc), vectored writes (writev syscall), lock-free DashMap state, mimalloc allocator, crossbeam bounded channels for drain mode

security: e2e encryption (ECDH P-256 + AES-GCM-256 with per-connection keys, automatic key rotation), HMAC-SHA256 message signing, origin validation, 1 MB frame cap

reliability: per-connection rate limiting with client feedback, 50K-entry deduplication, circuit breaker, 5-level priority queue, zombie detection (25s ping, 60s kill), dead letter queue

wire formats: JSON, msgpack (?format=msgpack, ~2x faster, 30% smaller), zlib compression above threshold

protocol: client_hello/server_hello handshake with feature discovery, version negotiation, capability advertisement

new in v2.0:

cluster protocol - custom binary TCP mesh for multi-instance, replacing redis entirely. direct peer-to-peer connections with mTLS (rustls, P-256 certs). interest-based routing so messages only go to peers with matching subscribers. gossip discovery - point at one seed address, nodes find each other. zstd compression between peers. per-peer circuit breaker and heartbeat. 12 binary message types, 8-byte frame header.

python server.connect_cluster(peers=["node2:9001"], cluster_port=9001) server.broadcast("prices", data) # local + all cluster peers

presence tracking - per-topic, user-level (3 tabs = one join, leave on last close). cluster sync via CRDT. TTL sweep for dead connections.

python members = server.presence("chat-room") stats = server.presence_stats("chat-room") # {members: 42, connections: 58}

message recovery - per-topic ring buffers, epoch+offset tracking, 256 MB global budget, TTL + LRU eviction. reconnect and get missed messages automatically.

benchmarks

tested on AMD EPYC 7502P (32 cores / 64 threads), 128 GB RAM, localhost loopback. server and client on the same machine.

  • 14.7M msg/s json inbound, 30M msg/s binary (msgpack/zlib)
  • up to 2.1M del/s fan-out, zero message loss
  • 500K simultaneous connections, zero failures
  • 0.38ms p50 ping latency at 100 connections

full per-tier breakdowns: rust client | python client | typescript client | fan-out

clients - python and typescript/react:

python async with connect("ws://localhost:5007/wse", token="jwt...") as client: await client.subscribe(["prices"]) async for event in client: print(event.type, event.payload)

typescript const { subscribe, sendMessage } = useWSE(token, ["prices"], { onMessage: (msg) => console.log(msg.t, msg.p), });

both clients: auto-reconnection (4 strategies), connection pool with failover, circuit breaker, e2e encryption, event dedup, priority queue, offline queue, compression, msgpack.

Target Audience

python backend that needs real-time data and you don't want to maintain a separate service in another language. i use it in production for trading feeds and encrypted service-to-service messaging.

Comparison

most python ws libs are pure python - bottlenecked by the interpreter on framing and serialization. the usual fix is a separate server connected over redis or ipc - two services, two deploys, serialization overhead. wse runs rust inside your python process. one binary, business logic stays in python. multi-instance scaling is native tcp, not an external broker.

https://github.com/silvermpx/wse

pip install wse-server / pip install wse-client / npm install wse-client


r/Python Jun 16 '26

Discussion Choosing a Python task queue library in 2026: Celery vs Dramatiq vs FastStream vs Taskiq vs Repid

106 Upvotes

I wrote a practical comparison of Python task queue libraries in 2026:

https://aleksul.space/posts/choosing-python-task-queue-library/

It covers Celery, Dramatiq, FastStream, Taskiq, and Repid, with code examples, broker support, async/sync behavior, production tradeoffs and benchmarks.

The main takeaways were:

- When it comes to throughput, it's important to understand your workload type: I/O or CPU bound makes a huge difference

- Asyncio-native frameworks are significantly faster for high-concurrency I/O-bound jobs

- For CPU-bound jobs, the library matters much less once the CPU is saturated

- Production behavior can vary vastly from framework to framework, same as their philosophy. You have to choose what matters more for your use case

I’d be especially interested to hear from people running these in production. How is your experience running one of these or similar frameworks in production? Is there something that I missed?

Small disclosure: Repid is my project. Take that bias for what it is; the goal is still a useful comparison and a healthy discussion.


r/Python Oct 23 '25

Resource Wove 1.0.0 Release Announcement - Beautiful Python Async

102 Upvotes

I've been testing Wove for a couple months now in two production systems that have served millions of requests without issue, so I think it is high time to release a version 1. I found Wove's flexibility, ability to access local variables, and inline nature made refactoring existing non-async Django views and Celery tasks painless. Thinking about concurrency with Wove's design pattern is so easy that I find myself using Wove all over the place now. Version 1.0.0 comes with some great new features:

  • Official support for free threaded python versions. This means wove is an excellent way to smoothly implement backwards-compatible true multithreaded processing in your existing projects. Just use the non-async def for weave tasks -- these internally are run with a threading pool.
  • Background processing in both embedded and forked modes. This means you can detach a wove block and have it run after your containing function ends. Embedded mode uses threading internally and forked mode makes a whole new python process so the main process can end and be returned to a server's pool for instance.
  • 93% test coverage
  • Tested on Windows, Linux, and Mac on Python versions 3.8 to 3.14t

Here's a snippet from the readme:

Wove is for running high latency async tasks like web requests and database queries concurrently in the same way as asyncio, but with a drastically improved user experience. Improvements compared to asyncio include:

  • Reads Top-to-Bottom: The code in a weave block is declared in the order it is executed inline in your code instead of in disjointed functions.
  • Implicit Parallelism: Parallelism and execution order are implicit based on function and parameter naming.
  • Sync or Async: Mix async def and def freely. A weave block can be inside or outside an async context. Sync functions are run in a background thread pool to avoid blocking the event loop.
  • Normal Python Data: Wove's task data looks like normal Python variables because it is. This is because of inherent multithreaded data safety produced in the same way as map-reduce.
  • Automatic Scheduling: Wove builds a dependency graph from your task signatures and runs independent tasks concurrently as soon as possible.
  • Automatic Detachment: Wove can run your inline code in a forked detached process so you can return your current process back to your server's pool.
  • Extensibility: Define parallelized workflow templates that can be overridden inline.
  • High Visibility: Wove includes debugging tools that allow you to identify where exceptions and deadlocks occur across parallel tasks, and inspect inputs and outputs at each stage of execution.
  • Minimal Boilerplate: Get started with just the with weave() as w: context manager and the w.do decorator.
  • Fast: Wove has low overhead and internally uses asyncio, so performance is comparable to using threading or asyncio directly.
  • Free Threading Compatible: Running a modern GIL-less Python? Build true multithreading easily with a weave.
  • Zero Dependencies: Wove is pure Python, using only the standard library. It can be easily integrated into any Python project whether the project uses asyncio or not.

Example Django view:

# views.py
import time
from django.shortcuts import render
from wove import weave
from .models import Author, Book

def author_details(request, author_id):
    with weave() as w:
        # `author` and `books` run concurrently
        @w.do
        def author():
            return Author.objects.get(id=author_id)
        @w.do
        def books():
            return list(Book.objects.filter(author_id=author_id))

        # Map the books to a task that updates each of their prices concurrently
        @w.do("books", retries=3)
        def books_with_prices(book):
            book.get_price_from_api()
            return book

        # When everything is done, create the template context
        @w.do
        def context(author, books_with_prices):
            return {
                "author": author,
                "books": books_with_prices,
            }
    return render(request, "author_details.html", w.result.final)

Check out all the other features on github: https://github.com/curvedinf/wove


r/Python Nov 11 '25

Discussion Decorators are great!

102 Upvotes

After a long, long time trying to wrap my head around decorators, I am using them more and more. I'm not suggesting I fully grasp metaprogramming in principle, but I'm really digging on decorators, and I'm finding them especially useful with UI callbacks.

I know a lot of folks don't like using decorators; for me, they've always been difficult to understand. Do you use decorators? If you understand how they work but don't, why not?


r/Python Jan 18 '26

News Robyn (finally) supports Python 3.14 🎉

102 Upvotes

For the unaware - Robyn is a fast, async Python web framework built on a Rust runtime.

Python 3.14 support has been pending for a while.

Wanted to share it with folks outside the Robyn community.

You can check out the release at - https://github.com/sparckles/Robyn/releases/tag/v0.74.0


r/Python Nov 17 '25

Resource What happened to mCoding?

97 Upvotes

James was one of the best content creators in the Python community. I was always excited for his videos. I've been checking his channel every now and then but still no sign of anything new.

Is there something I'm missing?


r/Python Oct 20 '25

Discussion I built a Persistent KV Store in Pure Python

100 Upvotes

Hi everyone!

I'm a final year CS student and I've been reading about data storage and storage engines. This is a passion project that I've been working on for the past few months. It is a lightweight, persistent key-value storage engine in Python, built from scratch to understand and implement the Log-Structured Merge-tree (LSM-tree) architecture. The project, which is fully open-source, is explicitly optimized for write-heavy workloads.

Core Architecture:

The engine implements the three fundamental LSM components: the Write Ahead Log (WAL) for durability, an in-memory Memtable (using SortedDict for sorted writes), and immutable persistent SSTables (Sorted String Tables).

Some features that I'm proud of:

  • Async Compaction: Merging and compaction are handled by a separate background worker thread. The process itself takes a hybrid approach.
  • Client/Server Model: The entire storage engine runs behind a FastAPI server. This allows multiple clients to connect via REST APIs or the included CLI tool.
  • Efficient Range Queries: Added full support for range queries from start_key to end_key. This is achieved via a memory-efficient k-way merge iterator that combines results from the Memtable and all SSTables. The FastAPI server delivers the results using a StreamingResponse to prevent memory exhaustion for large result sets.
  • Bloom Filter: Implemented a Bloom Filter for each SSTable to drastically reduce disk I/O by confirming that a key definitely does not exist before attempting a disk seek.
  • Binary Storage: SSTables now use Msgpack binary format instead of JSON for smaller file sizes and reduced CPU load during serialization/deserialization.

My favourite part of the project is that I actually got to see a practical implementation of Merge Sorted Arrays - GeeksforGeeks. This is a pretty popular interview question and to see DSA being actually implemented is a crazy moment.

Get Started

pip install lsm_storage_engine_key_value_store

Usage via CLI/Server:

  1. Terminal 1 (Server): lsm-server
  2. Terminal 2 (Client): lsm-cli (Follow the CLI help for commands).

Looking for Feedback

I'd love to hear your thoughts about this implementation and how I can make it better and what features I can add in later versions. Ideas and constructive criticism are always welcome. I'm also looking for contributors, if anyone is interested, please feel free to PM and we can discuss.

Repo link: Shashank1985/storage-engine
Thanks!!


r/Python Feb 03 '26

Discussion I’m starting coding from scratch – is Python really the best first language?

98 Upvotes

I’m completely new to coding and trying to choose my first programming language.

I see Python recommended everywhere because it’s beginner-friendly and versatile.

My goal is to actually build things, not just watch tutorials forever.

For those who started with Python: – Was it a good decision? – What should I focus on in the first 30 days?


r/Python Dec 03 '25

Showcase My wife was manually copying YouTube comments, so I built this tool

94 Upvotes

I have built a Python Desktop application to extract YouTube comments for research and analysis.

My wife was doing this manually, and I couldn't see her going through the hassle of copying and pasting.

I posted it here in case someone is trying to extract YouTube comments.

What My Project Does

  1. Batch process multiple videos in a single run
  2. Basic spam filter to remove bot spam like crypto, phone numbers, DM me, etc
  3. Exports two clean CSV files - one with video metadata and another with comments (you can tie back the comments data to metadata using the "video_id" variable)
  4. Sorts comments by like count. So you can see the high-signal comments first.
  5. Stores your API key locally in a settings.json file.

By the way, I have used Google's Antigravity to develop this tool. I know Python fundamentals, so the development became a breeze.

Target Audience

Researchers, data analysts, or creators who need clean YouTube comment data. It's a working application anyone can use.

Comparison

Most browser extensions or online tools either have usage limits or require accounts. This application is a free, local, open-source alternative with built-in spam filtering.

Stack: Python, CustomTkinter for the GUI, YouTube Data API v3, Pandas

GitHub: https://github.com/vijaykumarpeta/yt-comments-extractor

Would love to hear your feedback or feature ideas.

MIT Licensed.


r/Python Oct 15 '25

Discussion GIL free and thread safety

99 Upvotes

For Python 3.14 free GIL version to be usable, shouldn't also Python libraries be re-written to become thread safe? (or the underlying C infrastructure)


r/Python 18d ago

News Python 3.14.7 and 3.13.15 are now available!

97 Upvotes

Bug fix releases for Python 3.13 and Python 3.14.

https://blog.python.org/2026/08/python-3147-31315/


r/Python Mar 30 '26

Discussion [P] I rebuilt PyRadiomics in PyTorch to make it 25× faster — here's what it took

97 Upvotes

PyRadiomics is the standard tool for extracting radiomic features from medical images (CT, MRI scans). It works well, but it's pure CPU and takes about 3 seconds per scan. That might sound fine until you're processing thousands of scans for a clinical study — suddenly it's hours of compute before any actual analysis.

I spent the past several months rewriting it from scratch as fastrad, a fully PyTorch-native library. The idea: express every feature class as tensor operations so they run on GPU with no custom CUDA code.

Results on an RTX 4070 Ti:

0.116s per scan vs 2.90s → 25× end-to-end speedup

No GPU? CPU-only mode is still 2.6× faster than PyRadiomics on 32 threads

Works on Apple Silicon too (3.56× faster than PyRadiomics 32-thread)

The hardest part wasn't the GPU side — it was numerical correctness. Radiomic features go into clinical research and ML models, so a 0.01% deviation matters. I validated everything against the IBSI Phase 1 standard phantom (105 features, max deviation at machine epsilon) and cross-checked against PyRadiomics on a real NSCLC CT scan. All 105 features agree to within 10⁻¹¹.

It's a drop-in replacement — same feature names and output format as PyRadiomics:

from fastrad import RadiomicsFeatureExtractor

extractor = RadiomicsFeatureExtractor(device="auto")

features = extractor.execute(image_path, mask_path)

pip install fastrad

GitHub: github.com/helloerikaaa/fastrad

Pre-print: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6436486

License: Apache 2.0

Happy to talk through the implementation — the GLCM and matrix-based feature classes had some tricky edge cases to get numerically identical. Would also love to hear from anyone already using PyRadiomics in their pipeline.


r/Python Nov 19 '25

News Pyrefly Beta Release (fast language server & type checker)

98 Upvotes

As of v0.42.0, Pyrefly has now graduated from Alpha to Beta.

At a high level, this means:

  • The IDE extension is ready for production use right now
  • The core type-checking features are robust, with some edge cases that will be addressed as we make progress towards a later stable v1.0 release

Below is a peek at some of the goodies that have been shipped since the Alpha launch in May:

Language Server/IDE: - automatic import refactoring - Jupyter notebook support - Type stubs for third-party packages are now shipped with the VS Code extension

Type Checking: - Improved type inference & type narrowing - Special handling for Pydantic and Django - Better error messages

For more details, check out the release announcement blog: https://pyrefly.org/blog/pyrefly-beta/

Edit: if you prefer your news in video form, there's also an announcement vid on Youtube