Package Name Format
Python packages should be specified by their PyPI name:django- Popular web frameworknumpy- Scientific computing libraryFlask- Micro web framework (case-insensitive)
Configuration Options
The Python provider supports the following extra options:maxReleases
Type: numberDefault:
3Minimum:
1Maximum:
10 (clamped)
Number of recent releases to track, sorted by publication date.
Complete Example
API Endpoints
The Python provider uses the PyPI JSON API:Get Package Data
server/providers/python/types.ts:28-32
Package Output Format
The Python provider returns packages in this format:Owner Extraction
The provider attempts to extract the owner from multiple sources:server/providers/python/index.ts:11-21
Fallback order:
- GitHub username from
project_urls.Source - GitHub username from
home_page - Package
authorfield undefinedif none available
- Source URL:
https://github.com/psf/requests - Extracted owner:
psf
server/providers/python/index.ts:42-43
Source URL Resolution
Source URLs are extracted from PyPI metadata:server/providers/python/index.ts:42
Priority:
info.project_urls.Source- Explicit source URLinfo.home_page- Homepage (often points to repository)undefined- No source URL available
Release Processing
Releases are processed by extracting upload times and sorting chronologically:server/providers/python/index.ts:59-84
Process:
- Iterate through all versions in
releasesobject - Extract upload time from first file in each version
- Filter out versions without upload times
- Sort by upload time (newest first)
- Take first N releases (based on
maxReleases) - Convert to
PackageReleaseobjects
Upload Time Selection
Each PyPI release version can have multiple distribution files (wheels, source distributions, etc.). The provider uses the upload time from the first file:server/providers/python/index.ts:62-64
Max Releases Clamping
ThemaxReleases value is clamped to a maximum of 10:
server/providers/python/index.ts:55-56
Behavior:
- Default:
3(from provider defaults) - If not specified:
5 - If specified: clamped to minimum 1, maximum 10
- If invalid (NaN, Infinity): fallback to
5
Error Handling
Invalid Package Name
Occurs when:- Package name is empty or whitespace only
server/providers/python/index.ts:33-34
Package Not Found (404)
Occurs when:- Package doesn’t exist on PyPI
- Package name is misspelled
- Package was removed from PyPI
server/providers/python/client.ts:29-30
Network Error
Occurs when:- PyPI is unreachable
- Request times out
- Other HTTP errors (non-404)
server/providers/python/client.ts:32-36
Implementation Details
Client Layer
The Python client (PythonClient) provides one method:
server/providers/python/client.ts:11-16
Type Definitions
PyPIResponse:server/providers/python/types.ts:28-32
PyPIInfo:
server/providers/python/types.ts:16-26
PyPIReleaseFile:
server/providers/python/types.ts:3-14
Provider Info
shared/providers/python.ts:5-16
URL Encoding
Package names are URL-encoded when making API requests:server/providers/python/client.ts:21-22
This ensures special characters in package names are properly handled.
Package URL Format
Package URLs follow the PyPI project URL format:https://pypi.org/project/requests/https://pypi.org/project/Django/https://pypi.org/project/numpy/
server/providers/python/index.ts:9 and index.ts:49
Yanked Releases
The provider currently includes yanked releases in the response. PyPI marks releases as “yanked” when they have critical bugs or security issues, but they remain available. Theyanked field is available in the PyPIReleaseFile type but not currently filtered:
server/providers/python/types.ts:12-13
Caching
Python provider requests are cached using the standard Shipped cache:- Cache key includes: package name and configuration hash
- Full PyPI response (including all releases) is cached
- Release sorting happens on cached data
Version History
Current version:1
Source: server/providers/python/index.ts:28