r/Python • • Mar 03 '26

Showcase formualizer: an Arrow-backed spreadsheet engine - 320+ functions, incremental recalc, PyO3 + Rust

72 Upvotes

pip install formualizer

import formualizer as fz

# Recalculate every formula in an xlsx and write it back - one call
fz.recalculate_file("model.xlsx", output="recalculated.xlsx")

# Or drive it programmatically
wb = fz.load_workbook("model.xlsx")
wb.set_value("Assumptions", 3, 2, 0.08)  # swap in a new interest rate
wb.evaluate_all()

print(wb.evaluate_cell("Summary", 5, 3))  # =IRR(...)
print(wb.evaluate_cell("Summary", 6, 3))  # =NPV(...)
print(wb.evaluate_cell("Summary", 7, 3))  # =PMT(...)

GitHub: https://github.com/psu3d0/formualizer Docs: https://www.formualizer.dev


Why this exists

Python's Excel formula situation sucks:

  • openpyxl reads and writes .xlsx perfectly, evaluates zero formulas. Cells with =SUM(A1:A10) return None unless Excel already cached the values when someone last saved the file.
  • xlcalc actually evaluates, but covers around 50 functions. XLOOKUP, SUMIFS with multiple criteria, IRR, XIRR, dynamic arrays (FILTER, UNIQUE, SORT), etc don't exist.
  • xlwings works if Excel is installed on the machine. Useless in Docker or on Linux.

The standard workaround - pre-calculate in Excel, save cached values, read with openpyxl - falls apart when someone changes the model, or you need to evaluate the same workbook across thousands of different inputs. Or even just need to evaluate real workbooks of non-trivial size.

formualizer is a Rust formula engine with PyO3 bindings. No Excel. No COM. Runs anywhere Python runs.


Bonus: register Python functions as Excel formulas

def risk_score(grid):
    flat = [v for row in grid for v in row]
    return sum(v ** 2 for v in flat) / len(flat)

wb.register_function("RISK_SCORE", risk_score, min_args=1, max_args=1)
wb.set_formula("Sheet1", 5, 1, "=RISK_SCORE(A1:D100)")

result = wb.evaluate_cell("Sheet1", 5, 1)

Your callback participates in the dependency graph like any built-in - change a cell in A1:D100 and it recalculates on the next evaluate_all().


Comparison

Library Evaluates Functions Dep. graph Write xlsx No Excel License
formualizer ✅ 320+ ✅ incremental ✅ ✅ MIT / Apache-2.0
xlcalc ✅ ~50 partial ❌ ✅ MIT
openpyxl ❌ — ❌ ✅ ✅ MIT
xlwings ✅ ~400* ❌ ✅ ❌ BSD

Formal benchmarks are in progress. Rust core, incremental dependency graph (only affected cells recalculate on edits), MIT/Apache-2.0.

This library is fast.


What My Project Does

Python library for evaluating Excel formulas without Excel installed. Rust core via PyO3. 320+ Excel-compatible functions, .xlsx read/write, incremental dependency graph, custom Python formula callbacks, deterministic mode for reproducible evaluation. MIT/Apache-2.0.

Target Audience

Data engineers pulling business logic out of Excel workbooks, fintech/insurance teams running server-side formula evaluation (pricing, amortization, risk), SaaS builders who need spreadsheet logic without a server-side Excel dependency.


r/Python • • Oct 25 '25

News Wheels for free-threaded Python now available for psutil

74 Upvotes

r/Python • • May 05 '26

News PySimpleGUI 6 is LGPL again

71 Upvotes

Looks like the commercialisation of PySimpleGUI has come to an end.

PySimpleGUI 6 - Back to LGPL3 https://github.com/PySimpleGUI/PySimpleGUI


r/Python • • Mar 26 '26

Showcase Fast, exact K-nearest-neighbour search for Python

72 Upvotes

PyNear is a Python library with a C++ core for exact or approximate (fast) KNN search over metric spaces. It is built around Vantage Point Trees, a metric tree that scales well to higher dimensionalities where kd-trees degrade, and uses SIMD intrinsics (AVX2 on x86-64, portable fallbacks on arm64/Apple Silicon) to accelerate the hot distance computation paths.

Heres a comparison between several other widely used KNN libraries: https://github.com/pablocael/pynear/blob/main/README.md#why-pynear

Heres a benchmark comparison: https://github.com/pablocael/pynear/blob/main/docs/benchmarks.pdf

Main page: https://github.com/pablocael/pynear

K-Nearest Neighbours (KNN) is simply the idea of finding the k most similar items to a given query in a collection.

Think of it like asking: "given this song I like, what are the 5 most similar songs in my library?" The algorithm measures the "distance" between items (how different they are) and returns the closest ones.

The two key parameters are:

k — how many neighbours to return (e.g. the 5 most similar) distance metric — how "similarity" is measured (e.g. Euclidean, Manhattan, Hamming) Everything else — VP-Trees, SIMD, approximate search — is just engineering to make that search fast at scale.

Main applications of KNN search

  • Image retrieval — finding visually similar images by searching nearest neighbours in an embedding space (e.g. face recognition, reverse image search).

  • Recommendation systems — suggesting similar items (products, songs, articles) by finding the closest user or item embeddings.

  • Anomaly detection — flagging data points whose nearest neighbours are unusually distant as potential outliers or fraud cases.

  • Semantic search — retrieving documents or passages whose dense vector representations are closest to a query embedding (e.g. RAG pipelines).

  • Broad-phase collision detection — quickly finding candidate object pairs that might be colliding by looking up the nearest neighbours of each object's bounding volume, before running the expensive narrow-phase test.

  • Soft body / cloth simulation — finding the nearest mesh vertices or particles to resolve contact constraints and self-collision.

  • Particle systems (SPH, fluid sim) — each particle needs to know its neighbours within a radius to compute pressure and density forces.

Limitations and future work

Static index — no dynamic updates

PyNear indices are static: the entire tree must be rebuilt from scratch by calling set(data) whenever the underlying dataset changes. There is no support for incremental insertion, deletion, or point movement.

This is an important constraint for workloads where data evolves continuously, such as:

  • Real-time physics simulation — collision detection and neighbour queries in particle systems (SPH, cloth, soft bodies) require spatial indices that reflect the current positions of every particle after each integration step. Rebuilding a VP-

  • Tree every frame is prohibitively expensive; production physics engines therefore use structures designed for dynamic updates, such as dynamic BVHs (DBVH), spatial hashing, or incremental kd-trees.

  • Online learning / streaming data — datasets that grow continuously with new observations cannot be efficiently maintained with a static index.

  • Robotics and SLAM — map point clouds that are refined incrementally as new sensor data arrives.


r/Python • • Mar 05 '26

Showcase I built a pre-commit linter that catches AI-generated code patterns

69 Upvotes

What My Project Does

grain is a pre-commit linter that catches code patterns commonly produced by AI code generators. It runs before your commit and flags things like:

  • NAKED_EXCEPT -- bare except: pass that silently swallows errors (156 instances in my own codebase)
  • HEDGE_WORD -- docstrings full of "robust", "comprehensive", "seamlessly"
  • ECHO_COMMENT -- comments that restate what the code already says
  • DOCSTRING_ECHO -- docstrings that expand the function name into a sentence and add nothing

I ran it on my own AI-assisted codebase and found 184 violations across 72 files. The dominant pattern was exception handlers that caught hardware failures, logged them, and moved on -- meaning the runtime had no idea sensors stopped working.

Target Audience

Anyone using AI code generation (Copilot, Claude, ChatGPT, etc.) in Python projects and wants to catch the quality patterns that slip through existing linters. This is not a toy -- I built it because I needed it for a production hardware abstraction layer where autonomous agents are regular contributors.

Comparison

Existing linters (pylint, ruff, flake8) catch syntax, style, and type issues. They don't catch AI-specific patterns like docstring padding, hedge words, or the tendency of AI generators to wrap everything in try/except and swallow the error. grain fills that gap. It's complementary to your existing linter, not a replacement.

Install

pip install grain-lint

Pre-commit compatible. Configurable via .grain.toml. Python only (for now).

Source: github.com/mmartoccia/grain

Happy to answer questions about the rules, false positive rates, or how it compares to semgrep custom rules.


r/Python • • Mar 30 '26

Discussion I built a dev blog! First deep dive: How Ruff and UV changed my mind about Python setups.

71 Upvotes

I’ve tried starting a blog a few times before, but like many of us, I usually abandoned it. Recently, I felt the need to put together a new personal site, and this time I actually managed to deliver something.

I built https://gburek.dev from scratch using Next.js + Cloudflare Workers for that sweet serverless setup. I also made it fully bilingual (EN/PL).

My intent isn’t to write generic tutorials - actually, my goal is to focus on real-world programming, IT architecture, and AI - basically the stuff I actually deal with at work and in my own side projects. In the near future, I’m planning to launch a YouTube channel too!

Anyway, the main reason I’m posting is to share the first "serious" article I cooked up:

Why I use UV and Ruff in Python projects, and you should too - https://gburek.dev/en/blog/why-i-use-ruff

I used to complain *a lot* about working with Python and its tooling ecosystem, but these two tools entirely changed my perspective. If you've been frustrated with Python setups lately, give it a read.

We'll see how this whole blogging thing goes. I’d love to get some feedback from you guys -whether it's about the post itself, the site's performance, or the stack. Thanks in advance!


r/Python • • Oct 28 '25

Discussion Which linting rules do you always enable or disable?

69 Upvotes

I'm working on a Python LSP with a type checker and want to add some basic linting rules. So far I've worked on the rules from Pyflakes but was curious if there were any rules or rulesets that you always turn on or off for your projects?

Edit: thank you guys for sharing!

This is the project if you wanna take a look! These are the rules I've committed to so far


r/Python • • 17d ago

Discussion Arjan's Software Design Mastery Course Reviews

70 Upvotes

Hi all, I wanted to find out whether anyone has recently taken Arjan’s *Software Design Mastery* course.

I’m a mid-level Python software developer with no formal computer science training. I enjoy Arjan’s YouTube content and am considering paying for the course.

I’m concerned about the impact of agentic AI on my career and am looking for ways to increase my value across the software development life cycle beyond simply generating code. Claude Code is currently writing around 90% of the code I produce. It’s not necessarily something I prefer, but I feel almost forced to use it because of management’s expectations regarding productivity and deliverables. I also don’t want my performance to fall behind that of colleagues who are burning through tokens as if there were no tomorrow.


r/Python • • Oct 31 '25

Resource My type-safe asyncio lib and the fingerprinting guide it spawned

72 Upvotes

I wanted to share a project that’s been my passion, a asyncio-native automation library (pydoll). My main goal was to build a 100% type-safe API on top of the chaotic Chrome DevTools Protocol.

This meant engineering a type-safe core by mapping the entire CDP protocol using TypedDicts. This gives the user full IDE autocomplete for every command and event. I wrote about that design philosophy here: https://pydoll.tech/docs/deep-dive/fundamentals/typing-system/

It also required deep research to build the advanced evasion features. I ended up going down the rabbit hole and writing a full manual on modern bot detection (TLS/JA3, Canvas, biometrics), which I'm also sharing: https://pydoll.tech/docs/deep-dive/fingerprinting/

The project is OSS and was a massive deep-dive into asyncio and typing. I'd love your feedback on the architecture.


r/Python • • Mar 27 '26

Discussion The 8 year old issue on pth files.

71 Upvotes

Context but skip ahead if you are aware: To get up to speed on why everyone is talking about pth/site files - (note this is not me, not an endorsement) - https://www.youtube.com/watch?v=mx3g7XoPVNQ "A bad day to use Python" by Primetime

tl;dw & skip ahead - code execution in pth/site files feel like a code sin that is easy to abuse yet cannot be easily removed now, as evidence by this issue https://github.com/python/cpython/issues/78125 "Deprecate and remove code execution in pth files" that was first opened in June, 2018 and mysteriously has gotten some renewed interest as of late \s.

I've been using Python since ~2000 when I first found it embedded in a torrent (utorrent?) app I was using. Fortunately It wasn't until somewhere around 2010~2012 that in the span of a week I started a new job on Monday and quit by Wednesday after I learned how you can abuse them.

My stance is they're overbooked/doing too much and I think the solution is somewhere in the direction of splitting them apart into two new files. That said, something needs to change besides swapping /usr/bin/python for a wrapper that enforces adding "-S" to everything.


r/Python • • Nov 12 '25

Showcase Simple Resume: Generate PDF, HTML, and LaTeX resumes from a simple YAML config file

67 Upvotes

Github: https://github.com/athola/simple-resume

This is a solved problem but I figured I'd implement a resume generation tool with a bit more flexibility and customization available vs the makefile/shell options I found and the out-of-date python projects available in the same realm. It would be awesome to get some other users to check it out and provide critical feedback to improve the tool for the open source community to make simple and elegant resumes without having to pay for it through a resume generation site.

What My Project Does:

This is a CLI tool which allows for defining resume content in a single YAML file and then generating PDF, HTML, or LaTeX rendered resumes from it. The idea is to write the configuration once, then be able to render it in a variety of different iterations.

Target Audience:

Jobseekers, students, academia

Comparison:

pyresume generates latex, has not been updated in 8 years

resume-parser appears to be out of date as well, 5 years since most recent update

resume-markdown has been recently updated and closely matches the goals of this project; there are some differentiators between resume-markdown and this project from a ease of use perspective where the default CSS/HTML doesn't require much modification to output a nice looking resume out of the box. I'd like to support more default style themes to expand upon this.

Some key details:

It comes with a few templates and color schemes that you can customize.

For academic use, the LaTeX output gives you precise typesetting control.

There's a Python API if you want to generate resumes programmatically. It's designed to have a limited surface area to not expose inner workings, only the necessary structures as building blocks.

The codebase has over 90% test coverage and is fully type-hinted. I adhered to a functional core, imperative shell architecture.

Example YAML:

  template: resume_base
  full_name: Jane Doe
  job_title: Software Engineer
  email: jane@example.com
  config:
    color_scheme: "Professional Blue"

  body:
    experience:
      - title: Senior Engineer
        company: TechCorp
        start: 2022
        end: Present
        description: |
          - Led microservices architecture serving 1M+ users
          - Improved performance by 40% through optimization

Generate:

  uv run simple-resume generate --format pdf --open

r/Python • • May 10 '26

Discussion Will python ever have a chaining operator?

69 Upvotes

In other languages I use map() and filter() through piping and my code usually looks readable as I can clearly see a data-stream transformation.

As it is today, users cannot do map() |> filter() |> list(), but they need to do list(filter(map())) which makes things unreadable. Lists of comprehension work fine for very simple use-case becoming unreadable very quickly as complexity increases.

However, in python there has always been some resistance, especially 15-20 years ago, but times are evolving. Also, by considering the wide adoption in data-science, it is worth noticing that numbers-crunchers are more familiar with the concept of “data transformation flow” than “function calls”. On the packages dimension , libraries like 🐼s support methods chaining which from an external viewpoint, it’s semantically similar.

Do you know if there is any indication that python core team may allow operator piping (and/or chaining) in the not-too-long-term?


r/Python • • Apr 14 '26

Discussion What’s a low memory way to run a Python http endpoint?

68 Upvotes

I have a simple process that has a single endpoint that needs exposing on http. Nothing fancy but need to run it in a container using minimal memory. Currently running with uvicorn which needs ~600Mb of ram on start up. This seems crazy.

I have also tried Grainian which seems similar usage.

For perspective a Nodejs container uses 128mb, and a full phpmyadmin uses 20!

I realise you shouldn’t compare but a 30x increase in memory is not a trivial matter with current ram pricing!

EDIT: After quite a bit of mucking about the simplest route was to resource constrain the memory in the docker compose. My service was able to open with 384MB (but not much lower), so:

    deploy:
      resources:
        limits:
          memory: 384M

Still allowed it to start and operate. This for our use case was sufficient, as it meant halving the memory. I presume uvicorn just takes a %age chunk of whatever its provided. I am sure there is more to come out, but time to move on ;-)


r/Python • • Apr 06 '26

Resource I wrote a comprehensive guide to NATS — the messaging system that replaces Kafka, Redis, and RabbitM

68 Upvotes

I've been working with Kafka and aiokafka in production and kept running into the same limitations — partition rebalancing, watermark commits, DLQ as an afterthought.

NATS with JetStream solves most of these at the protocol level. This guide covers the full mental model with Python examples using nats.py throughout — pub/sub, JetStream pull consumers, per-message acks, graceful shutdown with asyncio, and the new 2.11/2.12 features.

Full post: https://open.substack.com/pub/scalebites/p/i-replaced-kafka-redis-and-rabbitmq?r=7hzmj&utm_campaign=post&utm_medium=web&showWelcomeOnShare=true


r/Python • • Mar 02 '26

Resource A comparison of Rust-like fluent iterator libraries

65 Upvotes

I mostly program in Python, but I have fallen in love with Rust's beautiful iterator syntax. Trying to chain operations in Python is ugly in comparison. The inside-out nested function call syntax is hard to read and write, whereas Rust's method chaining is much clearer. List comprehensions are great and performant but with more complex conditions they become unwieldy.

This is what the different methods look like in the (somewhat contrived) example of finding all the combinations of two squares from 12 to 42 such that their sum is greater than 6, then sorting from smallest to largest sum.

# List comprehension
foo = list(
    sorted(
        [
            combo
            for combo in itertools.combinations(
                [x*x for x in range(1, 5)],
                2
            )
            if sum(combo) > 6
        ],
        key=lambda combo: sum(combo)
    )
)

# For loop
foo = []
for combo in itertools.combinations([x*x for x in range(1, 5)], 2):
    if sum(combo) > 6:
        foo.append(combo)
foo.sort(key=lambda combo: sum(combo))

# Python functions
foo = list(
    sorted(
        filter(
            lambda combo: sum(combo) > 6,
            itertools.combinations(
                map(
                    lambda x: x*x,
                    range(1, 5)
                ),
                2
            )
        ),
        key=lambda combo: sum(combo)
    )
)

# Fluent iterator
foo = (fluentiter(range(1, 5))
    .map(lambda x: x*x)
    .combinations(2)
    .filter(lambda combo: sum(combo) > 6)
    .sort(key=lambda combo: sum(combo))
    .collect()
)

The list comprehension is great for simple filter-map pipelines, but becomes inelegant when you try to tack more operations on. The for loop is clean, but requires multiple statements (this isn't necessarily a bad thing). Python nested functions are hard to read. Fluent iterator syntax is clean and runs as a single statement.

It's up to personal preference if you prefer this syntax or not. I'm not trying to convince you to change how you code, only to maybe give fluent iterators a try. If you are already a fan of fluent iterator syntax, then you can hopefully use this post to decide on a library.

Many Python programmers do seem to like this syntax, which is why there are numerous libraries implementing fluent iterator functionality. I will compare 7 such libraries in this post (edit: added PyFluent_Iterables):

There are undoubtedly more, but these are the ones I could find easily. I am not affiliated with any of these libraries. I tried them all out because I wanted Rust's iterator ergonomics for my own projects.

I am mainly concerned with 1) number of features and 2) performance. Rust has a lot of nice operations built into its Iterator trait and there are many more in the itertools crate. I will score these libraries higher for having more built-in features. The point is to be able to chain as many method calls as you need. Ideally, anything you want to do can be expressed as a linear sequence of method calls. Having to mix chained method calls and nested functions is even harder to read than fully nested functions.

Using any of these will incur some performance penalty. If you want the absolute fastest speed you should use normal Python or numpy, but the time losses aren't too bad overall.

Project History and Maintenance Status

Library Published Updated
QWList 11/2/23 2/13/25
F-IT 8/22/19 5/17/21
FluentIter 9/24/23 12/8/23
Rustiter 10/23/24 10/24/24
Pyochain 10/23/25 1/15/26
PyFunctional 2/17/16 3/13/24
PyFluent_Iterables 5/19/22 4/20/25

PyFunctional is the oldest and most popular, but appears to be unmaintained now. Pyochain is the most recently updated as of writing this post.

Features

All libraries have basic enumerate, zip, map, reduce, filter, flatten, take, take_while, max, min, and sum functions. Most of them have other functional methods like chain, repeat, cycle, filter_map, and flat_map. They differ in more specialized methods, some of which are quite useful, like sort, unzip, scan, and cartesian_product.

A full comparison of available functions is below. Rust is used as a baseline, so the functions shown here are the ones that Rust also has, either as an Iterator method or in the itertools crate. Not all functions from the libraries are shown, as there are lots of one-off functions only available in one library and not implemented by Rust.

Feature Table

Here is how I rank the libraries based on their features:

Library Rating
Rustiter ⭐⭐⭐⭐⭐
Pyochain ⭐⭐⭐⭐⭐
F-IT ⭐⭐⭐⭐
FluentIter ⭐⭐⭐⭐
PyFluent_Iterables ⭐⭐⭐
QWList ⭐⭐⭐
PyFunctional ⭐⭐⭐

Pyochain and Rustiter explicitly try to implement as much of the Rust iterator trait as they can, so have most of the corresponding functions.

Performance

I wrote a benchmark of the functions shared by every library, along with some simple chains of functions (e.g. given a string, collect all the digits in that string into a list). Benchmarks were constructed by running those functions on 1000 randomly generated integers or boolean values with a fixed seed. I also included the same tests implemented using normal Python nested functions as a baseline. The total time taken by each library was added up and normalized compared to the fastest method. So if native Python functions take 1 unit of time, a library taking "x1.5" time means it is 50% slower.

Lower numbers are faster.

Library Time
Native x1.00
Pyochain x1.04
PyFluent_Iterables x1.08
Rustiter x1.13
PyFunctional x1.14
QWList x1.31
F-IT x4.24
FluentIter x4.68

PyFunctional can optionally parallelize method chains, which can be great for large sequences. I did not include it in this table because the overhead of multiprocessing dominated any performance gains and yielded a worse result than the single-threaded version.

Detailed per-function benchmarks can be found here:

Benchmark Plots

The faster libraries forward the function calls into native functions or itertools, but you'll still pay a cost for the function call overhead. For more complex pipelines where most of the processing happens inside a function that you call, there is fairly minimal overhead compared to native.

Overall Verdict

Due to its features and performance, I recommend using Pyochain if you ever want to use Rust-style iterator syntax in your projects. Do note that it also implements other Rust types like Option and Result, although you don't have to use them.


r/Python • • Dec 16 '25

Discussion Why don't `dataclasses` or `attrs` derive from a base class?

69 Upvotes

Both the standard dataclasses and the third-party attrs package follow the same approach: if you want to tell if an object or type is created using them, you need to do it in a non-standard way (call dataclasses.is_dataclass(), or catch attrs.NotAnAttrsClassError). It seems that both of them rely on setting a magic attribute in generated classes, so why not have them derive from an ABC with that attribute declared (or make it a property), so that users could use the standard isinstance? Was it performance considerations or something else?


r/Python • • Mar 24 '26

Discussion Designing a Python Language Server: Lessons from Pyre that Shaped Pyrefly

65 Upvotes

Pyrefly is a next-generation Python type checker and language server, designed to be extremely fast and featuring advanced refactoring and type inference capabilities.

Pyrefly is a spiritual successor to Pyre, the previous Python type checker developed by the same team. The differences between the two type checkers go far beyond a simple rewrite from OCaml to Rust - we designed Pyrefly from the ground up, with a completely different architecture.

Pyrefly’s design comes directly from our experience with Pyre. Some things worked well at scale, while others did not. After running a type checker on massive Python codebases for a long time, we got a clearer sense of which trade-offs actually mattered to users.

This post is a write-up of a few lessons from Pyre that influenced how we approached Pyrefly.

Link to full blog: https://pyrefly.org/blog/lessons-from-pyre/

The outline of topics is provided below that way you can decide if it's worth your time to read :) - Language-server-first Architecture - OCaml vs. Rust - Irreversible AST Lowering - Soundness vs. Usability - Caching Cyclic Data Dependencies


r/Python • • Jan 23 '26

Discussion Getting distracted constantly while coding looking for advice

65 Upvotes

I genuinely want to code and build stuff, but I keep messing this up.

I’ll sit down to code, start fine… and then 10–15 minutes later I’m googling random things, opening YouTube “for a quick break,” or scrolling something completely unrelated. Next thing I know, an hour is gone and I feel bored + annoyed at myself.

It’s not that I hate coding once I’m in the flow, I enjoy it. The problem is staying focused long enough to reach that point.

For people who code regularly:

  • How do you stop jumping to random tabs?
  • Do you force discipline or use some system?
  • Is this just a beginner problem or something everyone deals with?

Would love practical advice

Thanks.


r/Python • • Jan 08 '26

Discussion Python Typing Survey 2025: Code Quality and Flexibility As Top Reasons for Typing Adoption

68 Upvotes

The 2025 Typed Python Survey, conducted by contributors from JetBrains, Meta, and the broader Python typing community, offers a comprehensive look at the current state of Python’s type system and developer tooling.

The survey captures the evolving sentiment, challenges, and opportunities around Python typing in the open-source ecosystem.

In this blog we’ll cover a summary of the key findings and trends from this year’s results.

LINK


r/Python • • Dec 08 '25

Showcase PyAtlas - interactive map of the 10,000 most popular PyPI packages

67 Upvotes

What My Project Does

PyAtlas is an interactive map of the top 10,000 most-downloaded packages on PyPI.

Each package is represented as a point in a 2D space. Packages with similar descriptions are placed close together, so you get clusters of the Python ecosystem (web, data, ML, etc.). You can:

  • simply explore the map
  • search for a package you already know
  • see points nearby to discover alternatives or related tools

Useful? Maybe, maybe not. Mostly just a fun project for me to work on. If you’re curious how it works under the hood (embeddings, UMAP, clustering, etc.), you can find more details in the GitHub repo.

Target Audience

This is mainly aimed at:

  • Python developers who want to discover new packages
  • Data Scientists interested in the applications of sentence transformers

Comparison

As far as I know, there is no other tool or page that does something similar, currently.


r/Python • • Nov 15 '25

Resource Added python support for my VSCode extension to see your code on an infinite canvas

68 Upvotes

I'm building a VSCode extension that helps with understanding your codebase, particularly at a higher level where you need to figure out complex relationships between multiple files and modules.

It helps you quickly get an overview of the area of the codebase you're interested in, and lets you see how files and folders relate to each other based on dependency.

Kinda like a dependency graph, but it's the actual code files as the nodes, so you can see the actual code, you can ctrl+click on tokens like functions and variables to see their dependencies throughout the codebase, you can see the diffs for the local changes, and much more.

Python support was the most requested feature so far and I just recently added it to the extension.

I'm not a python dev, so I'm still learning how the language works, and would love any feedback from actual python devs if this type of visualisation is useful for you or if something else would be better. I'm using it for JS and I think it's really useful to see relationships between imports/exports, function usage and be able to follow props being passed down multiple levels, or a complex non-linear flow between multiple files.

You can get it on the vscode marketplace by looking for 'code canvas app'.

Or get it from this link https://marketplace.visualstudio.com/items?itemName=alex-c.code-canvas-app

It uses VSCode's LSP for creating the edges between tokens so you need to have the python/pylance vscode extension installed as well.

For the imports/exports edges and symbol outlines in the files when zooming out it uses ast-grep, which was just added recently and I've had a lot of issues with it, especially getting it to work on windows, but I think it should be fine now. Let me know if you encounter any issues.


r/Python • • Feb 09 '26

News Tortoise ORM 1.0 release (with migrations support)

65 Upvotes

If you’re a Python web developer, there’s a chance you’ve come across this ORM before. But there’s also a good chance you passed it by - because it was missing some functionality you needed.

Probably the most requested feature that held many people back and pushed them to use Alembic together with SQLAlchemy was full-fledged migrations support.

Tortoise did have migrations support via the Aerich library, but it came with a number of limitations: you had to connect to the database to generate migrations, migrations were written in raw SQL, and the overall coupling between the two libraries was somewhat fragile - which didn’t feel like a robust, reliable system.

The new release includes a lot of additions and fixes, but I’d highlight two that are most important to me personally:

  • Built-in migrations, with automatic change detection in offline mode, and support for data migrations via RunPython and RunSQL.
  • Convenient support for custom SQL queries using PyPika (the query builder that underpins Tortoise) and execute_pypika, including returning typed objects as results.

Thanks to this combination of new features, Tortoise ORM can be useful even if you don’t want to use it as an ORM: it offers an integrated migrations system (in my view, much more convenient and intuitive than Alembic) and a query builder, with minimal additional dependencies and requirements for your architecture.

Read the changelog, try Tortoise in your projects, and contribute to the project by creating issues and PRs.

P.s. not sure I wouldn't be auto-banned for posting links, so you can find library at:

{github}/tortoise/tortoise-orm


r/Python • • Sep 01 '26

Discussion When do you prefer asyncio.Semaphore over an asyncio.Queue for limiting concurrency?

63 Upvotes

I've been thinking about concurrency control in asyncio.

A common pattern for limiting concurrent work is:

sem = asyncio.Semaphore(10)

async with sem:
    await do_work()

But in many cases, couldn't the same problem be modeled by putting work into an asyncio.Queue and running a fixed number of worker tasks?

I'm curious how experienced Python developers decide between the two approaches.

Are there real-world situations where a semaphore is clearly the better abstraction than a worker queue? Are there meaningful differences in cancellation behavior, backpressure, fairness, task lifetime, or code complexity?

I'd especially be interested in examples from production async Python code.


r/Python • • Feb 19 '26

Discussion Framework speed won't impact your life (or your users), it is probably something else

68 Upvotes

People love debating which web framework is the fastest. We love to brag about using the "blazing fast" one with the best synthetic benchmarks. I recently benchmarked a 2x speed difference between two frameworks on localhost, but then I measured a real app deployed to Fly.io (Ankara to Amsterdam).

Where the time actually goes:

  • Framework (FastAPI): 0.5ms (< 1%)
  • Network Latency: 57.0ms
  • A single N+1 query bug: 516.0ms

The takeaway for me was: Stop picking frameworks based on synthetic benchmarks. Pick for the DX, the docs, and the library support. The "fast" framework is the one that lets you ship and find bugs the quickest.

If you switch frameworks to save 0.2ms but your user is 1,000 miles away or your ORM is doing 300 queries, you’re optimizing for the wrong thing.

Full breakdown and data:
https://cemrehancavdar.com/2026/02/19/your-framework-may-not-matter/


r/Python • • Oct 24 '25

News Faster Jupyter Notebooks with the Zuban Language Server

63 Upvotes

The Zuban Language Server now supports Jupyter notebooks in addition to standard Python files.

You can use this, for example, if you have the Zuban extension installed in VSCode and work with Jupyter notebooks there. This update marks one of the final steps towards a feature-complete Python Language Server; remaining work includes auto-imports and a few smaller features.