-
Notifications
You must be signed in to change notification settings - Fork 0
/
controls.py
56 lines (47 loc) · 1.77 KB
/
controls.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 17 19:54:17 2017
@author: Daniel
Main script with standard methods of 'Ads' object used to download and transform
dataset
"""
from ads_tools import Ads
if __name__=='__main__':
flats_rent = True
rooms_rent = True
flats_sale = True
download_new = True
transform = False
if flats_rent:
flats = Ads('flat', 'ads_data.json')
if download_new:
flats.download_new_ads()
flats.find_street_in_descriprion()
flats.save_dataset()
if transform:
flats.filter_and_transform_to_df(min_price = 300.00,
max_price=15000.0,
size_limit=300.0)
dataset_flats = flats.filtered_data
if rooms_rent:
rooms = Ads('room', 'ads_data_rooms.json')
if download_new:
rooms.download_new_ads()
rooms.find_street_in_descriprion()
rooms.save_dataset()
if transform:
rooms.filter_and_transform_to_df(min_price = 300.00,
max_price=15000.0,
size_limit=300.0)
dataset_rooms = rooms.filtered_data
if flats_sale:
flats_sale = Ads('flat_sale', 'ads_data_sale2.json')
if download_new:
flats_sale.download_new_ads()
flats_sale.find_street_in_descriprion()
flats_sale.save_dataset()
if transform:
flats_sale.filter_and_transform_to_df(min_price = 30000.00,
max_price=10000000.0,
size_limit=300.0)
dataset_flats_sale = flats_sale.filtered_data