Repository navigation
List TailClass and count npm downloads in the profile totals - #3
Merged
Merged
Conversation
Add TailClass to the projects list and the package status section, with npm version/downloads/star badges. Add top badges and Stay Updated links for the PyPI maintainer profile (Infinitode) and the npm org (infinitodeltd). Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Discover npm packages from the public repos the same way PyPI packages are discovered: the repo name lowercased, accepted only when the registry metadata links back to that exact repo or, when the metadata names no GitHub repo at all, the repo's package.json declares the name. Metadata pointing at a different repo always loses (npm 'localshare' style collisions). All-time downloads come from the registry point API, summed over consecutive 540-day windows from the package's first publish day (18 months per query is the API limit, 2015-01-10 is the oldest data). A failed or malformed window raises rather than contributing a partial sum, so the drop guard still works. The shields.io /npm/dt badge is the fallback, and npm now counts toward download_sources and the published total. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related changes: the profile now advertises our npm presence alongside PyPI, and the totals job counts npm downloads instead of ignoring them.
1. README (
profile/README.md)PyPI → View Packages(https://pypi.org/user/Infinitode/) andnpm → View Packages(https://www.npmjs.com/org/infinitodeltd) next to the existing Hugging Face badge.Both accounts were verified live: npm
infinitodeltdis the org that ownstailclass(v1.0.2), and PyPIInfinitodeis "Infinitode Pty Ltd" with 10 projects. Note the deliberate case difference — Infinitode on PyPI, infinitodeltd on npm.2. npm downloads (
scripts/update-download-badges.py)TailClass→tailclass), accepted only when the registry metadata links back to that exact repo (includinggit+https://…/x.gitandgit+ssh://git@…forms) or — only when the metadata names no GitHub repo at all — the repo'spackage.jsondeclares the name. Metadata pointing at a different repo is always rejected.localshare,alloy,blurjs,valx,open-arc,codesafe,cloakjs,scriptify,github). OurLocalSharerepo really does declare"name": "localshare"in itspackage.json, so a naive name match would have credited a stranger's package.time.created), floored at 2015-01-10, which is npm's oldest data. TailClass is 4 days old, so that is a single request:…/point/2026-11-08:2026-11-11/tailclass./npm/dtbadge (documented as a possible undercount, since shields caps its range).download_sourcesand the published total; the job summary printspackage … -> npm/tailclassand per-package counts.Testing
python3 -m unittest discover -s scripts -p 'test_*.py'), including new coverage for ownership and the collision case,package.jsonfallback,time.createdparsing, lifetime-bounded windows (contiguous, ≤540 days, clamped to the floor), the raises-instead-of-undercounting case, shields fallback, and an end-to-end badge rewrite that now includes npm.Infinitode/TailClass → npm/tailclass).api.npmjs.orgis unreachable from my sandbox, so the exact download fetch is covered by tests against the documented response shape; the drop guard means the first scheduled run cannot publish a bad number.Existing behaviour is untouched: stars/forks, PyPI counting, jsDelivr, the README rewrite and the
--dry-run/--allow-decreaseflags all work as before.