Skip to content
PluginStats

prettier-plugin-python weekly downloads statistics

By virmwebsites · npm · Prettier plugins

Prettier plugin for Python using Prettier's plugin API (tree-sitter WASM parser + Doc printer).

View on npm Fresh · Dec 6, 2026

prettier-plugin-python has 36 recorded weekly downloads on npm, a change of -18.2% over the past 7 days, ranking #2852 of 3,247 tracked listings.

Weekly downloads
36
Official API · Dec 5, 2026
7-day growth
-18.2%
-8 weekly downloads
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#2852
▼ 208 in 7 days

About prettier-plugin-python

prettier-plugin-python

A Prettier plugin for Python that parses and formats Python code using Prettier’s public plugin API.

  • Parser: web-tree-sitter with the tree-sitter-python grammar (bundled as WASM) to parse Python source.
  • Printer: walks the syntax tree and emits Prettier Doc IR (group, indent, line/hardline, join, etc.) so Prettier’s engine produces formatted output.
  • Plugin API: exports languages, parsers, and printers per the Prettier plugin docs.
  • No external Python formatter/runtime required.

Status: Best-effort implementation covering core Python constructs (modules, imports, function/class definitions, decorators, parameters/arguments, control flow, try/except/finally, with, match/case, expressions, calls/attributes/subscripts, collections, assignments, and more). Some constructs may fall back to source-preserving/generic printing. Printer coverage can be extended in src/printer.js.

Requirements

Install

From GitHub
npm install --save-dev github:virmwebsites/Prettier-Python prettier

Or clone/install locally:

git clone https://github.com/virmwebsites/Prettier-Python.git
cd Prettier-Python
npm install
From npm
npm install --save-dev prettier-plugin-python prettier

Note: the npm package name prettier-plugin-python may be unavailable; if so, install from GitHub or use the published package name for this repo.

Usage

CLI
# using the plugin from this repo/path
npx prettier --plugin ./src/index.js --write "**/*.py"

# check formatting
npx prettier --plugin ./src/index.js --check "**/*.py"

When installed as a dependency/configured by name:

npx prettier --plugin prettier-plugin-python --write "**/*.py"
Prettier config

prettier.config.mjs:

export default {
  plugins: ["prettier-plugin-python"],
  // or a local/path install:
  // plugins: ["./path/to/Prettier-Python/src/index.js"],
};
Programmatic API
const prettier = require("prettier");
const plugin = require("prettier-plugin-python");
// or: const plugin = require("./src/index.js");

const formatted = await prettier.format(source, {
  parser: "python",
  plugins: [plugin],
});
Editor (format on save)
  1. Install/configure Prettier for your editor (e.g. VS Code “Prettier - Code formatter”).
  2. Ensure this plugin is loaded (via Prettier config plugins as above).
  3. Set Prettier as the default formatter for Python and enable format on save, for example (VS Code settings.json):
    {
      "[python]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode",
        "editor.formatOnSave": true
      }
    }
    
    If another Python formatter is set as default for [python], switch the default formatter to Prettier.

Project structure

  • src/index.js — plugin entry (languages, parsers, printers)
  • src/parser.js — async tree-sitter (WASM) parser integration, locStart/locEnd
  • src/printer.js — AST/CST-to-Prettier-Doc printer
  • src/wasm/tree-sitter-python.wasm — bundled Python grammar

Development

npm install
node -e "require('./src')"

To try formatting locally:

npx prettier --plugin ./src/index.js path/to/file.py

Publishing notes

  • Repository: https://github.com/virmwebsites/Prettier-Python
  • npm publish (maintainers):
    1. Ensure package.json name is available on npm (or use a scoped name, e.g. @virmwebsites/prettier-plugin-python) and metadata/version are correct.
    2. npm login
    3. npm publish --access public
  • Versioning: bump with npm version patch|minor|major, then publish and push tags/commits.
  • GitHub install: consumers can install directly via npm install github:virmwebsites/Prettier-Python (runtime files including src/wasm are committed).

License

MIT — see LICENSE.

Description from the npm listing.

  • prettier
  • prettier-plugin
  • python
  • formatter
  • tree-sitter
  • web-tree-sitter

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

prettier-plugin-python weekly downloads on npm, last 90 days: 36 weekly downloads as of Dec 5, 2026.prettier-plugin-pythonWeekly downloads on npm · Last 90 days36downloads / week050100150200250300350400Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
prettier-plugin-python weekly downloads on npm, last 90 days: 36 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

prettier-plugin-python weekly downloads growth on npm: -18.2% over 7 days, 30-day growth unavailable, 90-day growth unavailable.prettier-plugin-pythonWeekly downloads growth on npm36downloads / week now7-day growth-8 weekly downloads-18.2%30-day growth+36 weekly downloadsInsufficient history90-day growth+36 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-python weekly downloads growth on npm: -18.2% over 7 days, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

prettier-plugin-python npm ranking history: currently #2852 (by weekly downloads).prettier-plugin-pythonnpm ranking · by weekly downloads · Last 90 days#2852current rank#1800#2000#2200#2400#2600#2800#3000Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankNov 24, 2026 – Dec 6, 2026 · 13 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-python npm ranking history: currently #2852 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 143, #14 (overall #2,854)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 7, #16 (overall #136)
Prettier plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (128)
Recent weekly downloads observations for prettier-plugin-python
Date (UTC)Weekly downloadsChange vs. previous
36+10
26-5
31-4
35+1
34-6
40-3
43-1
44-4
48+4
44-4
48-6
54-34
88-286
374—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-python alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/prettier-plugin-python. First seen Nov 24, 2026; last successful collection Dec 6, 2026. See the methodology.