Spaces:
Configuration error
Configuration error
Upload tables.py
Browse files- modules/tables.py +48 -0
modules/tables.py
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python3
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
"""
|
4 |
+
Created on Tue Aug 24 16:32:31 2021
|
5 |
+
|
6 |
+
@author: benjaminull
|
7 |
+
"""
|
8 |
+
|
9 |
+
from modules.mongo.mongo_api.mongo_api import _MongoSeries, _MongoDoc, _MongoTable
|
10 |
+
|
11 |
+
|
12 |
+
class EquityMaster(_MongoSeries):
|
13 |
+
_name = 'equity_master'
|
14 |
+
_key_ls = ['country', 'currency', 'asset', 'investable',
|
15 |
+
'ind_sector', 'ind_group', 'ind_industry',
|
16 |
+
'lv1', 'lv2', 'ind_esg', 'driver', 'field']
|
17 |
+
_drop_weekends = True
|
18 |
+
_override_boolean_key = ['investable']
|
19 |
+
|
20 |
+
class MacroMaster(_MongoSeries):
|
21 |
+
_name = 'macro_master'
|
22 |
+
_key_ls = ['country', 'currency', 'instrument', 'source', 'field']
|
23 |
+
_drop_weekends = True
|
24 |
+
|
25 |
+
class WebInfoMaster(_MongoSeries):
|
26 |
+
_name = 'web_info_master'
|
27 |
+
_key_ls = ['country', 'asset', 'investable',
|
28 |
+
'ind_sector', 'ind_group', 'ind_industry',
|
29 |
+
'ind_internal', 'ind_esg', 'source', 'field']
|
30 |
+
_drop_weekends = True
|
31 |
+
|
32 |
+
|
33 |
+
class RealEstateMaster(_MongoTable, ):
|
34 |
+
_name = 'real_estate_master'
|
35 |
+
_key_ls = ['id_pub', 'market', 'prop_type', 'bath', 'bed']
|
36 |
+
|
37 |
+
|
38 |
+
class ScoringMaster(_MongoSeries):
|
39 |
+
_name = 'scoring_master'
|
40 |
+
_key_ls = ['country', 'lv1','lv2', 'asset', 'metric']
|
41 |
+
|
42 |
+
#RealEstateMaster(id_pub=2, market=3, prop_type='depto').insert(prueba)
|
43 |
+
|
44 |
+
|
45 |
+
#RealEstateMaster().get_keys()
|
46 |
+
#RealEstateMaster().insert(dataframe, keys)
|
47 |
+
#RealEstateMaster().update_values(dataframe, keys)
|
48 |
+
# data frame nombre df.name=id_pub, mercado, tipo propiedad concatenados con un punto
|