--- /dev/null
+[pycodestyle]
+max-line-length = 88
+
+
+[flake8]
+per-file-ignores =
+ # Allow unused imports in __init__.py files
+ __init__.py:F401
+
+max-line-length = 88
+
+ignore =
+ W503, # line break before binary operator
+
+
+[isort]
+line_length=88
+known_first_party=sql
+
+# See: https://copdips.com/2020/04/making-isort-compatible-with-black.html
+multi_line_output=3
+include_trailing_comma=true
+
+
+[mypy]
+ignore_missing_imports = True
+show_error_codes = True
+disable_error_code = import
+disallow_untyped_calls = True
+disallow_untyped_decorators = True
+strict_optional = False
+warn_redundant_casts = True
+warn_unused_ignores = True
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-def build_ntsqlite(verbose=False):
+def build_ntsqlite(verbose=False) -> bool:
"""Builds and inserts stock data into nt.sqlite"""
# cd into this script's directory
os.chdir(SCRIPT_DIR)
# Loop over CSV files
with open(file_path_full, encoding="utf-8") as csv_file:
- reader = csv.DictReader(csv_file)
- values = ",".join("?" * len(reader.fieldnames))
+ dict_reader = csv.DictReader(csv_file)
+ values = ",".join("?" * len(dict_reader.fieldnames))
reader = csv.reader(csv_file)
query = "INSERT INTO {0} VALUES ({1});".format( # nosec: B608
table_name, values