https://github.com/aescarias/pypiwrap
A Python API wrapper for the Python Package Index
https://github.com/aescarias/pypiwrap
api-wrapper pypi pypi-api python python-library python3
Last synced: 2 months ago
JSON representation
A Python API wrapper for the Python Package Index
- Host: GitHub
- URL: https://github.com/aescarias/pypiwrap
- Owner: aescarias
- License: mit
- Created: 2021-03-14T03:11:45.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-11-19T00:57:02.000Z (7 months ago)
- Last Synced: 2025-11-19T02:31:56.116Z (7 months ago)
- Topics: api-wrapper, pypi, pypi-api, python, python-library, python3
- Language: Python
- Homepage: https://pypiwrap.rtfd.io/
- Size: 120 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# pypiwrap




[Documentation](https://pypiwrap.rtfd.io/) · [PyPI](https://pypi.org/project/pypiwrap) · [Changelog](https://github.com/aescarias/pypiwrap/blob/main/CHANGELOG.md)
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](https://docs.pypi.org/api/json/), the [Statistics API](https://docs.pypi.org/api/stats/), and the [Index API](https://docs.pypi.org/api/index-api/). pypiwrap also parses information from the [PyPI RSS feeds](https://docs.pypi.org/api/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
```py
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
```