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

pystd

v0.3.0

Published

Python standard-library modules compiled as WebAssembly components

Downloads

410

Readme

pystd

Typed, production-oriented WebAssembly Component Model builds of selected Python standard-library modules.

Each module is an npm subpath backed by one shared componentized Python runtime. Applications that use multiple modules download and initialize CPython only once.

Requirements

  • Node.js 22.12 or newer
  • uv 0.11 or newer (development only)
  • A runtime with WebAssembly Component Model output supported by jco

Usage

import { hashlib, itertools, math, random } from "pystd";

console.log(math.factorial(10n));
console.log(hashlib.sha256(new TextEncoder().encode("hello")).hexdigest(undefined));
console.log(itertools.combinations(new BigInt64Array([1n, 2n, 3n]), 2));
random.seed(42n);
console.log(random.random());

Direct module subpaths remain available:

import { factorial, sqrt } from "pystd/math";
import { sha256 } from "pystd/hashlib";

console.log(factorial(10n));
console.log(sqrt(2));
console.log(sha256(new TextEncoder().encode("hello")).hexdigest(undefined));

Additional modules use the same package and runtime, for example import { combinations } from "pystd/itertools". pystd/random provides CPython-compatible seeded pseudo-random generation; it is not a cryptographic entropy source.

Portable typed subpaths also cover numeric values (statistics, fractions, decimal), binary transforms (hmac, base64, binascii), finite collections (bisect, heapq), text and structured data (string, textwrap, csv, json, html, urllib-parse), and explicit dates and identifiers (datetime, calendar, uuid). See the support matrix for representation and host-capability boundaries.

Integer-valued math APIs use signed 64-bit bigint values at the WIT boundary. Python integers outside that range are not representable in this release.

hashlib.file_digest is exported as fileDigest, but throws NotImplementedError because arbitrary Python file-like objects cannot cross a typed WIT boundary. SHAKE hashes require an explicit digest length; fixed-size hashes require undefined.

Development

vp install
uv python install
vp run build
vp run size:snapshot
vp test
vp check
vp run docs:dev

.python-version pins the CPython reference runtime to 3.14.6. Parity tests launch it through uv run, so they do not depend on the shell's ambient python or python3.

The adapter source is generated deterministically from api/adapters.json. Vitest file snapshots lock the generated Python glue. Builds use componentize-py 0.25.0 and jco 1.26.1, optimize for size with wasm-opt, stub unused WASI imports, and enforce an 18 MiB uncompressed shared-runtime budget. tests/fixtures/size-snapshot.json records gzip production output and prevents unnoticed size regressions.