{"id":43324456,"url":"https://github.com/aaron-apelt/akeneo-php-lib","last_synced_at":"2026-02-01T23:04:44.733Z","repository":{"id":334405696,"uuid":"982412595","full_name":"aaron-apelt/akeneo-php-lib","owner":"aaron-apelt","description":"An extension of the Akeneo PHP API client for easier Akeneo service development.","archived":false,"fork":false,"pushed_at":"2026-01-24T18:12:23.000Z","size":144,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-25T02:50:29.372Z","etag":null,"topics":["akeneo","api","client","library","pim"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aaron-apelt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-12T21:03:03.000Z","updated_at":"2026-01-24T14:54:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aaron-apelt/akeneo-php-lib","commit_stats":null,"previous_names":["aaron-apelt/akeneo-php-lib"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aaron-apelt/akeneo-php-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaron-apelt%2Fakeneo-php-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaron-apelt%2Fakeneo-php-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaron-apelt%2Fakeneo-php-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaron-apelt%2Fakeneo-php-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaron-apelt","download_url":"https://codeload.github.com/aaron-apelt/akeneo-php-lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaron-apelt%2Fakeneo-php-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28993798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T22:01:47.507Z","status":"ssl_error","status_checked_at":"2026-02-01T21:58:37.335Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["akeneo","api","client","library","pim"],"created_at":"2026-02-01T23:04:44.199Z","updated_at":"2026-02-01T23:04:44.729Z","avatar_url":"https://github.com/aaron-apelt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Akeneo PHP Lib\n\nA modern, type-safe PHP library for interacting with the [Akeneo PIM API](https://api.akeneo.com/).\nDesigned for clean domain models, batch processing, and flexible (de)serialization.\n\n---\n\n## Features\n\n- **Akeneo Object Abstractions**: Simple entity models for Akeneo objects.\n- **Adapters**: Easy-to-use adapters for batch import/export with Akeneo.\n- **Fluent Collections**: Powerful, lazy-evaluated collection operations.\n- **Flexible Serialization**: Customizable serialization/denormalization.\n- **Querying**: Query builder for advanced product searches.\n- **Batch Upserts**: Efficient upsert and callback handling for large-scale imports.\n- **Strict Types \u0026 Modern PHP**: Uses PHP 8+ features and strict typing throughout.\n\n---\n\n## Installation\n\n```bash\ncomposer require aaron-apelt/akeneo-php-lib\n```\n\n---\n\n## Basic Usage\n\n### Instantiate the Adapter\n\n```php\nuse Akeneo\\Pim\\ApiClient\\AkeneoPimClientBuilder;\nuse AkeneoLib\\Adapter\\ProductAdapter;\nuse AkeneoLib\\Serializer\\Serializer;\n\n$clientBuilder = new AkeneoPimClientBuilder('https://your-akeneo-url.example.com');\n$client = $clientBuilder\n    -\u003ebuildAuthenticatedByPassword('client_id', 'secret', 'user', 'password');\n\n$productApi = $client-\u003egetProductApi();\n$serializer = new Serializer();\n\n$adapter = new ProductAdapter($productApi, $serializer);\n```\n\n### Fetch Products\n\n```php\nforeach ($adapter-\u003eall() as $product) {\n    // $product is an instance of AkeneoLib\\Entity\\Product\n    echo $product-\u003egetIdentifier();\n}\n```\n\n### Working with Fluent Collections\n\nThe `all()` method returns a `FluentAdapterResult` that supports lazy-evaluated collection operations:\n\n```php\nuse AkeneoLib\\Search\\QueryParameter;\n\n// Chain operations - only processes items as needed\n$adapter-\u003eall()\n    -\u003efilter(fn($product) =\u003e $product-\u003eisEnabled())\n    -\u003emap(fn($product) =\u003e $product-\u003egetIdentifier())\n    -\u003etake(100)\n    -\u003etoArray();\n\n// Pagination\n$page2 = $adapter-\u003eall()\n    -\u003eskip(50)\n    -\u003etake(50)\n    -\u003etoArray();\n\n// Execute side effects while maintaining chain ability\n$adapter-\u003eall()\n    -\u003eeach(fn($product) =\u003e logger()-\u003einfo(\"Processing {$product-\u003egetIdentifier()}\"))\n    -\u003efilter(fn($product) =\u003e $product-\u003egetFamily() === 'electronics')\n    -\u003etoArray();\n\n// Terminal operations\n$firstEnabled = $adapter-\u003eall()-\u003efirst(fn($p) =\u003e $p-\u003egetEnabled());\n$lastProduct = $adapter-\u003eall()-\u003elast();\n\n// Practical reduce example - collect all identifiers\n$identifiers = $adapter-\u003eall()-\u003ereduce(\n    fn($acc, $product) =\u003e [...$acc, $product-\u003egetIdentifier()], \n    []\n);\n```\n\n#### Available Methods\n\n**Lazy Operations** (maintain lazy evaluation):\n- `filter(callable $callback)` - Filter items\n- `map(callable $callback)` - Transform items\n- `each(callable $callback)` - Execute side effects\n- `take(int $limit)` - Limit to first N items\n- `skip(int $count)` - Skip first N items\n- `chunk(int $size)` - Split into chunks\n\n**Terminal Operations** (materialize the collection):\n- `toArray()` - Convert to array\n- `first(?callable $callback = null)` - Get first item\n- `last(?callable $callback = null)` - Get last item\n- `reduce(callable $callback, $initial)` - Reduce to single value\n- `sort(callable $callback)` - Sort items (⚠️ loads all into memory)\n- `unique(?callable $callback = null)` - Filter duplicates (⚠️ loads all into memory)\n\n**Note**: Operations marked with ⚠️ materialize the entire collection into memory. Use with caution on large datasets from API cursors.\n\n### Upsert Products in Batches\n\n```php\n$product = new AkeneoLib\\Entity\\Product('my-sku');\n// ...set properties, values, etc.\n\n$adapter-\u003estage($product); // Will push automatically when batch size is reached\n$adapter-\u003epush();          // Manually push any remaining staged products\n```\n\n### Custom Response Callback\n\n```php\n$adapter-\u003eonResponse(function ($response, $products, $dateTime) {\n    // Handle API response or log batch import results here\n});\n```\n\n---\n\n## Advanced\n\n- **Querying**: Use `AkeneoLib\\Search\\QueryParameter` to filter, sort, and paginate.\n- **Custom Serialization**: Swap out or configure the serializer.\n\n---\n\n## Testing\n\nThis library is tested with [Pest](https://pestphp.com/).  \nTo run tests:\n\n```bash\ncomposer install\ncomposer test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaron-apelt%2Fakeneo-php-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaron-apelt%2Fakeneo-php-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaron-apelt%2Fakeneo-php-lib/lists"}