Skip to content

Overview

A dataset is a catalog ready to be loaded into Sylius: its products and collections (products.yaml, collections.yaml), their images (media/) and a dataset.yaml describing it. Loading one makes no AI call and downloads nothing.

PackageTasks
opencolibri/starter-datasetsnone: ready-made datasets
opencolibri/starter-fixturessylius:dataset:list, sylius:dataset:load, sylius:dataset:unload
opencolibri/starter-dataset-buildersylius:dataset:build, sylius:dataset:images, sylius:dataset:export, sylius:dataset:delete
opencolibri/starter-sales-kitsylius:shop:*: demo shops created from datasets
Terminal window
castor sylius:dataset:list # the datasets, with their number of products and images
castor sylius:dataset:load cellar # load it into the default channel
castor sylius:dataset:unload # remove it

sylius:dataset:load puts the catalog into the default channel (WEB_STORE, created by the app fixture suite): taxons under a root taxon used as the channel menu, products with their image, prices (a few of them on promo). Loading another dataset replaces it, and the rest of the channel (its orders, its admins, the products you created) is kept. --limit caps the number of products.

Start from a store without products with castor app:db:fixtures app first: the default fixtures add clothing to the channel.

Under the hood, the task writes the fixtures of the catalog into the app (config/sylius/fixtures/import/catalog/), mirrors the images of the dataset into var/import/catalog/media/ (the containers loading the fixtures only mount the app directory), points the import fixture suite at them, removes the catalog loaded before (sylius:import:channel:reset, a command of the app) and loads the suite.

cellar/
├── dataset.yaml name, description, url, source, theme (suggested), created_at
├── products.yaml
├── collections.yaml
└── media/ the images, in WebP
products.yaml
products:
- title: 'Château des Aulnes — Saint-Émilion Grand Cru 2019'
collection_name: Bordeaux # the name of its collection
price_eur: 34.9
image: media/chateau_des_aulnes.webp
description: 'Merlot and cabernet franc from limestone slopes…'
# collections.yaml
collections:
- name: Bordeaux
image: media/collection_bordeaux.webp # optional, shown on the homepage category tiles
  • A product belongs to the collection named by collection_name; one of an unknown collection goes to the root taxon.
  • A collection with a parent (the name or code of another collection) is shown under it: a two-level menu (e.g. Men > T-shirts). Its collections then have a code, as a child name may repeat across groups (Men > T-shirts, Women > T-shirts), and products point at it with collection: <code>.
  • An image is a path relative to the dataset directory. A URL or an image_prompt is only the leftover of a built dataset whose images were not stored: sylius:dataset:images stores them.
  • A product code (optional) keeps its Sylius code stable; it is derived from the title otherwise.
  • A flat menu shows the twelve collections holding the most products.

The format is read by OpenColibri\Starter\Core\Dataset\Dataset, and the datasets are listed by Datasets.

opencolibri/starter-datasets ships ready-made datasets, images included:

DatasetCatalogSuggested theme
automotiveEighteen car parts, tyres, tools and workshop equipmentTorque
bloomEighteen beauty products and tools, on six shelvesBloom
cellarSeventeen wines from fictional estates, in seven regionsCellar
cultureEighteen books, games, instruments and collectiblesCulture
depotEighteen trade supplies and equipment, in six aislesDepot
grooveSixteen fictional vinyl records, in six genresGroove
homeEighteen pieces of furniture, lighting, linen and tablewareHearth
outdoorEighteen pieces of hiking, climbing and camping gearSummit
petsEighteen foods, treats, toys, beds and care products for petsPaws
retro-gamingSixteen retro consoles, games and accessories, on six shelvesRetro Gaming
roasterySixteen specialty coffees and brewing tools, on six shelvesRoastery
supermarketNine everyday groceries, one per supermarket aisleDrive
teahouseSixteen fine teas and pieces of teaware, on six shelvesTeahouse
techSixteen devices from fictional brands, in six departmentsTech
video-gamesSixteen fictional video games, in six genresArena

To add one, drop its directory in src/Datasets/datasets/ (an exported dataset has that layout). Every product needs a local image, a collection may have one: the package tests check them. Another package can ship its own datasets, see Extending.