heurist-api 0.2.1__py3-none-any.whl → 0.2.2__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 heurist-api might be problematic. Click here for more details.

heurist/cli/load.py CHANGED
@@ -45,8 +45,11 @@ def load_command(
45
45
  # Show the results of the created DuckDB database
46
46
  with duckdb.connect(duckdb_database_connection_path, read_only=True) as new_conn:
47
47
  tables = [t[0] for t in new_conn.sql("show tables;").fetchall()]
48
- with open(VALIDATION_LOG) as f:
49
- log = f.readlines()
48
+ if VALIDATION_LOG.is_file():
49
+ with open(VALIDATION_LOG) as f:
50
+ log = f.readlines()
51
+ else:
52
+ log = []
50
53
  show_summary_in_console(tables=tables, log_lines=log)
51
54
 
52
55
  # If writing to CSV files, write only tables of record types
@@ -62,7 +65,7 @@ def load_command(
62
65
  new_conn.table(table_name).sort("H-ID").write_csv(str(fp))
63
66
 
64
67
 
65
- def show_summary_in_console(tables: list[str], log_lines: list[str]):
68
+ def show_summary_in_console(tables: list[str], log_lines: list):
66
69
  console = Console()
67
70
  t0 = Panel(
68
71
  Columns(tables, equal=True, expand=True),
heurist/log/constants.py CHANGED
@@ -1,4 +1,3 @@
1
1
  from pathlib import Path
2
2
 
3
3
  VALIDATION_LOG = Path.cwd().joinpath("validation.log")
4
- VALIDATION_LOG.touch(exist_ok=True)
@@ -8,7 +8,7 @@ from heurist.validators.detail_validator import DetailValidator
8
8
  from heurist.validators.exceptions import RepeatedValueInSingularDetailType
9
9
  from pydantic import BaseModel
10
10
 
11
- handlers = [logging.FileHandler(filename=VALIDATION_LOG, mode="w", delay=True)]
11
+ handlers = [logging.FileHandler(filename=VALIDATION_LOG, mode="w")]
12
12
  if os.getenv("HEURIST_STREAM_LOG") == "True":
13
13
  handlers.append(logging.StreamHandler())
14
14
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: heurist-api
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Dynamic: Description
5
5
  Dynamic: Description-Content-Type
6
6
  Summary: API wrapper and CLI for Heurist database.
@@ -9,7 +9,7 @@ heurist/api/url_builder.py,sha256=mT1hgZ-T38EPyHCSLfjFecbZVLsiPi18jemDuuMj21I,49
9
9
  heurist/api/utils.py,sha256=DT-BrdF7O2lmFSduRYOecx302dAlLWQTYgr2V9JoDYI,643
10
10
  heurist/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  heurist/cli/__main__.py,sha256=QG2gJG7zD3YIDRqbIp2MzTqPxqGLZ77RHCRYZ58SSjg,5975
12
- heurist/cli/load.py,sha256=q6QwZRtIQVoII1HHLW0iGklfXJlHEVxrDwb8UeX7la4,2610
12
+ heurist/cli/load.py,sha256=iiQ11EauKV93Z3YuGyspeOK9XQIVf5SqRzQ9b6V8KZQ,2685
13
13
  heurist/cli/parse_log.py,sha256=cZU9mpLbx5p-bdCwbII27T-ugTpecTgCFiBoYJip5f4,828
14
14
  heurist/cli/records.py,sha256=yKK3XIZrU1szo6X-HmGjZpD0IKk3a3rd3Kkyrg5AYGE,1345
15
15
  heurist/cli/schema.py,sha256=Dg8NcSdI7Xb6r-dkUC_razXlZNtxSG0x7awsr1m8Mcw,2766
@@ -17,7 +17,7 @@ heurist/database/__init__.py,sha256=JvQCGCi84AXUSIPCu4cTOqT_yZGDLmZFAUdsHDLbpKI,
17
17
  heurist/database/basedb.py,sha256=0MKfQOKTBDCc6qcl8BGl5OIpSA7SYgmfcKXCBVWBPes,4200
18
18
  heurist/database/database.py,sha256=rJPhGA4158eoIwe13QsSGZ8929dkRxMTesRRlMrn1tI,4057
19
19
  heurist/log/__init__.py,sha256=ubZl-2yMlvUYJwJtnk6C8AjmnU-9mbp96aHL1NSzbSg,149
20
- heurist/log/constants.py,sha256=5FaEnyXCEt1gga0pgwq4sfz_dX58BK1NixXQ2CsihNo,117
20
+ heurist/log/constants.py,sha256=8TsR_BxYL_TzZSQWwKAO8oWqBGZ0g3e-XNls5XWymDs,81
21
21
  heurist/log/iterator.py,sha256=nmpW3QQfwToADD4zffAm5iFyIUMFT56LRORdThYRoqE,519
22
22
  heurist/log/model.py,sha256=rOey1V6Vd_ehm8FTXxfi7Q4A4Mjq0V9ITl_GlNdB0y0,1085
23
23
  heurist/log/summary.py,sha256=n-skKRiFSPd3DieZMveJLCP96plVdgjW9wgBR0H_2BI,1113
@@ -54,7 +54,7 @@ heurist/validators/__init__.py,sha256=Im5z_Yg2VdKSZRPUOPSF5AFZ8AWgnyBZNKhy1o69lC
54
54
  heurist/validators/detail_validator.py,sha256=NVItrZ4Ysmgqab-B24hIeimGqpiaiqFiono5qwW20ko,4070
55
55
  heurist/validators/exceptions.py,sha256=tgoMn6R2CExT6mFg2qe4vRxP2D61cNdgEqc7YUQCFSE,1108
56
56
  heurist/validators/parse_heurist_date.py,sha256=S-NzuLZJwDrxRJkAd-fXpOlENlkc8HXKRILWCODmtIU,2161
57
- heurist/validators/record_validator.py,sha256=37xFdBwfgQY21jCtcm45_8AOu6DwC27AGC4ompykJUE,6265
57
+ heurist/validators/record_validator.py,sha256=2mPfX_57F3MsgVVxpJm6Na2JCGhEicYD2bN_X6fn2L0,6253
58
58
  heurist/workflows/__init__.py,sha256=aYN0UE_7rD9h0h74DMXkUTIDrxA0WcsWLEXWK123Gzc,81
59
59
  heurist/workflows/etl.py,sha256=IA97B1NOg_2btT_pynY64RYvbL4JraAy6wgIKJlNljM,2286
60
60
  mock_data/__init__.py,sha256=TGe3NjGTXVRQbakVGEWbDDzIkFQ72fTZhTcAoIH3DGQ,488
@@ -79,8 +79,8 @@ mock_data/geo/single.py,sha256=gbk_gOLfVlJuU3MhjY2Lu14bs9-FbZmNtevpiw9jArk,79867
79
79
  mock_data/resource/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
80
  mock_data/resource/repeated.py,sha256=Nf3nIL596pLVbKo20sQm5UITwBzqf-IHFzE_m2UCLbw,788
81
81
  mock_data/resource/single.py,sha256=SXVri1MM8UaJw7GejMEJ6seNEnMksdw_WKiOxQOdVFs,411
82
- heurist_api-0.2.1.dist-info/METADATA,sha256=INf5LbhdDjblw82g0TfLpwSC9E2oIQ4pRPjeme25sb0,25177
83
- heurist_api-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
- heurist_api-0.2.1.dist-info/entry_points.txt,sha256=37KBvqofapLaKDPFrcYxv_rfUM9H08Mbe6mxNdd_Xno,93
85
- heurist_api-0.2.1.dist-info/licenses/LICENSE,sha256=I-54yLrknPCOovDISUXGa5h-vkUgiB-1Gz2tT7Q9B8I,20137
86
- heurist_api-0.2.1.dist-info/RECORD,,
82
+ heurist_api-0.2.2.dist-info/METADATA,sha256=uhv1HQ4n5iYL8Jp9dNrUMHfHH-_60u0Y9uciPrqqXIc,25177
83
+ heurist_api-0.2.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
+ heurist_api-0.2.2.dist-info/entry_points.txt,sha256=37KBvqofapLaKDPFrcYxv_rfUM9H08Mbe6mxNdd_Xno,93
85
+ heurist_api-0.2.2.dist-info/licenses/LICENSE,sha256=I-54yLrknPCOovDISUXGa5h-vkUgiB-1Gz2tT7Q9B8I,20137
86
+ heurist_api-0.2.2.dist-info/RECORD,,