PHPackages                             tomcan/feed-importer - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. tomcan/feed-importer

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

tomcan/feed-importer
====================

Package to download and parse csv product feeds

v0.2.0(1y ago)023proprietaryPHP

Since Nov 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/TomCan/feed-importer)[ Packagist](https://packagist.org/packages/tomcan/feed-importer)[ RSS](/packages/tomcan-feed-importer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Tom's Feed Importer
===================

[](#toms-feed-importer)

Because everybody loves importing csv files...

Why?
----

[](#why)

Importing data from csv feeds can be hard. Often you'll end up with a custom implementation, closely coupling the downloading, reading, processing of the data. Each of them comes with their own difficulties and complexity. Is it on disk, http or a SSL authenticated ftp? Do you even have enough memory or diskspace available to download and extract that 2GB large gzipped, 12GB unzipped products.csv.gz?

The result is often a mess of control code mixed in with your business logic. And then you need to do the same but differently for another feed, and you end up duplicating half of your code and rewriting the rest. I have been there too! And I was feed up with it (pun intended).

What
----

[](#what)

What if I told you that you now can just define the feed, write your logic to process a single record and be done?

Tom's Feed Importer abstracts all the feed handling parts away and just gives you the records one by one, so that you can process them in small, sizeable parts.

You can either use a foreach / generator approach, or a callback function. Whichever suits your needs the best.

### With foreach / generator

[](#with-foreach--generator)

```
    // define the feed
    $feed = new FeedDefinition(['url' => 'https://raw.githubusercontent.com/TomCan/feed-importer/refs/heads/main/samples/toms-favorite-names.csv']);

    // instantiate processor without callback
    $processor = new FeedProcessorCsv($feed);
    // instantiate downloader
    $downloader = new FeedDownloader($feed, $processor);
    // use ->generate function
    foreach ($downloader->generate() as $row) {
        echo 'Got a record: '.str_replace(PHP_EOL, ' ', print_r($row, true)).PHP_EOL;
    }
    // profit

```

### With callback function

[](#with-callback-function)

```
    // define the feed
    $feed = new FeedDefinition(['url' => 'https://raw.githubusercontent.com/TomCan/feed-importer/refs/heads/main/samples/toms-favorite-names.csv']);

    // write your callback
    $callback = function (array $row) {
        echo 'Got a record: '.str_replace(PHP_EOL, ' ', print_r($row, true)).PHP_EOL;
    };

    // instantiate processor with callback
    $processor = new FeedProcessorCsv($feed, $callback);
    // instantiate downloader
    $downloader = new FeedDownloader($feed, $processor);
    // use ->download function
    $downloader->download();
    // profit

```

It mostly comes down to defining your feed parameters with a `FeedDefinition`. See the [`options`](docs/options.md) page in the docs for a reference of the available options.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

538d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a525acc6df0983b6cc74121062bc2ec4cfcb163a2252ba1fb27d5e04ff67243d?d=identicon)[TomCan](/maintainers/TomCan)

---

Top Contributors

[![TomCan](https://avatars.githubusercontent.com/u/2892620?v=4)](https://github.com/TomCan "TomCan (8 commits)")

### Embed Badge

![Health badge](/badges/tomcan-feed-importer/health.svg)

```
[![Health](https://phpackages.com/badges/tomcan-feed-importer/health.svg)](https://phpackages.com/packages/tomcan-feed-importer)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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