PHPackages                             imarc/craft-sheetsync - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. imarc/craft-sheetsync

ActiveCraft-plugin[PDF &amp; Document Generation](/categories/documents)

imarc/craft-sheetsync
=====================

Allows you to import CSV, XLSX, and other spreadsheet files into Craft sections as entries.

0.13.13(5y ago)0573MITPHPCI failing

Since Jul 27Pushed 5y ago18 watchersCompare

[ Source](https://github.com/imarc/craft-sheetsync)[ Packagist](https://packagist.org/packages/imarc/craft-sheetsync)[ RSS](/packages/imarc-craft-sheetsync/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (25)Used By (0)

CSV Sync plugin for Craft CMS 3.x
=================================

[](#csv-sync-plugin-for-craft-cms-3x)

Allows you to import/sync spreadsheet files into Craft sections as entries.

Configuration
-------------

[](#configuration)

Settings should be configured in craft/config/sheet-sync.php. Default settings are grouped together, and other settings are grouped by the name of the sync:

```
return [
    'default' => [
        // default sync settings
    ],
    'name-of-a-sync' => [
        // sync specific settings
    ],
];

```

### Valid Settings

[](#valid-settings)

- **section** - the handle for the CMS section you'd like to sync to.
- **filename** - the name of the file you would like to sync (if not specified when the sync is called.)
- **entry\_type\_id** (optional) - if there's multiple entry types within the section, this will let you specify which one to use for new entries. If there's only one entry type, you don't need to specify this.
- **find** - this should be a closure (or callable) that takes two arguments, `$criteria` and `$row`, that modifies `$criteria` to pullback the corresponding entry to `$row` if it exists.
- **slug** - this is either a string (the handle for a field) or a closure (or callable.) If it's a string, then the plugin will use that field to generate a slug for the entry. If it's a closure, it's passed the current entry and expected to return a valid slug.
- **fields** - see the next section.
- **authorId** (default: 1) - ID to attribute creating entries to.
- **delimiter**, **enclosure**, and **escape** (default: ',' '"' and '\\') - these are passed directly to `fgetcsv()`.
- **reader** (optional) - Allows you to override the class used to read the file. For example, you may want to set this to `\imarc\sheetsync\services\PlainCsv` to use the significantly more performance reader that just uses fgetcsv() instead of phpoffice/phpspreadsheet.
- **headers** (optional) - Allows you override how headers for the sheet are determined. By default, the plugin will use the first row, but you can return a static array of headers, or you can write a function that takes the `$reader` as an argument and read in (and/or skip) multiple rows.
- **cleanUpOnKey** (optional) - When set, will delete any entries with this key set that aren't in the current sheet.
- **minImport** (default: 0) - Cleanup will only run if more than this number of entries were updated or created.

#### Fields

[](#fields)

Fields are configured as an associative array. The key should be the name of a Craft field handle. The value can either be a string (and one of the CSV file column headers), or a closure (or callable) that is passed the current row (as an associative array) and the sync instance, that should return the value for this field. These closures are called **after** other populating is done, so if you need to cross reference, you can. For example, this will search through the current section for users by name based on the current row's value in 'Assistant Name' and create the relationship for Craft:

```
    // ...
    'fields' => [
        // ...
        'someUsers' => function($row, $sync) {
            $criteria = craft()->elements->getCriteria(ElementType::Entry);
            $criteria->sectionId = $sync->section->id;
            $criteria->type = $sync->entry_type_id;
            $criteria->name = $row['Assistant Name'];
            $entries = $criteria->find();

            if (count($entries)) {
                return [(int) (current($entries)->id)];

            } else {
                return null;
            }
        },
    ],
    // ...

```

##### Builtin Fields

[](#builtin-fields)

You can also overwrite all of the following builtin fields. Under most circumstances, you'll only set `id` and `title`. It's important to note that for date fields, Craft expects an instance of `DateTime` and not just a numeric timestamp or string.

- authorId - integer
- dateCreated - DateTime
- dateUpdated - DateTime
- enabled - boolean
- enabledForSite - boolean - normally this is set automatically when you provide `siteId` values
- expiryDate - DateTime
- id - integer
- postDate - DateTime
- revisionNotes - string
- slug - string
- title - string

Here's an example of what you might put in your config/sheet-sync.php file to deal with a date field:

```
    'expiryDate' => function($row) {
        return new DateTime($row['expiration']);
    },

```

It's handy to remember that `DateTime`'s constructor can handle all kinds of strings too, such as 'next month', '+90 days', etc.

Usage
-----

[](#usage)

The most common way to use this is to access if via the Craft Control Panel under Utilities, Sheet Import. From there, you can select the name of the sync you'd like to run and (optionally) upload a CSV file.

### Via Command Line

[](#via-command-line)

To run a sync, first navigate to the folder in /var/www/ that has craft. Then

```
$ php craft sheet-sync/default/sync --name='name-of-a-sync'

```

You can optionally specify a specific file to use:

```
$ php craft sheet-sync/default/sync --name='name-of-a-sync' --file=path/to/file

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 89.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~45 days

Recently: every ~175 days

Total

24

Last Release

1861d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c423d4aa457201693aadc0ffd67895f3383709e89c66547949d65a37123ee22?d=identicon)[khamer](/maintainers/khamer)

---

Top Contributors

[![khamer](https://avatars.githubusercontent.com/u/1452?v=4)](https://github.com/khamer "khamer (42 commits)")[![PGInfor](https://avatars.githubusercontent.com/u/44030106?v=4)](https://github.com/PGInfor "PGInfor (4 commits)")[![kerrig](https://avatars.githubusercontent.com/u/1864417?v=4)](https://github.com/kerrig "kerrig (1 commits)")

---

Tags

excelxlsxlsxcsvspreadsheetimportcmsCraftcraftcmscraft-pluginsync

### Embed Badge

![Health badge](/badges/imarc-craft-sheetsync/health.svg)

```
[![Health](https://phpackages.com/badges/imarc-craft-sheetsync/health.svg)](https://phpackages.com/packages/imarc-craft-sheetsync)
```

###  Alternatives

[avadim/fast-excel-reader

Lightweight and very fast XLSX Excel Spreadsheet and CSV Reader in PHP

106693.8k9](/packages/avadim-fast-excel-reader)[nuovo/spreadsheet-reader

Spreadsheet reader library for Excel, OpenOffice and structured text files

668883.3k8](/packages/nuovo-spreadsheet-reader)[jgrygierek/batch-entity-import-bundle

Importing entities with preview and edit features for Symfony.

101.1M1](/packages/jgrygierek-batch-entity-import-bundle)[jgrygierek/sonata-batch-entity-import-bundle

Importing entities with preview and edit features for Sonata Admin.

10955.3k](/packages/jgrygierek-sonata-batch-entity-import-bundle)[emiliogrv/nova-batch-load

A Laravel Nova XLS &amp; CSV importer

1641.9k](/packages/emiliogrv-nova-batch-load)[seine/seine

Seine - Write spreadsheets of various formats to a stream

1270.5k](/packages/seine-seine)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
