philsv / pycot

Python library for retrieving the CFTC Commitment of Traders reports

Home Page:https://pypi.org/project/pycot-reports/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

module 'pycot' has no attribute 'legacy_report'

dermatzeimnetz opened this issue · comments

no chance to import neither in python script nor in colab
i tried importlib aswell. just cant

why you put a dash into the name. this is i think the problem here

Thanks! I fixed it in 0.0.4 you can get legacy_report now by from pycot.reports import legacy_report. Let me know if the problem persists for you.

Yes, I can Import now; but I have different error
The entire "data" folder is missing. Is it in the distri?

Traceback (most recent call last):
File "/data/httpd/www.valueray.com/htdocs/bin/download_cot.py", line 35, in
df = legacy_report("legacy_fut", contract_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/matze/.local/lib/python3.11/site-packages/pycot/reports.py", line 32, in legacy_report
data = cot.get_reports()
^^^^^^^^^^^^^^^^^
File "/home/matze/.local/lib/python3.11/site-packages/pycot/extract_report_data.py", line 129, in get_reports
legacy_data = self.get_legacy_report()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/matze/.local/lib/python3.11/site-packages/pycot/extract_report_data.py", line 89, in get_legacy_report
report_data = get_cot_data()
^^^^^^^^^^^^^^
File "/home/matze/.local/lib/python3.11/site-packages/pycot/extract_report_data.py", line 22, in get_cot_data
with open(BASE_PATH / "pycot/data/cot_reports_data.json", "r") as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/matze/.local/lib/python3.11/site-packages/pycot/data/cot_reports_data.json'

Should work now in 0.0.6.