Skip to content
Back to top
View this page

# twine.repository module

class twine.repository.Repository
  __init__(repository_url: str, username: str | None, password: str | None, disable_progress_bar: bool = False) → None
  close() → None
  static _convert_metadata_to_list_of_tuples(data: PackageMetadata) → List[Tuple[str, Any]]
  set_certificate_authority(cacert: str | None) → None
  set_client_certificate(clientcert: str | None) → None
  register(package: PackageFile) → Response
  _upload(package: PackageFile) → Response
  upload(package: PackageFile, max_redirects: int = 5) → Response
  package_is_uploaded(package: PackageFile, bypass_cache: bool = False) → bool

    Determine if a package has been uploaded to PyPI already.

    Warning

    This does not support indexes other than PyPI or TestPyPI

    Parameters:

      - package (`PackageFile`) – The package file that will otherwise be uploaded.

      - bypass_cache (bool) – Force a request to PyPI.

    Returns:

      True if package has already been uploaded, False otherwise

    Return type:

      bool

  release_urls(packages: List[PackageFile]) → Set[str]
  verify_package_integrity(package: PackageFile) → None