Debian人气竞赛数据库的Python接口
python-popcon的Python项目详细描述
#python-python-popcon
get debian[人气大赛](https://popcon.debian.org/)给定
>软件包的值。
` ` ` ` ` ` ` ` ` ` ` ` ` ` bash
$pip install popcon
` ` ` `
` ` ` `` python
>>>>>这个模块的使用很容易:
:这个模块的使用很容易:
>;导入popcon
>;>;popcon.package('reportbug-ng')
{'reportbug-ng':323}
>;>;popcon.package('reportbug-ng','reportbug')
{'reportbug-ng':323,'reportbug':75065}
``````
原始数据(投票、旧数据、新数据、无文件)也可用,raw
数字的总和是“popcon.package”报告的安装数。
``python
>>popcon.package_raw('reportbug-ng','reportbug')
{'reportbug-ng':包(投票=50,旧=187,新=86,没有文件=0),
'reportbug':包(投票=5279,旧=59652,新=10118,没有文件=16)}
``场景popcon将尝试使用保存在~/.cache/popcon目录中的文件中的缓存信息。如果相关文件不可用,或者比“expiry”秒(默认值为7天)更早,它将下载新数据并保存到内存中,除非“keep”data设置为false。
get debian[人气大赛](https://popcon.debian.org/)给定
>软件包的值。
` ` ` ` ` ` ` ` ` ` ` ` ` ` bash
$pip install popcon
` ` ` `
` ` ` `` python
>>>>>这个模块的使用很容易:
:这个模块的使用很容易:
>;导入popcon
>;>;popcon.package('reportbug-ng')
{'reportbug-ng':323}
>;>;popcon.package('reportbug-ng','reportbug')
{'reportbug-ng':323,'reportbug':75065}
``````
原始数据(投票、旧数据、新数据、无文件)也可用,raw
数字的总和是“popcon.package”报告的安装数。
``python
>>popcon.package_raw('reportbug-ng','reportbug')
{'reportbug-ng':包(投票=50,旧=187,新=86,没有文件=0),
'reportbug':包(投票=5279,旧=59652,新=10118,没有文件=16)}
``场景popcon将尝试使用保存在~/.cache/popcon目录中的文件中的缓存信息。如果相关文件不可用,或者比“expiry”秒(默认值为7天)更早,它将下载新数据并保存到内存中,除非“keep”data设置为false。