chellow 1712932880.0.0__py3-none-any.whl → 1713259114.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of chellow might be problematic. Click here for more details.

@@ -6,6 +6,8 @@ from dateutil.relativedelta import relativedelta
6
6
 
7
7
  from werkzeug.exceptions import BadRequest
8
8
 
9
+ from zish import ZishLocationException
10
+
9
11
  from chellow.utils import (
10
12
  HH,
11
13
  ct_datetime_parse,
@@ -44,7 +46,7 @@ class Parser:
44
46
  raw_bills = []
45
47
  next(iter(self.reader)) # skip title row
46
48
  blank_set = set(("",))
47
- for self.line_number, self.vals in enumerate(self.reader, start=1):
49
+ for self.line_number, self.vals in enumerate(self.reader, start=2):
48
50
  try:
49
51
  # skip blank lines
50
52
  if len(self.vals) == 0 or set(self.vals) == blank_set:
@@ -72,7 +74,7 @@ class Parser:
72
74
  else:
73
75
  try:
74
76
  breakdown = loads(breakdown_str)
75
- except SyntaxError as e:
77
+ except ZishLocationException as e:
76
78
  raise BadRequest(str(e))
77
79
  else:
78
80
  raise BadRequest("There isn't a 'breakdown' field on the end.")
@@ -117,7 +119,9 @@ class Parser:
117
119
  }
118
120
  raw_bills.append(raw_bill)
119
121
  except BadRequest as e:
120
- raise BadRequest(f"Problem at line {self.line_number}: {e.description}")
122
+ raise BadRequest(
123
+ f"Problem at line {self.line_number} {self.vals}: {e.description}"
124
+ )
121
125
 
122
126
  return raw_bills
123
127
 
@@ -15,7 +15,7 @@ read_type_map = {
15
15
  "02": "E",
16
16
  "11": "E3",
17
17
  "01": "EM",
18
- "03": "W",
18
+ "03": "F",
19
19
  "06": "X",
20
20
  "05": "CP",
21
21
  "12": "IF",
chellow/general_import.py CHANGED
@@ -1247,20 +1247,26 @@ def general_import_supply(sess, action, vals, args):
1247
1247
  dc_account = add_arg(args, "DC Account", vals, 10)
1248
1248
  msn = add_arg(args, "Meter Serial Number", vals, 11)
1249
1249
  dno_code = add_arg(args, "DNO Code", vals, 12)
1250
- dno = Party.get_dno_by_code(sess, dno_code)
1250
+ dno = Party.get_dno_by_code(sess, dno_code, start_date)
1251
1251
  pc_code = add_arg(args, "Profile Class", vals, 13)
1252
1252
  pc = Pc.get_by_code(sess, parse_pc_code(pc_code))
1253
1253
  mtc_code = add_arg(args, "Meter Timeswitch Class", vals, 14)
1254
1254
  cop_code = add_arg(args, "CoP", vals, 15)
1255
1255
  cop = Cop.get_by_code(sess, cop_code)
1256
- ssc_code = add_arg(args, "Standard Settlement Configuration", vals, 16)
1256
+ comm_code = add_arg(args, "Comms Type", vals, 16)
1257
+ comm = Comm.get_by_code(sess, comm_code)
1258
+ ssc_code = add_arg(args, "Standard Settlement Configuration", vals, 17)
1257
1259
  ssc = Ssc.get_by_code(sess, ssc_code) if len(ssc_code) > 0 else None
1258
- properties_str = add_arg(args, "Properties", vals, 17)
1260
+ energisation_status_code = add_arg(args, "Energisation Status", vals, 18)
1261
+ energisation_status = EnergisationStatus.get_by_code(
1262
+ sess, energisation_status_code
1263
+ )
1264
+ properties_str = add_arg(args, "Properties", vals, 19)
1259
1265
  try:
1260
1266
  properties = loads(properties_str)
1261
1267
  except ZishException as e:
1262
- raise BadRequest("Can't parse the properties field. " + str(e))
1263
- imp_mpan_core = add_arg(args, "Import MPAN Core", vals, 18)
1268
+ raise BadRequest(f"Can't parse the properties field. {e}")
1269
+ imp_mpan_core = add_arg(args, "Import MPAN Core", vals, 20)
1264
1270
  if len(imp_mpan_core) == 0:
1265
1271
  imp_mpan_core = None
1266
1272
  else:
@@ -1272,55 +1278,48 @@ def general_import_supply(sess, action, vals, args):
1272
1278
  imp_supplier_account = None
1273
1279
  imp_sc = None
1274
1280
  else:
1275
- imp_llfc_code = add_arg(args, "Import LLFC", vals, 19)
1276
- imp_sc_str = add_arg(args, "Import Agreed Supply Capacity", vals, 20)
1281
+ imp_llfc_code = add_arg(args, "Import LLFC", vals, 21)
1282
+ imp_sc_str = add_arg(args, "Import Agreed Supply Capacity", vals, 22)
1277
1283
  try:
1278
1284
  imp_sc = int(imp_sc_str)
1279
1285
  except ValueError as e:
1280
- raise BadRequest(
1281
- "The import supply capacity must be an integer." + str(e)
1282
- )
1286
+ raise BadRequest(f"The import supply capacity must be an integer. {e}")
1283
1287
 
1284
1288
  imp_supplier_contract_name = add_arg(
1285
- args, "Import Supplier Contract", vals, 21
1289
+ args, "Import Supplier Contract", vals, 23
1286
1290
  )
1287
- imp_supplier_account = add_arg(args, "Import Supplier Account", vals, 22)
1291
+ imp_supplier_account = add_arg(args, "Import Supplier Account", vals, 24)
1288
1292
  imp_supplier_contract = Contract.get_supplier_by_name(
1289
1293
  sess, imp_supplier_contract_name
1290
1294
  )
1291
1295
 
1292
- exp_supplier_contract = None
1293
- exp_sc = None
1294
- exp_llfc_code = None
1295
- exp_mpan_core = None
1296
+ exp_supplier_contract = exp_sc = exp_llfc_code = exp_mpan_core = None
1296
1297
  exp_supplier_account = None
1297
- if len(vals) > 22:
1298
- exp_mpan_core = add_arg(args, "Export MPAN Core", vals, 23)
1298
+ if len(vals) > 25:
1299
+ exp_mpan_core = add_arg(args, "Export MPAN Core", vals, 25)
1299
1300
  if len(exp_mpan_core) == 0:
1300
1301
  exp_mpan_core = None
1301
1302
  else:
1302
1303
  exp_mpan_core = parse_mpan_core(exp_mpan_core)
1303
1304
 
1304
1305
  if exp_mpan_core is not None:
1305
- exp_llfc_code = add_arg(args, "Export LLFC", vals, 24)
1306
- exp_sc_str = add_arg(args, "Export Agreed Supply Capacity", vals, 25)
1306
+ exp_llfc_code = add_arg(args, "Export LLFC", vals, 26)
1307
+ exp_sc_str = add_arg(args, "Export Agreed Supply Capacity", vals, 27)
1307
1308
  try:
1308
1309
  exp_sc = int(exp_sc_str)
1309
1310
  except ValueError as e:
1310
1311
  raise BadRequest(
1311
- "The export agreed supply capacity "
1312
- + "must be an integer."
1313
- + str(e)
1312
+ f"The export agreed supply capacity must be an integer. {e}"
1314
1313
  )
1315
1314
 
1316
1315
  exp_supplier_contract_name = add_arg(
1317
- args, "Export Supplier Contract", vals, 26
1316
+ args, "Export Supplier Contract", vals, 28
1318
1317
  )
1319
1318
  exp_supplier_contract = Contract.get_supplier_by_name(
1320
1319
  sess, exp_supplier_contract_name
1321
1320
  )
1322
1321
  exp_supplier_account = add_arg(
1323
- args, "Export Supplier Account", vals, 27
1322
+ args, "Export Supplier Account", vals, 29
1324
1323
  )
1325
1324
 
1326
1325
  supply = site.insert_e_supply(
@@ -1340,7 +1339,9 @@ def general_import_supply(sess, action, vals, args):
1340
1339
  pc,
1341
1340
  mtc_code,
1342
1341
  cop,
1342
+ comm,
1343
1343
  ssc,
1344
+ energisation_status,
1344
1345
  properties,
1345
1346
  imp_mpan_core,
1346
1347
  imp_llfc_code,
@@ -89,6 +89,7 @@
89
89
  <td>Profile Class</td>
90
90
  <td>Meter Timeswitch Class</td>
91
91
  <td>CoP</td>
92
+ <td>Comms Type</td>
92
93
  <td>
93
94
  Standard Settlement Configuration (blank for HH supplies)
94
95
  </td>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: chellow
3
- Version: 1712932880.0.0
3
+ Version: 1713259114.0.0
4
4
  Summary: Web Application for checking UK energy bills.
5
5
  Project-URL: Homepage, https://github.com/WessexWater/chellow
6
6
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
@@ -4,7 +4,7 @@ chellow/bank_holidays.py,sha256=T_utYMwe_g1dz5X-aOTdIPryg49SvB7QsWM1yphlqG8,4423
4
4
  chellow/commands.py,sha256=ESBe9ZWj1c3vdZgqMZ9gFvYAB3hRag2R1PzOwuw9yFo,1302
5
5
  chellow/dloads.py,sha256=5SmP-0QPK6xCkd_wjIWh_8FAzN5OxNHCzyEQ1Xb-Y-M,5256
6
6
  chellow/edi_lib.py,sha256=het3R0DBGtXEo-Sy1zvXQuX9EWQ1X6Y33G4l1hYYuds,51859
7
- chellow/general_import.py,sha256=4LduwzNipxOiHYHQLb0x96_m3RPuDnQMbJzOFDbOqTg,65039
7
+ chellow/general_import.py,sha256=d_bDfUW8VulF6FqT5q7jiQ0a_NmVpUVyzXNgNBLpn0k,65263
8
8
  chellow/models.py,sha256=9SDx150OdxFnw4tfpvLn2fB0NsqlrE57VqdRPYz9OnE,237335
9
9
  chellow/national_grid.py,sha256=uxcv0qisHPyzw9AVIYPzsRqwt2XPAcZL-SBR12qcrS0,4364
10
10
  chellow/proxy.py,sha256=cVXIktPlX3tQ1BYcwxq0nJXKE6r3DtFTtfFHPq55HaM,1351
@@ -43,14 +43,14 @@ chellow/e/bill_parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
43
43
  chellow/e/bill_parsers/activity_mop_stark_xlsx.py,sha256=UgWXDPzQkQghyj_lfgBqoSJpHB-t-qOdSaB8qY6GLog,4071
44
44
  chellow/e/bill_parsers/annual_mop_stark_xlsx.py,sha256=-HMoIfa_utXYKA44RuC0Xqv3vd2HLeQU_4P0iBUd3WA,4219
45
45
  chellow/e/bill_parsers/bgb_edi.py,sha256=GuwHeYbAGk7BVg5n19FcTANFDyKI-y0z3f9niQaPSSw,4828
46
- chellow/e/bill_parsers/csv.py,sha256=GBsJK0c7_m-9s17LXRuCPfHsVngbeaTs5wsZxL5dLNI,5540
46
+ chellow/e/bill_parsers/csv.py,sha256=U5zcIaZ6B5QTTpFDAcBnk4G2r8B3j5kJhDPL4AJNkEk,5640
47
47
  chellow/e/bill_parsers/engie_edi.py,sha256=CTobTskDjzdcqqf_qk2ukDSaTLrVpGZMM0sYlwehog4,14985
48
48
  chellow/e/bill_parsers/engie_xls.py,sha256=jrut2heH_ZWmSjcn7celOydZS9Y49GfpYjDk_EKwamI,14453
49
49
  chellow/e/bill_parsers/engie_xlsx.py,sha256=L6lmTslsJxtFAWkRn6f4xFHBCwgoH5sW8x4_ckE4T7g,15793
50
50
  chellow/e/bill_parsers/gdf_csv.py,sha256=ZfK3Oc6oP28p_P9DIevLNB_zW2WLcEJ3Lvb1gL310YU,7382
51
51
  chellow/e/bill_parsers/haven_csv.py,sha256=0uENq8IgVNqdxfBQMBxLTSZWCOuDHXZC0xzk52SbfyE,13652
52
52
  chellow/e/bill_parsers/haven_edi.py,sha256=YGPHRxPOhje9s32jqPHHELni2tooOYj3cMC_qaZVPq4,16107
53
- chellow/e/bill_parsers/haven_edi_tprs.py,sha256=2JciFf8LdNSiKCsNVWb4q4YLSn4Z3EqhvcdXyIieKdc,11841
53
+ chellow/e/bill_parsers/haven_edi_tprs.py,sha256=ZVX9CCqUybsot_Z0BEOJPvl9x5kSr7fEWyuJXvZDcz4,11841
54
54
  chellow/e/bill_parsers/mm.py,sha256=P4CdkskDrjmFMSDp0ehE_ichTBHGywbT_dckMxuAqQQ,1929
55
55
  chellow/e/bill_parsers/nonsettlement_dc_stark_xlsx.py,sha256=yogXTuQHGRL7IiqvRWr2C9V24ez1j9Yx0128UygPE_k,4723
56
56
  chellow/e/bill_parsers/settlement_dc_stark_xlsx.py,sha256=gKeYMdUO4bVycV8n1lWs5AIfF3bHZLkM6tkasD4rhHs,6239
@@ -114,7 +114,7 @@ chellow/templates/csv_sites_monthly_duration.html,sha256=59gErG6KwA57z-qh2EJsVGv
114
114
  chellow/templates/downloads.html,sha256=R9QPcFz-PLJOX7rDlmquIk-Hp9Iq-thzWCTfOexSpXg,937
115
115
  chellow/templates/edi_viewer.html,sha256=szUthgHOdph6Of-7f_1LeC_zYlNJaMeS5ctn6xTAeiM,1437
116
116
  chellow/templates/general_import.html,sha256=SMemHGu466Be3_cAWSS6Hn-Kv-1psbEMDD6NQG6bfbI,1013
117
- chellow/templates/general_imports.html,sha256=x6V4xO7gznQR5l3PQKVNZaqvp2S2E8wRz4DysZk17Cw,13026
117
+ chellow/templates/general_imports.html,sha256=9rFbve28ADnfJ4CL45vJbOPG-mAYBETWVa_ctgcXvHg,13050
118
118
  chellow/templates/home.html,sha256=_ANKmcnlk_PDyZl6SCmejU8d90f3t8EH_rDDPDyYUwE,5657
119
119
  chellow/templates/input_date.html,sha256=rpgB5n0LfN8Y5djN_ZiuSxqdskxzCoKrEqI7hyJkVQo,1248
120
120
  chellow/templates/local_report.html,sha256=pV7_0QwyQ-D3OS9LXrly5pq3qprZnwTCoq6vCnMTkS4,1332
@@ -363,6 +363,6 @@ chellow/templates/g/supply_note_edit.html,sha256=6UQf_qbhFDys3cVsTp-c7ABWZpggW9R
363
363
  chellow/templates/g/supply_notes.html,sha256=WR3YwGh_qqTklSJ7JqWX6BKBc9rk_jMff4RiWZiF2CM,936
364
364
  chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
365
365
  chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
366
- chellow-1712932880.0.0.dist-info/METADATA,sha256=oHh-59J755aWAfb1nD6BJAZUceWIUw2SO7RhBSHKdzk,12205
367
- chellow-1712932880.0.0.dist-info/WHEEL,sha256=as-1oFTWSeWBgyzh0O_qF439xqBe6AbBgt4MfYe5zwY,87
368
- chellow-1712932880.0.0.dist-info/RECORD,,
366
+ chellow-1713259114.0.0.dist-info/METADATA,sha256=0JTJ-zEXssG25w46B8KcvxriKareIsEE-kKNQW4JvuI,12205
367
+ chellow-1713259114.0.0.dist-info/WHEEL,sha256=K0BPUNF1N3kQ9olb8aVEtkObePEjdr2JOLT1N83EVws,87
368
+ chellow-1713259114.0.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.22.5
2
+ Generator: hatchling 1.24.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any