{"id":7599,"library":"pypi-simple","title":"PyPI Simple Repository API Client","description":"pypi-simple is a client library for the Python Simple Repository API, as specified in PEP 503 and updated by various other PEPs (592, 629, 658, 691, 700, 708, 714, 740, 792). It allows users to query PyPI and other pip-compatible repositories for available projects and their package files, download packages, and inspect their metadata. The current version is 1.8.0. While no explicit release cadence is stated, the project maintains regular updates, with version 1.8.0 released on September 3, 2025.","status":"active","version":"1.8.0","language":"en","source_language":"en","source_url":"https://github.com/jwodder/pypi-simple","tags":["pypi","packaging","api client","pep 503"],"install":[{"cmd":"pip install pypi-simple","lang":"bash","label":"Basic Installation"},{"cmd":"pip install \"pypi-simple[tqdm]\"","lang":"bash","label":"Installation with tqdm for progress bars"}],"dependencies":[{"reason":"Provides progress bar functionality for downloads.","package":"tqdm","optional":true}],"imports":[{"symbol":"PyPISimple","correct":"from pypi_simple import PyPISimple"},{"note":"Required when installing with the 'tqdm' extra for progress bar integration.","symbol":"tqdm_progress_factory","correct":"from pypi_simple import PyPISimple, tqdm_progress_factory"}],"quickstart":{"code":"from pypi_simple import PyPISimple\n\n# Example 1: Get information about a package\nwith PyPISimple() as client:\n    requests_page = client.get_project_page('requests')\n    if requests_page and requests_page.packages:\n        pkg = requests_page.packages[0]\n        print(f\"Latest 'requests' package: {pkg.filename} (version {pkg.version})\")\n        print(f\"Download URL: {pkg.url}\")\n\n# Example 2: List all project names (caution: this can be slow and large)\n# try:\n#     with PyPISimple() as client:\n#         # PyPI's top-level simple HTML page is cached for 24 hours.\n#         # Use stream_project_names() for potentially faster, memory-efficient retrieval.\n#         all_projects = list(client.stream_project_names())\n#         print(f\"Found {len(all_projects)} projects.\")\n# except Exception as e:\n#     print(f\"Error listing projects: {e}\")","lang":"python","description":"This quickstart demonstrates how to fetch details for a specific project like 'requests' using `PyPISimple.get_project_page()`. It also includes a commented-out example for streaming all project names using `stream_project_names()`, with a caution about the size of PyPI's index."},"warnings":[{"fix":"Avoid relying on `provenance_sha256`. Use `provenance_url` if provenance information is needed.","message":"The `DistributionPackage.provenance_sha256` attribute is deprecated and will always be `None`.","severity":"deprecated","affected_versions":">=1.6.0"},{"fix":"If provenance digest verification is critical, implement it separately after fetching the provenance data.","message":"The `verify` argument in `PyPISimple.get_provenance()` is deprecated, and the method no longer verifies the provenance's digest.","severity":"deprecated","affected_versions":">=1.6.0"},{"fix":"Ensure your environment uses Python 3.8 or higher.","message":"Support for Python 3.7 was dropped in version 1.6.0.","severity":"breaking","affected_versions":">=1.6.0"},{"fix":"For specific project information, use `client.get_project_page('projectname')`. If you need to iterate through all projects, use `client.stream_project_names()` for better performance and memory management.","message":"Calling `PyPISimple.get_index_page()` (which returns a list of all projects) can be very slow due to the size of PyPI's index. PyPI's top-level simple HTML page is also cached for 24 hours.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure the import path is exactly `from pypi_simple import PyPISimple`.","cause":"Typo in the import statement or trying to import from an incorrect module.","error":"ImportError: cannot import name 'PyPISimple' from 'pypi_simple'"},{"fix":"Always check if the result of `get_project_page()` is `None` before attempting to access its attributes (e.g., `if project_page and project_page.packages:`).","cause":"The `get_project_page()` method returned `None`, indicating that the project name was not found or there was an issue fetching the page.","error":"AttributeError: 'NoneType' object has no attribute 'packages'"},{"fix":"This often points to a problem with the repository or download. You can try downloading again. If it persists, report it to the package maintainers or the repository. The exception object itself might contain `url` fields for more details.","cause":"The downloaded package file's digest (e.g., SHA256) does not match the one advertised by the repository, indicating possible corruption or tampering.","error":"PyPISimple.exceptions.DigestMismatchError: Digest mismatch for ..."}]}