PyPI API Client - v1.0.0
    Preparing search index...

    Class PackageResource

    Represents a PyPI project, providing access to metadata, versions, distribution files, download statistics, and vulnerability data.

    Implements PromiseLike<PyPIProject> so it can be awaited directly to fetch the full project, while also exposing sub-resource methods.

    // Await directly to get full project metadata
    const project = await pip.package('requests');

    // Get the info block
    const info = await pip.package('requests').info();

    // Get a specific version
    const v = await pip.package('requests').version('2.31.0');

    // Get download stats
    const stats = await pip.package('requests').downloads();

    Implements

    Index

    Methods

    • Returns all version strings published for this package.

      GET /pypi/{name}/json → extracts Object.keys(releases)

      Parameters

      • Optionalsignal: AbortSignal

        Optional AbortSignal to cancel the request

      Returns Promise<string[]>

    • Returns the full releases map: version string → distribution files.

      GET /pypi/{name}/json → extracts releases

      Parameters

      • Optionalsignal: AbortSignal

        Optional AbortSignal to cancel the request

      Returns Promise<Record<string, PyPIFile[]>>

    • Returns known vulnerabilities for the latest version from PyPI's advisory database.

      GET /pypi/{name}/json → extracts vulnerabilities

      Parameters

      • Optionalsignal: AbortSignal

        Optional AbortSignal to cancel the request

      Returns Promise<PyPIVulnerability[]>