-
Notifications
You must be signed in to change notification settings - Fork 0
/
taxarrears150.py
53 lines (42 loc) · 1.61 KB
/
taxarrears150.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
import attr
import luigi
from luigi.util import requires
from settings import TMP_DIR
from tasks.base import GzipToFtp, WebExcelFileParsingToCsv
@attr.s
class Row:
num = attr.ib(default='')
region = attr.ib(default='')
office_of_tax_enforcement = attr.ib(default='')
ote_id = attr.ib(default='')
bin = attr.ib(default='')
rnn = attr.ib(default='')
taxpayer_organization_ru = attr.ib(default='')
taxpayer_organization_kz = attr.ib(default='')
last_name_kz = attr.ib(default='')
first_name_kz = attr.ib(default='')
middle_name_kz = attr.ib(default='')
last_name_ru = attr.ib(default='')
first_name_ru = attr.ib(default='')
middle_name_ru = attr.ib(default='')
owner_iin = attr.ib(default='')
owner_rnn = attr.ib(default='')
owner_name_kz = attr.ib(default='')
owner_name_ru = attr.ib(default='')
economic_sector = attr.ib(default='')
total_due = attr.ib(default='')
sub_total_main = attr.ib(default='')
sub_total_late_fee = attr.ib(default='')
sub_total_fine = attr.ib(default='')
url = 'http://kgd.gov.kz/mobile_api/services/taxpayers_unreliable_exportexcel/TAX_ARREARS_150/KZ_ALL/fileName/list_TAX_ARREARS_150_KZ_ALL.xlsx'
@requires(WebExcelFileParsingToCsv)
class GzipDebtorsToFtp(GzipToFtp):
pass
class TaxArrears150(luigi.WrapperTask):
def requires(self):
return GzipDebtorsToFtp(url=url, name='kgd_taxarrears150',
monthly=True,
struct=Row, sheets=(0, 1),
directory=TMP_DIR, skiptop=6)
if __name__ == '__main__':
luigi.run()