Download the ICD-10 table and other reference tables (see REFFILES.zip) from https://www.isdscotland.org/Products-and-Services/Data-Definitions-and-References/National-Reference-Files/Nat-Ref-Files/icd10?64975703 and convert into CSV format using the description from https://www.isdscotland.org/Products-and-Services/Data-Definitions-and-References/National-Reference-Files/SMR-reference-file-layouts.asp
See SMR-reference-file-layouts.html for file formats.
Use txt_to_csv.py to convert the most useful files into CSV
See also PyMedTermino-0.3.3.tar.gz (from pypi) and icd10-cm-0.0.4.tar.gz (from pypi)