{"id":18464810,"url":"https://github.com/krissss/php-data-exporter","last_synced_at":"2025-04-08T08:31:24.646Z","repository":{"id":41877102,"uuid":"447068410","full_name":"krissss/php-data-exporter","owner":"krissss","description":"Data Export for PHP","archived":false,"fork":false,"pushed_at":"2025-01-16T05:42:07.000Z","size":117,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T09:23:25.676Z","etag":null,"topics":["csvwriter","odswriter","php","xlsxwriter"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krissss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"kriss"}},"created_at":"2022-01-12T03:51:11.000Z","updated_at":"2024-08-13T10:50:18.000Z","dependencies_parsed_at":"2024-11-06T09:11:14.975Z","dependency_job_id":"98ffe73b-5caa-4474-9667-407015154042","html_url":"https://github.com/krissss/php-data-exporter","commit_stats":{"total_commits":51,"total_committers":3,"mean_commits":17.0,"dds":0.3137254901960784,"last_synced_commit":"1d6cc9a9513d2ee9d35269ab468dde141da357db"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":"krissss/package-skeleton-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krissss%2Fphp-data-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krissss%2Fphp-data-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krissss%2Fphp-data-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krissss%2Fphp-data-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krissss","download_url":"https://codeload.github.com/krissss/php-data-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247804448,"owners_count":20998983,"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":["csvwriter","odswriter","php","xlsxwriter"],"created_at":"2024-11-06T09:11:10.060Z","updated_at":"2025-04-08T08:31:24.378Z","avatar_url":"https://github.com/krissss.png","language":"PHP","funding_links":["https://github.com/sponsors/kriss"],"categories":[],"sub_categories":[],"readme":"# Data Export For PHP\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/kriss/data-export?style=flat-square)](https://packagist.org/packages/kriss/data-export)\n[![Tests](https://github.com/krissss/php-data-exporter/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/krissss/php-data-exporter/actions/workflows/run-tests.yml)\n[![Total Downloads](https://img.shields.io/packagist/dt/kriss/data-export?style=flat-square)](https://packagist.org/packages/kriss/data-export)\n\nWrap [sonata-project/exporter](https://github.com/sonata-project/exporter), make it easy and strong~\n\n## Feature\n\n- Simple api (use `DataExporter::csv()-\u003esaveAs()`)\n- Quick change for different output type (csv/xlsx/xls/ods...)\n- Support a lot of source, and can use array or iterator quickly \n- Low memory usage with huge data write (use csv/xlsxSpout)\n- Low memory usage with chunk data fetch and write by chain (use GeneratorChainSourceIterator)\n- Support `saveAs()` and `browserDownload()`\n- Support do something in writing (use ObjectEvent)\n- Support control Spreadsheet and Spout Instance, for change style and others (use Extend)\n- Support Excel multi sheet write (use ExcelSheetSourceIterator) \n- Support Dynamic source (use CallableSourceIterator)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require kriss/data-export\n```\n\n## Usage\n\n### simple Example\n\n```php\nuse \\Kriss\\DataExporter\\DataExporter;\n\n$source = [\n    ['aaa', 'bbb', 'ccc'],\n    ['aaa', 'bbb', 'ccc'],\n    ['aaa', 'bbb', 'ccc'],\n];\nDataExporter::csv($source, ['showHeaders' =\u003e false])-\u003esaveAs();\n```\n\n### Support Source\n\n- all source defined in [sonata-project/exporter](https://docs.sonata-project.org/projects/exporter/en/2.x/reference/sources/)\n- Simple source, Example in [Tests](./tests/Feature/SourceTest.php)\n- GeneratorChainSourceIterator, Example in [Tests](./tests/Feature/GeneratorChainSourceIteratorTest.php)\n- ExcelSheetSourceIterator, Example in [Tests](./tests/Feature/ExcelSheetSourceIteratorTest.php)\n- CallableSourceIterator, Example in [Tests](./tests/Feature/CallableSourceIteratorTest.php)\n\n### Support Writer\n\nAll Config in `DataExporter::writerConfig()`, see [Tests](./tests/Feature/WriterTest.php)\n\nYou can extend DataExporter and add Yours, see Example in [Tests](./tests/Feature/ExtraWriter.php)\n\n## FAQ\n\n\u003e Why [box/spout](https://github.com/box/spout) Use\n\n`box/spout` can write xlsx use stream, but `phpoffice/phpspreadsheet` not.\n`phpoffice/phpspreadsheet` use lots of memory when write huge data, but `box/spout` use few!\n\n\u003e When use `GeneratorChainSourceIterator`\n\nWhen you should handle huge source and need to merge them in one write.\n\n\u003e How to build style\n\nUse extension, see [ExtendSpoutTest](./tests/Feature/ExtensionSpoutTest.php) or [ExtendSpreadsheetTest](./tests/Feature/ExtensionSpreadsheetTest.php)\n\n\u003e How to write multi sheet\n\nUse ExcelSheetSpreadsheetTrait, see [ExcelSheetSourceIteratorTest](./tests/Feature/ExcelSheetSourceIteratorTest.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrissss%2Fphp-data-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrissss%2Fphp-data-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrissss%2Fphp-data-exporter/lists"}