Pyrfecter logo Pyrfecter

Lint, format, and modernize your Python code to make it positively perfect.

About Pyrfecter

Pyrfecter, a portmanteau of "Python" and "perfecter", is two things:

  1. An easy-to-use tool that's simple enough for a brand new Pythonista but powerful enough for a seasoned vet
  2. An excuse to play with Pyodide, which uses WebAssembly to run Python directly in your browser

Pyodide logo
Pyodide logo

It's a little side-project of John Franey, so, uh, hi!

How it works

Pyodide and WebAssembly do the heavy lifting of running Python in the browser. Pyrfecter stitches together different Python code linters, formatters, and converters and runs your code them in an order that makes sense:

  1. Perform code modifications (formatting, converting)
  2. Lint & analyze the modified code

For a more technical description, Pyrfecter is a Python package that provides a pyrfect_code function to modify and analyze your code:

from js import code
from pyrfecter import pyrfect_code


The from js import code is some Pyodide magic that passes your code from the textarea element into Python so it can pass through Pyrfecter's Python code.

The pyrfect_code() function runs the linting, formatting, and fixing utilities on the code entered into the editor included in most pages on the site. Huh. But not this one. Should I add it? Maybe I should add it.