Python interface to Debian's popularity contest database
Project description
# python-popcon
Get Debian [popularity contest](https://popcon.debian.org/) values for given
packages.
## Installation
```bash
$ pip install popcon
```
## Usage
The usage of this module is easy:
```python
>>> import popcon
>>> popcon.package('reportbug-ng')
{'reportbug-ng': 323}
>>> popcon.package('reportbug-ng', 'reportbug')
{'reportbug-ng': 323, 'reportbug': 75065}
```
The raw data (vote, old, recent, no-file) is also available, the sum of the raw
numbers is the number of installations as reported by `popcon.package`.
```python
>>> popcon.package_raw('reportbug-ng', 'reportbug')
{'reportbug-ng': Package(vote=50, old=187, recent=86, no_files=0),
'reportbug': Package(vote=5279, old=59652, recent=10118, no_files=16)}
```
Behind the scene popcon will try to use cached information saved in a file in
the ~/.cache/popcon directory. If the relevant file is not available, or older
than `EXPIRY` seconds (default is 7 days) it will download fresh data and save
that.
The cached data will be kept in memory unless `KEEP_DATA` is set to False.
## Command Line Interface
```
$ popcon reportbug
{'reportbug': 177670}
```
Get Debian [popularity contest](https://popcon.debian.org/) values for given
packages.
## Installation
```bash
$ pip install popcon
```
## Usage
The usage of this module is easy:
```python
>>> import popcon
>>> popcon.package('reportbug-ng')
{'reportbug-ng': 323}
>>> popcon.package('reportbug-ng', 'reportbug')
{'reportbug-ng': 323, 'reportbug': 75065}
```
The raw data (vote, old, recent, no-file) is also available, the sum of the raw
numbers is the number of installations as reported by `popcon.package`.
```python
>>> popcon.package_raw('reportbug-ng', 'reportbug')
{'reportbug-ng': Package(vote=50, old=187, recent=86, no_files=0),
'reportbug': Package(vote=5279, old=59652, recent=10118, no_files=16)}
```
Behind the scene popcon will try to use cached information saved in a file in
the ~/.cache/popcon directory. If the relevant file is not available, or older
than `EXPIRY` seconds (default is 7 days) it will download fresh data and save
that.
The cached data will be kept in memory unless `KEEP_DATA` is set to False.
## Command Line Interface
```
$ popcon reportbug
{'reportbug': 177670}
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-popcon-2.0.0.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for python_popcon-2.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c345ea9751cea36d2da44c2364db1b3d046765923ae0804a6fcb53ac270354ff |
|
MD5 | 5dab9e0a20ac3c84503e5a7c1c8eac03 |
|
BLAKE2b-256 | a84ad4010ec7a946f30e2295c39cef5f39121c76b63b9cf92dba7928fb400a78 |