jk_pypiorgapi
Introduction
This python module provides an API for accessing Python packet information hosted on pypi.org.
Information about this module can be found here:
Why this module?
Apparently quite some people would like to retrieve information from pypi.org. As I was not able to find a suitable package quickly that already implemented
such behavior I decided to implement an own one and provide it publically.
How to use this module
Import this module
Please include this module into your application using the following code:
import jk_pypiorgapi
Instantiate the API object
In order to access the API you have to instantiate an API object. This is done as shown here:
api = jk_pypiorgapi.PyPiOrgAPI()
NOTE: The reason behind that is simple: Code flexibility.
This way modifications and extensions will be possible if some things change with pypi.org.
So please first instantiate an API object, then you can use it.
List existing packages
If you want to access a list of all packages hosted on pypi.org, you can use this method:
packageNames = api.listAllPackages()
Please be aware that invoking this method is expensive. The reason why calling is method is expensive is that the package index nowadays has over 16 MBytes in size.
Please use this method wisely to avoid server load on pypi.org and do not download the package index too frequently!
List existing packages
If you want to retrieve information about a certain package hosted on pypi.org, you can use this method:
jData = api.getPackageInfoJSON("jk_pypiorgapi")
This will look up the package jk_pypiorgapi and retrieve all information about it as a JSON data structure. This method directly provides the information pypi.org provides
via its API.
NOTE: For experimenting you might want to display this data in an easy way. jk_json provides a convenience method named prettyPrint() for that purpose:
import jk_json
jk_json.prettyPrint(jData)
Dependencies
This module has the following dependencies:
- bs4 for HTML parsing
- jk_furl for more convenient URL handling
- jk_prettyprintobj for pretty printing objects for debugging
Author(s)
- Jürgen Knauth: pubsrc@binary-overflow.de
License
This software is provided under the following license:
- Apache Software License 2.0
Metadata
Release files for jk-pypiorgapi 0.2022.6.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jk_pypiorgapi-0.2022.6.13.tar.gz | 12.5 kB | Details |
Release files / jk_pypiorgapi-0.2022.6.13.tar.gz
| Download URL | jk_pypiorgapi-0.2022.6.13.tar.gz |
|---|---|
| Size | 12.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
357153eb15608980f7fc98e3f38cbed51eac848ab69701703eec9446e8c14ade
|
|
BLAKE2b-256 checksum How to use checksums |
d215a921f4b7a916082b26f138b50f7d35980f478321f95cdbda53e1ffef934f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.26.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.10
|