PHPackages                             aaron-apelt/akeneo-php-lib - 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. [API Development](/categories/api)
4. /
5. aaron-apelt/akeneo-php-lib

ActiveLibrary[API Development](/categories/api)

aaron-apelt/akeneo-php-lib
==========================

An extension of the Akeneo PHP API client for easier Akeneo service development.

v1.2.1(2mo ago)04MITPHPPHP ^8.4CI passing

Since Jan 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/aaron-apelt/akeneo-php-lib)[ Packagist](https://packagist.org/packages/aaron-apelt/akeneo-php-lib)[ RSS](/packages/aaron-apelt-akeneo-php-lib/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (7)Versions (6)Used By (0)

Akeneo PHP Lib
==============

[](#akeneo-php-lib)

A modern, type-safe PHP library for interacting with the [Akeneo PIM API](https://api.akeneo.com/). Designed for clean domain models, batch processing, and flexible (de)serialization.

---

Features
--------

[](#features)

- **Akeneo Object Abstractions**: Simple entity models for Akeneo objects.
- **Adapters**: Easy-to-use adapters for batch import/export with Akeneo.
- **Fluent Collections**: Powerful, lazy-evaluated collection operations.
- **Flexible Serialization**: Customizable serialization/denormalization.
- **Querying**: Query builder for advanced product searches.
- **Batch Upserts**: Efficient upsert and callback handling for large-scale imports.
- **Strict Types &amp; Modern PHP**: Uses PHP 8+ features and strict typing throughout.

---

Installation
------------

[](#installation)

```
composer require aaron-apelt/akeneo-php-lib
```

---

Basic Usage
-----------

[](#basic-usage)

### Instantiate the Adapter

[](#instantiate-the-adapter)

```
use Akeneo\Pim\ApiClient\AkeneoPimClientBuilder;
use AkeneoLib\Adapter\ProductAdapter;
use AkeneoLib\Serializer\Serializer;

$clientBuilder = new AkeneoPimClientBuilder('https://your-akeneo-url.example.com');
$client = $clientBuilder
    ->buildAuthenticatedByPassword('client_id', 'secret', 'user', 'password');

$productApi = $client->getProductApi();
$serializer = new Serializer();

$adapter = new ProductAdapter($productApi, $serializer);
```

### Fetch Products

[](#fetch-products)

```
foreach ($adapter->all() as $product) {
    // $product is an instance of AkeneoLib\Entity\Product
    echo $product->getIdentifier();
}
```

### Working with Fluent Collections

[](#working-with-fluent-collections)

The `all()` method returns a `FluentAdapterResult` that supports lazy-evaluated collection operations:

```
use AkeneoLib\Search\QueryParameter;

// Chain operations - only processes items as needed
$adapter->all()
    ->filter(fn($product) => $product->isEnabled())
    ->map(fn($product) => $product->getIdentifier())
    ->take(100)
    ->toArray();

// Pagination
$page2 = $adapter->all()
    ->skip(50)
    ->take(50)
    ->toArray();

// Execute side effects while maintaining chain ability
$adapter->all()
    ->each(fn($product) => logger()->info("Processing {$product->getIdentifier()}"))
    ->filter(fn($product) => $product->getFamily() === 'electronics')
    ->toArray();

// Terminal operations
$firstEnabled = $adapter->all()->first(fn($p) => $p->getEnabled());
$lastProduct = $adapter->all()->last();

// Practical reduce example - collect all identifiers
$identifiers = $adapter->all()->reduce(
    fn($acc, $product) => [...$acc, $product->getIdentifier()],
    []
);
```

#### Available Methods

[](#available-methods)

**Lazy Operations** (maintain lazy evaluation):

- `filter(callable $callback)` - Filter items
- `map(callable $callback)` - Transform items
- `each(callable $callback)` - Execute side effects
- `take(int $limit)` - Limit to first N items
- `skip(int $count)` - Skip first N items
- `chunk(int $size)` - Split into chunks

**Terminal Operations** (materialize the collection):

- `toArray()` - Convert to array
- `first(?callable $callback = null)` - Get first item
- `last(?callable $callback = null)` - Get last item
- `reduce(callable $callback, $initial)` - Reduce to single value
- `sort(callable $callback)` - Sort items (⚠️ loads all into memory)
- `unique(?callable $callback = null)` - Filter duplicates (⚠️ loads all into memory)

**Note**: Operations marked with ⚠️ materialize the entire collection into memory. Use with caution on large datasets from API cursors.

### Upsert Products in Batches

[](#upsert-products-in-batches)

```
$product = new AkeneoLib\Entity\Product('my-sku');
// ...set properties, values, etc.

$adapter->stage($product); // Will push automatically when batch size is reached
$adapter->push();          // Manually push any remaining staged products
```

### Custom Response Callback

[](#custom-response-callback)

```
$adapter->onResponse(function ($response, $products, $dateTime) {
    // Handle API response or log batch import results here
});
```

---

Advanced
--------

[](#advanced)

- **Querying**: Use `AkeneoLib\Search\QueryParameter` to filter, sort, and paginate.
- **Custom Serialization**: Swap out or configure the serializer.

---

Testing
-------

[](#testing)

This library is tested with [Pest](https://pestphp.com/).
To run tests:

```
composer install
composer test
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance85

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.9% 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 ~9 days

Total

4

Last Release

79d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dac64b9a7a6e4c2a533a8eb99d8032bebbcb1341cb6a277a424a6678b1b6c51?d=identicon)[aaron-apelt](/maintainers/aaron-apelt)

---

Top Contributors

[![aaron-apelt](https://avatars.githubusercontent.com/u/190078237?v=4)](https://github.com/aaron-apelt "aaron-apelt (94 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (2 commits)")

---

Tags

akeneoapiclientlibrarypimapiclientecommercePIMakeneo

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aaron-apelt-akeneo-php-lib/health.svg)

```
[![Health](https://phpackages.com/badges/aaron-apelt-akeneo-php-lib/health.svg)](https://phpackages.com/packages/aaron-apelt-akeneo-php-lib)
```

###  Alternatives

[api-platform/symfony

Symfony API Platform integration

323.2M67](/packages/api-platform-symfony)[apigee/apigee-client-php

Client library for connecting to the Apigee Edge API.

27558.7k3](/packages/apigee-apigee-client-php)[akeneo/magento-connector-bundle

Akeneo PIM bundle to export to Magento platform

582.2k](/packages/akeneo-magento-connector-bundle)[synolia/sylius-akeneo-plugin

Akeneo connector for Sylius.

2696.0k](/packages/synolia-sylius-akeneo-plugin)[bornfight/erste-bank-client

Client written in PHP for Erste Bank API

106.1k](/packages/bornfight-erste-bank-client)

PHPackages © 2026

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