Skip to content

aescarias/pypiwrap

Repository files navigation

pypiwrap

PyPI - Downloads per week PyPI - Latest Release PyPI - Supported Python Versions GitHub - License

Documentation · PyPI · Changelog

pypiwrap is an API wrapper for the Python Package Index (PyPI) providing interfaces for retrieving project information, releases and statistics from the PyPI JSON API, the Statistics API, and the Index API. pypiwrap also parses information from the PyPI RSS feeds.

Installation

pypiwrap requires Python 3.9 or later and can be installed with pip:

  • python3 -m pip install pypiwrap (Linux/Mac)
  • py -3 -m pip install pypiwrap (Windows)

Examples

import pypiwrap

# Fetching data from the PyPI API
with pypiwrap.PyPIClient() as pypi:
    project = pypi.get_project("requests")

    print(project.name)  # requests
    print(project.author)  # Kenneth Reitz
    print(project.summary)  # Python HTTP for Humans.

    stats = pypi.get_stats()
    print(stats.total_size.si)  # 24.61 TB


# Fetching data from the Index API
with pypiwrap.SimpleRepoClient() as repo:
    page = repo.get_project_page("requests")
    
    print(page.files[-1].url)  # https://files.pythonhosted.org/packages/63/70/[...]
    print(page.files[-1].size.si)  # 131.22 KB


# Fetching data from the RSS feeds
with pypiwrap.PyPIFeedClient() as rss:
    feed = rss.get_newest_packages()

    print(feed.title)  # PyPI newest packages

    for item in feed.items:
        print(item.title)  # ... added to PyPI

About

A Python API wrapper for the Python Package Index

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages