-
Notifications
You must be signed in to change notification settings - Fork 0
/
examples.py
40 lines (29 loc) · 982 Bytes
/
examples.py
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
from fundgrube import Fundgrube, Retailer
import pprint
pp = pprint.PrettyPrinter()
fundgrube = Fundgrube(retailer=Retailer.MEDIAMARKT)
# Categories, including counts of postings
pp.pprint(fundgrube.categories())
# Brands, including counts of postings
pp.pprint(fundgrube.brands()[:4])
# Outlets, including counts of postings
pp.pprint(fundgrube.outlets()[:4])
# Postings by category
postings, _, _ = fundgrube.postings(
limit=4,
category_ids=['CAT_DE_MM_115', 'CAT_DE_MM_8000']
)
pp.pprint(postings)
# Postings by brand
postings, _, url = fundgrube.postings(limit=4, brands=['APPLE', 'CASIO'])
pp.pprint(url)
pp.pprint(postings)
# Outlet by name, followed by postings by outlet
outlet = fundgrube.outlet(outlet_name='Bonn')
if outlet is not None:
pp.pprint(outlet)
postings, _, _ = fundgrube.postings(limit=4, outlet_ids=[outlet])
pp.pprint(postings)
# Text search
postings, _, _ = fundgrube.postings(limit=4, search='iPhone SE')
pp.pprint(postings)