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

@anvil-works/python-stubs

v0.1.0-canary.1

Published

Curated Python library typing packs for Anvil analysis

Readme

Anvil Python typing packs

Maintainer reference for the curated third-party typing data used by Anvil's server analysis. The npm package supplies static declaration maps and a manifest. It has no dependency on a particular Python checker and does not install Python libraries. Anvil's own API declarations remain in the Anvil repository.

The S3 delivery proposal describes a future hosting and publishing path, including the administrator work required. It does not change the current NumPy/pandas packaging or IDE integration.

Build and package

Use pnpm and Python 3.12 or later:

pnpm install --frozen-lockfile
pnpm build
pnpm test
pnpm pack --pack-destination .packages

pnpm build recreates dist/. It downloads the pinned wheels as ZIP archives, verifies their SHA-256 checksums, and extracts declarations without importing or executing their code. Verified downloads are cached under .cache/wheels/. Subsequent builds can use that cache offline. Both the cache and generated output are ignored by Git. The published package includes dist/ and third-party notices; consumers need neither Python nor the wheel downloads.

pnpm pack runs the build first. The tests install the resulting tarball into a clean consumer, verify the declaration contents and licence texts, and reject a modified wheel cache. CI uploads the installable tarball without publishing it.

Catalogue

catalogue.json owns the inputs:

  • sources identifies the exact wheel URLs, archive checksums, source versions, import directories, Python requirements and licences.
  • Each packs entry names a runtime distribution (id), the runtime version used to validate and select it (version), its source archives and other required packs.
  • recipe: "numpy" retains NumPy's public stubs and the typed source helpers they import. Other current packs combine their listed declarations directly.

The typing-source version can differ from the runtime version: pandas-stubs is a source for the pandas runtime pack. Import names are derived from the extracted files and can differ from the distribution name.

The current profiles target dynamic downlinks running NumPy 2.5.4 and pandas 3.1.0. The catalogue is the authoritative version list; deprecated Full Python bundles do not determine the selected snapshots.

NumPy supplies its own matching declarations. The latest public pandas-stubs source is 3.0.5.260914. Its common DataFrame/Series APIs are checked against pandas 3.1.0, but this does not establish coverage of every new pandas 3.1 API. Preserve that source version in provenance rather than presenting it as a 3.1 stub release.

To update a profile, change its pinned sources and runtime version, rebuild, review the declaration changes and upstream licences, and update the expected content hashes in test/expected.json. Those hashes pin the reviewed declaration contents; changes require deliberate review. Use the browser consumer's semantic tests and completion performance gates before adopting a changed profile.

Package interface

Resolve @anvil-works/python-stubs/manifest.json. Its packs array contains:

| Field | Meaning | | --- | --- | | id | Runtime distribution name used for requirements matching. | | version | Runtime version used to validate and select this profile. | | modules | Top-level Python import names provided by the pack. | | dependencies | IDs of other required packs. | | url | Declaration-map asset path, relative to the manifest. | | sha256 | SHA-256 of the asset bytes; also present in its filename. | | files, bytes | Declaration count and uncompressed asset size. |

Each asset is a UTF-8 JSON object mapping relative Python paths to source text. It includes .pyi declarations and required typed .py helpers. sources in the manifest records the input archives; full licence texts live alongside it under LICENSES/. The consumer copies assets into its own static hosting and owns requirements matching, environment isolation and lazy loading.

A profile describes one known API version. A permissive requirement is not proof of the installed runtime version. Selection and unsupported-version policy belong to the consumer; package generation does not resolve an app's environment.

Publication

The Ty browser build consumes an exact npm version of @anvil-works/python-stubs. Publish the reviewed stub archive before the browser package so a clean browser build can install it without a sibling checkout.

For the current canary, build and test first:

pnpm install --frozen-lockfile --ignore-scripts
pnpm test
pnpm pack --pack-destination .packages

Publish that exact archive, preserving the bytes reviewed and pinned by the browser build:

npm publish .packages/anvil-works-python-stubs-0.1.0-canary.1.tgz --tag canary --access public --registry https://registry.npmjs.org

Use the canary tag; this release does not update latest. The browser package includes the selected declarations and notices, so IDE users do not install this package themselves. S3 delivery remains separate future work.