PHPackages                             chrisullyott/csv-to-grav - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. chrisullyott/csv-to-grav

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chrisullyott/csv-to-grav
========================

Migrate a site to Grav, a flat-file CMS.

4122[1 issues](https://github.com/chrisullyott/csv-to-grav/issues)PHP

Since Jan 1Pushed 8y agoCompare

[ Source](https://github.com/chrisullyott/csv-to-grav)[ Packagist](https://packagist.org/packages/chrisullyott/csv-to-grav)[ RSS](/packages/chrisullyott-csv-to-grav/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

csv-to-grav
===========

[](#csv-to-grav)

[Grav](https://getgrav.org/) uses [Markdown](https://daringfireball.net/projects/markdown/syntax) files instead of a database to serve content. When migrating your website or blog to Grav, you'll need to convert your existing HTML content to Markdown, and arrange your posts in a directory structure that Grav can understand.

Some specific [migration assistants](https://learn.getgrav.org/migration) are available to help you do this, but if you just want to convert an arbitrary CSV into Grav posts, this tool can help. In summary, **csv-to-grav** reads a CSV file and builds a Grav file tree, converting your content to Markdown and your metadata to Yaml.

When finished, you'll only need to move the output directory into your Grav installation and use a [Collection](https://learn.getgrav.org/content/collections) to create a list and detail view of your content.

Setup
-----

[](#setup)

Install dependencies with [Composer](https://getcomposer.org/).

Run
---

[](#run)

Modify convert.php ...

```
$conversion = new CsvToGrav('example.csv');

$conversion->setColumnMap(array(
    'title' => 'example_title_field',
    'date'  => 'example_date_field',
    'html'  => 'example_html_field'
));

$count = $conversion->build();

echo "Created {$count} items.\n";

```

First, replace `example.csv` with the path of your spreadsheet. Then, fill in the `example_` field map with the names of the appropriate spreadsheet column. To create a Grav page, it's required to have a title, a date, and HTML content.

Finally, run the script! A directory `grav` will be created with the posts ready to go.

```
$ php convert.php

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1007459?v=4)[Chris](/maintainers/chrisullyott)[@chrisullyott](https://github.com/chrisullyott)

---

Top Contributors

[![chrisullyott](https://avatars.githubusercontent.com/u/1007459?v=4)](https://github.com/chrisullyott "chrisullyott (21 commits)")

### Embed Badge

![Health badge](/badges/chrisullyott-csv-to-grav/health.svg)

```
[![Health](https://phpackages.com/badges/chrisullyott-csv-to-grav/health.svg)](https://phpackages.com/packages/chrisullyott-csv-to-grav)
```

###  Alternatives

[dusterio/link-preview

Link preview generation for PHP with Laravel support

126330.1k3](/packages/dusterio-link-preview)

PHPackages © 2026

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