aboutsummaryrefslogtreecommitdiff
path: root/README
blob: e408a09b0f71dd8e478eec72413de4dbfc31731f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
## Dependencies

 * pandas
     <http://pandas.pydata.org/>

 * debian
     <https://alioth.debian.org/projects/pkg-python-debian>

 * nose (to run test.py)
     <https://nose.readthedocs.org/en/latest/>

## Importing data

Loading data from package files:

    $ pv .../Packages python | python load_packages.py

Packages files can be obtained from Debian mirrors, and are cached by APT in
/var/lib/apt/lists.

Loading package descriptions:

    $ pv .../Translation-en | python load_descriptions.py

Loading data from copyright files:

    $ python load_copyright.py main/*/*/current/copyright | tee cp_import.log

Unfortunately, I don't know of a way to easily and quickly get copyright files
for all packages in main if you are not a Debian developer. I obtained them by
logging into powell.debian.org (which hosts.packages.debian.org) and running:

    $ cd /srv/packages.debian.org/www/changelogs/pool
    $ tar -zchf ~/copyright.tar.gz main/*/*/current/copyright

## Exporting data

One package:

    $ python export.py Pandoc

All packages, as wiki pages:

    $ python export.py

(Output is in "output" directory.)

All packages, as JSON:

    $ python export_json.py

JSON output can be converted to wiki pages:

    $ python json_to_wiki.py < packages.json

(Output is in "converted" directory.)