pypi-simple version 0.8.0 DistributionPackage' object has no attribute 'get_digest'

可紊 提交于 2021-02-11 12:57:11

问题


for some reasons pip search stopped working:

error using pip search (pip search stopped working) ,github pip search issue

error messagge pointed me to pypi-simple (pypi-simple is a client library for the Python Simple Repository API) link here

using pypi-simple to search for a package: as an example PDBx


!/usr/bin/env python3
 -*- coding: utf-8 -*-
"""
Created on Thu Nov  11 17:40:03 2020

@author: Pietro

"""


from pypi_simple import PyPISimple

def simple():
    package=input('\npackage to be checked ')
    
    try:
        with PyPISimple() as client:
            requests_page = client.get_project_page(package)
    
    except:
        print("\n SOMETHING WENT WRONG !!!!! \n\n",
        "CHECK INTERNET CONNECTION OR DON'T KNOW WHAT HAPPENED !!!\n")
        
    pkg = requests_page.packages[0]
    
    print(pkg)
    print(type(pkg))
    
    print('\n',pkg,'\n')

    print('\n'+pkg.filename+'\n')
    
    print('\n'+pkg.url+'\n')
    
    print('\n'+pkg.project+'\n')
    
    print('\n'+pkg.version+'\n')
    
    print('\n'+pkg.package_type+'\n')
    
    print('\n'+pkg.get_digest()+'\n','ENDs HERE !!!!')
     

if __name__ == '__main__': 
  
   simple()

I get:

Traceback (most recent call last):
  File "./simple.py", line 82, in <module>
    simple(args.package)
  File "./simple.py", line 55, in simple
    print('\n'+pkg.get_digest()+'\n','ENDs HERE !!!!')
AttributeError: 'DistributionPackage' object has no attribute 'get_digest'

when looking for DistributionPackage.get_digest()

Any reason about that ?

https://pypi.org/project/pypi-simple/

page for 0.8.0 version is less documented than 0.6.0

https://pypi.org/project/pypi-simple/0.6.0/

has the get_digest() attribute been removed ? or else ?

来源:https://stackoverflow.com/questions/65324724/pypi-simple-version-0-8-0-distributionpackage-object-has-no-attribute-get-dige

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!