Files
wehub-resource-sync 9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:39:48 +08:00

63 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# PyPI
**Mode**: 🌐 Public · **Domain**: `pypi.org` (+ `pypistats.org` for download stats)
Inspect Python packages on the Python Package Index. Two commands: registry metadata for one package and download stats over a recent or historical window.
## Commands
| Command | Description |
|---------|-------------|
| `opencli pypi package <name>` | Single PyPI package metadata (latest version, summary, repo, license, release timeline) |
| `opencli pypi downloads <name>` | Download stats from pypistats.org (recent totals or daily history) |
## Usage Examples
```bash
# Single-package metadata
opencli pypi package requests
opencli pypi package fastapi
# Download stats — three rows (last-day / last-week / last-month) totals
opencli pypi downloads requests --period recent
# Daily history for ~180 days (pypistats default window)
opencli pypi downloads requests --period overall
# JSON output
opencli pypi package requests -f json
```
## Output Columns
| Command | Columns |
|---------|---------|
| `package` | `name, latestVersion, summary, author, license, homepage, repository, requiresPython, keywords, releases, firstReleased, lastReleased, url` |
| `downloads` | `rank, package, period, date, downloads` |
## Options
### `package`
| Option | Description |
|--------|-------------|
| `name` (positional) | PyPI package name (e.g. `requests`, `numpy`). Validates 164 chars and PyPI's naming rule. |
### `downloads`
| Option | Description |
|--------|-------------|
| `name` (positional) | PyPI package name |
| `--period` | `recent` (3-row totals: last_day / last_week / last_month) or `overall` (daily history). Default: `recent`. |
## Caveats
- pypistats only goes back ~180 days for `overall`; older history is not exposed.
- `requires_python` reflects the latest release's metadata; older releases may declare different ranges.
- `firstReleased` / `lastReleased` are computed from the full release index, so they reflect the upload time of the earliest / latest **uploaded file**, not necessarily the version listed under `latestVersion`.
- `--period` is validated upfront — `recent` or `overall` only; anything else raises `ArgumentError`.
## Prerequisites
- No browser required — uses `pypi.org/pypi/<pkg>/json` and `pypistats.org/api/packages/<pkg>/...`.