survos / grid-group-bundle
Handle groups of CSV as a spreadsheet
Package info
github.com/survos/SurvosGridGroupBundle
Type:symfony-bundle
pkg:composer/survos/grid-group-bundle
Fund package maintenance!
Requires
- php: ^8.3
- illuminate/collections: ^10.9 || ^11.37
- league/csv: ^9.9
- symfony/config: ^7.3
- symfony/dependency-injection: ^7.3
- symfony/dotenv: ^7.3
- symfony/form: ^7.3
- symfony/http-kernel: ^7.3
- symfony/string: ^7.3
- twig/twig: ^3.4
Requires (Dev)
- php-parallel-lint/php-parallel-lint: ^1.3
- phpro/grumphp: ^1.16
- phpstan/phpstan: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^11.4
- rector/rector: dev-main
- symfony/browser-kit: ^7.3
- symfony/framework-bundle: ^7.3
- symfony/phpunit-bridge: ^7.3
- symfony/twig-bundle: ^7.3
- symfony/var-dumper: ^7.3
- symfony/yaml: ^7.3
Conflicts
- survos/api-grid-bundle: <1.2.57
- survos/auth-bundle: <1.2.57
- survos/barcode-bundle: <1.2.57
- survos/bootstrap-bundle: <1.2.57
- survos/command-bundle: <1.2.57
- survos/core-bundle: <1.2.57
- survos/crawler-bundle: <1.2.57
- survos/doc-bundle: <1.2.57
- survos/faker-bundle: <1.2.57
- survos/grid-bundle: <1.2.57
- survos/html-prettify-bundle: <1.2.57
- survos/import-bridge: <1.2.57
- survos/inspection-bundle: <1.2.57
- survos/location-bundle: <1.2.57
- survos/maker-bundle: <1.2.57
- survos/providence-bundle: <1.2.57
- survos/ruler-bundle: <1.2.57
- survos/stripe-product: <1.2.57
- survos/tree-bundle: <1.2.57
- survos/wiki-bundle: <1.2.57
- survos/workflow-helper-bundle: <1.2.57
This package is auto-updated.
Last update: 2026-06-12 18:10:44 UTC
README
Under development! And will probably be replaced by Pixy/Pixie/KeyValue bundle, which uses Sqlite instead of csv. But some tools here could be helpful.
A bundle to manipulate a set of CSV files as a database. The idea is to avoid having to create temporary entities or models during the data import.
CsvParser
The CSV Reader class is an excellent way to read records from csv.
$csv = Reader::createFromPath('/path/to/file.csv', 'r'); $csv->setHeaderOffset(0); $header_offset = $csv->getHeaderOffset(); //returns 0 $header = $csv->getHeader(); //returns ['First Name', 'Last Name', 'E-mail']
Example: create a simple related table.
Given a movie CSV table, create a CsvDatabase (GridGroup?)
id,title,poster,overview,release_date,genres 287947,Shazam!,https://image.tmdb.org/t/p/w500/xnopI5Xtky18MPhK40cZAGAOVeV.jpg,"A boy is given the ability to become an adult superhero in times of need with a single magic word.",1553299200,"Action, Comedy, Fantasy" 299537,"Captain Marvel",https://image.tmdb.org/t/p/w500/AtsgWhDnHTq68L0lLsUrCnM7TjG.jpg,"The story follows Carol Danvers as she becomes one of the universe’s most powerful heroes when Earth is caught in the middle of a galactic war between two alien races. Set in the 1990s, Captain Marvel is an all-new adventure from a previously unseen period in the history of the Marvel Cinematic Universe.",1551830400,"Action, Adventure, Science Fiction"
Create a movie.csv and genre.csv, with genre counts as an extra field
We need a schema to define the output csv database, which we can create by naming the fields.
$gridGroup = new GridGroup('movie_and_genre'); $grid = (new \Survos\GridGroupBundle\Model\Grid('movie')); $grid->addRow()