Analyse data from multiple diabetes management systems including XDrip+, Dexcom, and Freestyle Libre. Handle CGM readings, insulin doses, carbs, and treatment notes with confidence.
The simplest way to use the CGM Data Processor is to run python -m src.cli path/to/data/export.file from the root directory. The following arguments can be supllied:
python-msrc.clidata.sqlite\--interpolation-limit6# Max CGM gaps to fill (6 = 30 mins)--bolus-limit10.0# Max bolus insulin units--max-dose20.0# Max valid insulin dose--output./my_analysis# Output location
The cli script, performs multiple processing steps and outputs standardised CSV data. The library can be used in many different configurations depending on your use case. For individual use cases check out our API Reference section.
fromsrc.core.exceptionsimportDataProcessingError,ReaderErrorfromsrc.core.format_registryimportFormatRegistryfromsrc.file_parser.format_detectorimportFormatDetectorfromsrc.processorsimportDataProcessorfromsrc.readersimportBaseReader# Initialise format detectionregistry=FormatRegistry()detector=FormatDetector(registry)processor=DataProcessor()file_path="example_data.sqlite"# Process filedetected_format,_,_=detector.detect_format(file_path)reader=BaseReader.get_reader_for_format(detected_format,file_path)withreader:table_data=reader.read_all_tables()ifnottable_data:raiseReaderError("No valid data found in file")try:processed_data=processor.process_tables(table_data=table_data,detected_format=detected_format,)ifnotprocessed_data:raiseDataProcessingError("No data could be processed")exceptDataProcessingErrorase:raiseDataProcessingError(f"Failed to process data: {str(e)}")frome
This tool is designed for data analysis only. Not intended for real-time monitoring or medical decision making. Always consult healthcare providers for medical advice.