From 85b85d45d132e4585f8cb63fc1d47c2030b661d9 Mon Sep 17 00:00:00 2001 From: philsv Date: Tue, 24 Oct 2023 12:46:57 +0200 Subject: [PATCH] fix: data folder unlocated --- {pycot/data => data}/contract_names.json | 0 {pycot/data => data}/cot_reports_data.json | 0 {pycot/data => data}/format_columns.json | 0 pycot/extract_report_data.py | 12 ++++++++++-- {pycot/data => tests}/__init__.py | 0 5 files changed, 10 insertions(+), 2 deletions(-) rename {pycot/data => data}/contract_names.json (100%) rename {pycot/data => data}/cot_reports_data.json (100%) rename {pycot/data => data}/format_columns.json (100%) rename {pycot/data => tests}/__init__.py (100%) diff --git a/pycot/data/contract_names.json b/data/contract_names.json similarity index 100% rename from pycot/data/contract_names.json rename to data/contract_names.json diff --git a/pycot/data/cot_reports_data.json b/data/cot_reports_data.json similarity index 100% rename from pycot/data/cot_reports_data.json rename to data/cot_reports_data.json diff --git a/pycot/data/format_columns.json b/data/format_columns.json similarity index 100% rename from pycot/data/format_columns.json rename to data/format_columns.json diff --git a/pycot/extract_report_data.py b/pycot/extract_report_data.py index 5e75081..4459103 100644 --- a/pycot/extract_report_data.py +++ b/pycot/extract_report_data.py @@ -19,7 +19,7 @@ def get_cot_data() -> dict: """ Extracts the Commitment of Traders Reports metadata. """ - with open(BASE_PATH / "pycot/data/cot_reports_data.json", "r") as f: + with open(BASE_PATH / "data" / "cot_reports_data.json", "r") as f: return json.load(f) @@ -27,7 +27,15 @@ def get_formating_data() -> dict: """ Extracts the column formating data. """ - with open(BASE_PATH / "pycot/data/format_columns.json", "r") as f: + with open(BASE_PATH / "data" / "format_columns.json", "r") as f: + return json.load(f) + + +def get_contract_data() -> dict: + """ + Extracts the contract data. + """ + with open(BASE_PATH / "data" / "contract_names.json", "r") as f: return json.load(f) diff --git a/pycot/data/__init__.py b/tests/__init__.py similarity index 100% rename from pycot/data/__init__.py rename to tests/__init__.py