yarg: PyPI Client

0.1.10 · maintenance · verified Sat Apr 11

Yarg is a Python client library designed for programmatically querying the Python Package Index (PyPI). Built on top of the `requests` library, it offers a straightforward interface to retrieve package metadata, including release details, and interact with PyPI's RSS feeds for discovering new and recently updated packages. The current version, 0.1.10, was released in August 2024 primarily for Python 3.12 compatibility, indicating an infrequent release cadence focused on maintenance.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to fetch a specific package's information using `yarg.get()` and how to retrieve a list of the newest packages published to PyPI using `yarg.newest_packages()`.

import yarg

try:
    package = yarg.get("requests")
    print(f"Package Name: {package.name}")
    print(f"Author: {package.author.name} ({package.author.email})")
    print(f"Latest Version: {package.latest_release.version}")
except yarg.exceptions.HTTPError as e:
    print(f"Error fetching package: {e}")

print("\n--- Newest Packages ---")
newest = yarg.newest_packages()
for p in newest[:3]:
    print(f"- {p.name} ({p.version})")

view raw JSON →