npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pyrepl-web

v0.3.0

Published

An embeddable Python REPL powered by Pyodide

Downloads

1,492

Readme

pyrepl-web

An embeddable Python REPL, powered by Pyodide.

Live demo

Getting started

Include the script and use the <py-repl> web component:

<script src="https://cdn.jsdelivr.net/npm/pyrepl-web/dist/pyrepl.js"></script>

<py-repl></py-repl>

That's it! No install needed.

Features

  • Python 3.13 in the browser via WebAssembly (Pyodide)
  • Syntax highlighting powered by Pygments
  • Tab completion for modules, functions, and variables
  • Command history with up/down arrows
  • Smart indentation for multi-line code
  • Keyboard shortcuts: Ctrl+L (clear), Ctrl+C (cancel)
  • PyPI packages: preload popular libraries
  • Startup scripts: run Python on load to set up the environment
  • Theming: built-in dark/light themes or fully custom

Attributes

| Attribute | Description | Default | |-----------|-------------|---------| | theme | Color theme name (builtin or registered via window.pyreplThemes) | catppuccin-mocha | | packages | Comma-separated list of PyPI packages to preload | none | | repl-title | Custom title in the header bar | Python REPL | | src | Path to a Python startup script (see below) | none | | no-header | Hide the header bar (boolean attribute) | not set | | no-buttons | Hide copy/clear buttons in header (boolean attribute) | not set | | readonly | Disable input, display only (boolean attribute) | not set | | no-banner | Hide the "Python 3.13" startup banner (boolean attribute) | not set |

Startup Scripts

Use src to preload a Python script that sets up the environment:

<py-repl src="/scripts/setup.py" packages="pandas"></py-repl>

The script runs silently to populate the namespace. If you define a setup() function, it will be called after loading and its output is visible in the terminal:

# setup.py
import pandas as pd

df = pd.DataFrame({'name': ['Alice', 'Bob'], 'age': [30, 25]})

def setup():
    print("DataFrame loaded:")
    print(df)

Theming

Built-in themes: catppuccin-mocha (dark, default) and catppuccin-latte (light).

Custom Themes

Register custom themes via window.pyreplThemes before loading the script. Only background and foreground are required - everything else is automatically derived:

<script>
window.pyreplThemes = {
  'my-theme': {
    background: '#1a1b26',
    foreground: '#a9b1d6',
  }
};
</script>
<script src="https://cdn.jsdelivr.net/npm/pyrepl-web/dist/pyrepl.js"></script>

<py-repl theme="my-theme"></py-repl>

What gets auto-derived from your background color:

  • Terminal colors (red for errors, green for success, etc.) - from catppuccin-mocha (dark) or catppuccin-latte (light)
  • Syntax highlighting - uses the matching catppuccin Pygments style
  • Header colors - derived from the base theme

Theme Properties

| Property | Description | |----------|-------------| | background | Terminal background color (required) | | foreground | Default text color (required) | | headerBackground | Header bar background (optional) | | headerForeground | Header title color (optional) | | promptColor | Prompt >>> color - hex (#7aa2f7) or name (green, cyan) (optional) | | pygmentsStyle | Custom syntax highlighting (optional, see below) |

Syntax Highlighting

Syntax highlighting uses Pygments. The style is chosen automatically:

  1. If your theme name matches a Pygments style (e.g., monokai, dracula), that style is used
  2. Otherwise, uses catppuccin-mocha for dark backgrounds or catppuccin-latte for light backgrounds

For full control, provide a pygmentsStyle mapping Pygments tokens to colors:

<script>
window.pyreplThemes = {
  'tokyo-night': {
    background: '#1a1b26',
    foreground: '#a9b1d6',
    promptColor: '#bb9af7',
    pygmentsStyle: {
      'Keyword': '#bb9af7',
      'String': '#9ece6a',
      'Number': '#ff9e64',
      'Comment': '#565f89',
      'Name.Function': '#7aa2f7',
      'Name.Builtin': '#7dcfff',
    }
  }
};
</script>