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

    Class VersionResource

    Represents a specific version of a PyPI package.

    Implements PromiseLike<PyPIVersionInfo> so it can be awaited directly.

    // Await directly to get version metadata
    const info = await pip.package('requests').version('2.31.0');

    // Or call .get() explicitly
    const info = await pip.package('requests').version('2.31.0').get();

    // Get distribution files
    const files = await pip.package('requests').version('2.31.0').files();

    Implements

    Index

    Methods

    • Fetches metadata for this version.

      When created via latest(), fetches GET /pypi/{name}/json and returns the latest version data. Otherwise fetches GET /pypi/{name}/{version}/json.

      Parameters

      • Optionalsignal: AbortSignal

        Optional AbortSignal to cancel the request

      Returns Promise<PyPIVersionInfo>

    • Returns the distribution files (wheels, sdists) for this version.

      GET /pypi/{name}/{version}/json → extracts urls

      Parameters

      • Optionalsignal: AbortSignal

        Optional AbortSignal to cancel the request

      Returns Promise<PyPIFile[]>

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

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

      Parameters

      • Optionalsignal: AbortSignal

        Optional AbortSignal to cancel the request

      Returns Promise<PyPIVulnerability[]>

    • Returns the fully resolved dependency graph for this version from deps.dev.

      Unlike requires_dist semver ranges, this returns exact resolved versions for every direct and transitive dependency.

      GET /systems/pypi/packages/{name}/versions/{version}:dependencies (via api.deps.dev/v3)

      When called on latest(), first fetches the project to determine the current version.

      Parameters

      • Optionalsignal: AbortSignal

        Optional AbortSignal to cancel the request

      Returns Promise<PyPIDepsDevDependencies>

      const deps = await pip.package('requests').version('2.31.0').dependencies();
      const direct = deps.nodes.filter(n => n.relation === 'DIRECT');