Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/venthur/python-popcon
Query Debian's Popcon Database with Python
https://github.com/venthur/python-popcon
cli debian python
Last synced: about 1 month ago
JSON representation
Query Debian's Popcon Database with Python
- Host: GitHub
- URL: https://github.com/venthur/python-popcon
- Owner: venthur
- License: gpl-2.0
- Created: 2010-08-17T16:02:17.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2023-08-23T06:26:57.000Z (about 1 year ago)
- Last Synced: 2024-05-01T22:00:28.238Z (7 months ago)
- Topics: cli, debian, python
- Language: Python
- Homepage:
- Size: 90.8 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.packages(['reportbug-ng'])
{'reportbug-ng': 323}
>>> popcon.packages(['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.packages_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 python
PACKAGE VALUE
reportbug 180558
python 110709
```it also supports a more verbose mode on the command line:
```
popcon --verbose reportbug python
PACKAGE VOTE OLD RECENT NO FILES
reportbug 5929 149243 25315 71
python 3985 103591 3066 67
```