开放ean/gtin数据库的非正式api包装
openean的Python项目详细描述
打开
库以使用open ean/gtin数据库的api
用作this EAN/GTIN database service的api的api包装器
开始
通过pip install openean
从pypi安装库
那么您需要服务的用户id;more info how you get that
还有一个小测试的id:“400000000”,如这里所描述的https://opengtindb.org/faq.php#g
fromopenean.OpenEANimportOpenEANuserID=400000000#user your own id hereopenean=OpenEAN(userID)barcode_num=1111#barcode number of you productitems=openean.parse(barcode_num)#items is a list of possible products associated with the code# the properties of each item are described here https://opengtindb.org/api.php#only to show you structure of working results#not needed for usefrompprintimportpprintforiteminitems:pprint(vars(item))
感谢
使这成为可能的api的创建者,如果您希望此服务帮助运行它的数据库的创建者,请考虑捐赠给"Kueste gegen Plastik"。