{"id":15412197,"url":"https://github.com/maymeow/excel-importer","last_synced_at":"2025-11-08T05:30:41.741Z","repository":{"id":38356035,"uuid":"270659390","full_name":"MayMeow/excel-importer","owner":"MayMeow","description":"⚙ Simple and extendable library for loading data from Excel files (.xlsx) into objects.","archived":false,"fork":false,"pushed_at":"2022-10-01T20:01:08.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-02T01:59:39.076Z","etag":null,"topics":["excel","excel-import","excel-to-sql","hacktoberfest","spreadsheets","xls","xlsx"],"latest_commit_sha":null,"homepage":"https://themaymeow.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MayMeow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2020-06-08T12:25:39.000Z","updated_at":"2024-05-02T01:59:39.077Z","dependencies_parsed_at":"2022-08-25T05:01:04.226Z","dependency_job_id":null,"html_url":"https://github.com/MayMeow/excel-importer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayMeow%2Fexcel-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayMeow%2Fexcel-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayMeow%2Fexcel-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayMeow%2Fexcel-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MayMeow","download_url":"https://codeload.github.com/MayMeow/excel-importer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239550248,"owners_count":19657538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["excel","excel-import","excel-to-sql","hacktoberfest","spreadsheets","xls","xlsx"],"created_at":"2024-10-01T16:51:41.271Z","updated_at":"2025-11-08T05:30:41.655Z","avatar_url":"https://github.com/MayMeow.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Excel importer\n\nSimple and extendable library for loading data from Excel files (.xlsx) into objects.\n\nThis Library using `phpoffice/phpspreadsheet` to read from XLSX files. Look at their [Github](https://github.com/PHPOffice/PhpSpreadsheet)\n\n## Read files - commandline with example data (Deprecated)\n\nFrom command line with example data\n\n```bash\nphp application.php app:read-file -f ./path/to/file.xlsx\n```\n\n## Via Source Code\n\nCreate new model which extending `MayMeow\\ExcelImporter\\Models\\BaseModel`. To map column from excel to property use\n`\\MayMeow\\ExcelImporter\\Attributes\\Column` attribute.\n\n```php\n\u003c?php\n\nuse MayMeow\\ExcelImporter\\Models\\BaseModel;\n\nclass ExampleModel extends BaseModel\n{\n    #[\\MayMeow\\ExcelImporter\\Attributes\\Column('A')]\n    protected string $property;\n\n    public function getProperty()\n    {\n        return $this-\u003eproperty;\n    }\n}\n```\n\nread from file following example is reading from active sheet\n\n```php\n// ...\n\nuse MayMeow\\ExcelImporter\\Models\\ExampleModel;\nuse MayMeow\\ExcelImporter\\Writers\\ModelWriter;\nuse PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx;\n\n// ...\npublic function testImportingFile()\n{\n    $xlsxReader = new Xlsx();\n    $spreadsheet = $xlsxReader-\u003eload((new TestingDataLocator())-\u003elocateExcelFile());\n    $writer = new ModelWriter();\n    \n    /** @var array\u003cTestingModel\u003e $modelArray */\n    $modelArray = $writer-\u003ewrite(TestingModel::class, $spreadsheet);\n}\n// ...\n```\n\n## Files\n\nFor getting path to files you can create Locator by implementing `MayMeow\\ExcelImporter\\Tools\\FileLocatorInterface` which\nis not required by XLS reader but recommended.\n\n__License MIT__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaymeow%2Fexcel-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaymeow%2Fexcel-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaymeow%2Fexcel-importer/lists"}