-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdt_explorer
executable file
·32 lines (27 loc) · 933 Bytes
/
dt_explorer
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
#!/usr/bin/env python
import discogstool.libdiscogs as libdiscogs
import discogstool.libtags as libtags
import discogstool.discogs_client as discogs_client
import discogstool.posted as posted
import os
import pprint
import sys
import argparse
parser = argparse.ArgumentParser(description='Explor Artists / Labels')
parser.add_argument("-l", "--label", action="append")
parser.add_argument("-a", "--artist", action="append")
parser.add_argument("-p", "--posted", action="store_true")
args = parser.parse_args(sys.argv[1:])
if args.label:
item = discogs_client.Label(args.label)
if args.artist:
item = discogs_client.Artist(args.artist)
rs = item.releases
print discogs_client.tsv_key
for r in rs:
release = libdiscogs.get_release(r["id"])
if args.posted:
count, price = posted.fetch_release_posted(r["id"])
release.count = count
release.price = price
print release.tsv.encode("utf-8")