# jmcarp/nplusone

Auto-detecting the n+1 queries problem in Python

Repository: https://github.com/jmcarp/nplusone
Canonical: https://ross.abutalabs.com/products/nplusone
Language: Python
License: MIT
License Family: permissive
Last push: 2022-11-25T10:57:53+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4096, "days_push": 1377, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1068, forks 54 (observed 2026-08-28T04:03:27.578231+00:00)

## What it is
nplusone is a Python library that detects the n+1 queries problem in ORMs like SQLAlchemy, Peewee, and the Django ORM by monitoring lazy loads and warning about inefficient queries. It also flags inappropriate eager loading and points to the offending model attribute and code line.

## Use cases
- detect n+1 query problems in a Django app
- find inefficient lazy loading in SQLAlchemy code
- profile ORM query performance during development
- identify unused eager loading in Flask-SQLAlchemy
- get recommendations for select_related and prefetch_related

## When to choose
- you use Django, SQLAlchemy, or Peewee and suspect slow queries from lazy loading
- you want development-time ORM profiling with actionable warnings

## When to avoid
- you need a production monitoring tool - it is meant for development only
- your project uses an ORM other than Django, SQLAlchemy, or Peewee
- you need actively maintained tooling - the latest release was in 2022

## Facets
- artifact type: library
- maturity: maintenance
- function: monitoring, logging, orm, database, testing
- domain: databases, performance, developer-tools, web-development
- platform: python
- tags: n-plus-one-queries, orm-profiling, lazy-loading, eager-loading, sqlalchemy, django-orm, peewee, performance-diagnostics

## Member repositories
- jmcarp/nplusone (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:27.578231+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:54:42.781042+00:00, confidence not recorded.
  - readme: https://github.com/jmcarp/nplusone (fetched 2026-08-28T04:03:27.578231+00:00, sha bf3f3c8a7f75)
  - registry_pypi: https://pypi.org/pypi/nplusone/json (fetched 2026-08-29T12:57:03.759549+00:00, sha 3f3bbb372a8d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
