ccharz / medtronic-php-parser
A PHP Medtronic Carelink Data Parser
v0.0.5
2026-11-28 19:22 UTC
Requires
- php: ^8.5 | ^8.6
- smalot/pdfparser: ^2.8
Requires (Dev)
- laravel/pint: ^1.14
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^11.0
- rector/rector: ^2.9
- spatie/phpunit-snapshot-assertions: ^5.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Parse CSV data exports and PDF device settings reports from Medtronic CareLink.
Requirements
- PHP 8.5+
Installation
composer require ccharz/medtronic-php-parser
CSV Data
Reads pump, sensor and auto insulin data from a CareLink CSV export.
use Ccharz\MedtronicParser\CsvParser; $parser = new CsvParser('path/to/export.csv', 'Europe/Vienna'); $lines = []; $parser->parse(function (string $type, array $values) use (&$lines): void { $lines[$type][] = $values; });
$type is pump, sensor or auto. Each $values array contains the row's non-empty columns plus a datetime key.
Device Settings (PDF)
Reads basal rates, carb ratios, correction factors, target blood sugar and active insulin time from a CareLink PDF report.
Note: Only German reports with units in mg/dL are supported right now.
use Ccharz\MedtronicParser\ProfileParser; $profile = (new ProfileParser('path/to/report.pdf', 'de', 'Europe/Vienna'))->parse();
Testing
composer test
The test data isn't included, for privacy reasons. To run the tests, put your own files in tests/samples/exports/ (CSV) and tests/samples/profiles/ (PDF).
License
MIT. See LICENSE.