PHPackages                             biblys/data-client-php - 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. biblys/data-client-php

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

biblys/data-client-php
======================

Biblys Data PHP client library

0.3.0(10y ago)44.3k↓90.9%[3 PRs](https://github.com/biblys/biblys-data-client-php/pulls)MITPHPPHP &gt;=5.6.0

Since Mar 5Pushed 6y ago1 watchersCompare

[ Source](https://github.com/biblys/biblys-data-client-php)[ Packagist](https://packagist.org/packages/biblys/data-client-php)[ Docs](https://github.com/biblys/biblys-data-client-php)[ RSS](/packages/biblys-data-client-php/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (3)Versions (9)Used By (0)

Biblys Data PHP client library
==============================

[](#biblys-data-php-client-library)

[![Build Status](https://camo.githubusercontent.com/03c64488ba6d8b2ca722a8832c8a6b2041a509143513244ecfa13bf74375f4bb/68747470733a2f2f7472617669732d63692e6f72672f6269626c79732f6269626c79732d646174612d636c69656e742d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/biblys/biblys-data-client-php)

A PHP library to fetch data from or push data to [Biblys Data](https://data.biblys.fr/).

Install
-------

[](#install)

With composer:

Install with composer:

`composer require biblys/data-client-php:~0`

API
---

[](#api)

### Client

[](#client)

#### $client = new Client(array options)

[](#client--new-clientarray-options)

Initialize a new Biblys Data client.

Options:

- `apiKey`: optional when reading data from server, only required when pushing data to server
- `server`: optional, defaults to `http://data.biblys.fr`

#### $client-&gt;getBook(string $isbn)

[](#client-getbookstring-isbn)

Get book infos from Biblys Data server for this ISBN.

Returns a `Book` object if an object was found for this ISBN, returns false otherwise.

#### $client-&gt;pushBook(Book $book)

[](#client-pushbookbook-book)

Send the `Book` object to server. Will test if there is already a book with this ISBN with `getBook()`. If there is, will use the `updateBook()` method to update it. Else, will use the `createBook()` method to create it.

#### $client-&gt;createBook(Book $book)

[](#client-createbookbook-book)

Will try create the book on the server. Throws an exception if there is already a book with this ISBN.

#### $client-&gt;updateBook(Book $book)

[](#client-updatebookbook-book)

Not yet implemented on the server (will fail silently).

#### $client-&gt;pushPublisher(Publisher $publisher)

[](#client-pushpublisherpublisher-publisher)

Send the `Publisher` object to server. Will test if there is already a book with this id with `getPublisher()`. If there is, will use the `updatePublisher()` method to update it. Else, will use the `createPublisher()` method to create it.

#### $client-&gt;createPublisher(Publisher $publisher)

[](#client-createpublisherpublisher-publisher)

Will try create the book on the server. Throws an exception if there is already a book with this ISBN.

#### $client-&gt;updatePublisher(Publisher $publisher)

[](#client-updatepublisherpublisher-publisher)

Not yet implemented on the server (will fail silently).

### Book

[](#book)

#### $book = new Book()

[](#book--new-book)

Create a new `Book` object

#### $book-&gt;setEan(string $isbn)

[](#book-seteanstring-isbn)

Set the book's ISBN. Throws an exception `$isbn` is not a valid ISBN.

#### $book-&gt;getEan()

[](#book-getean)

Get the book's ISBN.

#### $book-&gt;setTitle(string $title)

[](#book-settitlestring-title)

Set the book's title

#### $book-&gt;getTitle()

[](#book-gettitle)

Get the book's title

#### $book-&gt;setPublisher(Publisher $publisher)

[](#book-setpublisherpublisher-publisher)

Associate a Publisher resource with the book

#### $book-&gt;getPublisher()

[](#book-getpublisher)

Get the book's publisher as a Publisher object

#### $book-&gt;setAuthors(array $authors)

[](#book-setauthorsarray-authors)

Set the book's authors (must be an array of Contributor objects)

#### $book-&gt;addAuthor(Author $author)

[](#book-addauthorauthor-author)

Associate a Contributor with the book as an author

#### $book-&gt;getAuthors()

[](#book-getauthors)

Get the book's authors as an array of Contributor objects

### Contributor

[](#contributor)

Multiple contributors can be associated with book as authors. Other roles (illustrator, translator, etc.) will come later.

#### $contributor = new Contributor()

[](#contributor--new-contributor)

Create a new `Contributor` object

#### $contributor-&gt;setId(string $id)

[](#contributor-setidstring-id)

Set the contributor's id.

#### $contributor-&gt;getId()

[](#contributor-getid)

Get the contributor's id.

#### $contributor-&gt;setFirstName(string $firstName)

[](#contributor-setfirstnamestring-firstname)

Set the contributor's first name

#### $contributor-&gt;getFirstName()

[](#contributor-getfirstname)

Get the contributor's first name

#### $contributor-&gt;setLastName(string $lastName)

[](#contributor-setlastnamestring-lastname)

Set the contributor's last name

#### $contributor-&gt;getLastName()

[](#contributor-getlastname)

Get the contributor's last name

#### $contributor-&gt;setName(string $name)

[](#contributor-setnamestring-name)

Set the contributor's full name (first + last names)

#### $contributor-&gt;getName()

[](#contributor-getname)

Get the contributor's full name (first + last names)

### Publisher

[](#publisher)

A publisher resource can be associated with a book.

#### $publisher = new Publisher()

[](#publisher--new-publisher)

Create a new `Publisher` object

#### $publisher-&gt;setId(string $id)

[](#publisher-setidstring-id)

Set the publisher's id.

#### $publisher-&gt;getId()

[](#publisher-getid)

Get the publisher's id.

#### $publisher-&gt;setName(string $name)

[](#publisher-setnamestring-name)

Set the publisher's name

#### $publisher-&gt;getName()

[](#publisher-getname)

Get the publisher's name

Examples
--------

[](#examples)

Get a book's infos from an ISBN

```
use Biblys\Data\Client;

$client = new Client();

$result = $client->getBook('9791091146134');

if (!$result) {
  // Result if false, no book was found for this ISBN
} else {
  echo $result->getTitle();
}
```

Push a book's infos to server

```
use Biblys\Data\Client;
use Biblys\Data\Book;
use Biblys\Data\Publisher;

$client = new Client([
  "apiKey" => "YOUR_API_KEY" // required when pushing data
]);

$book = new Book();
$book->setEan('9791091146134');
$book->setTitle('Chants du cauchemar et de la nuit');

$publisher = new Publisher();
$publisher->setName('Dystopia');
$book->setPublisher($publisher);

$author = new Contributor();
$author->setFirstName('Thomas');
$author->setLastName('Ligotti');
$book->addAuthor($author);

try {
  $result = $client->push($book);
} catch (Exception $e) {
  // Something went wrong
}
```

Test
----

[](#test)

Run tests with PHPUnit:

- `composer install`
- `composer test`

Changelog
---------

[](#changelog)

0.3.0 (2016-04-05)

- Contributor push, create and get methods
- Books must be pushed with at least one Contributor as an author

0.2.1 (2016-03-25)

- Fixed getting Publisher with Book
- Require Publisher property when creating a Book

0.2.0 (2016-03-24)

- Publisher push, create and get methods
- Book must be pushed with a Publisher

0.1.0 (2016-03-05)

- First release
- Book push, create and get methods

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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.

###  Release Activity

Cadence

Every ~7 days

Total

4

Last Release

3742d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.3.0

0.2.1PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/926525a3d3343a9e66413df33e959478db9f5d88b1745c14fa840b445171bd2d?d=identicon)[biblys](/maintainers/biblys)

---

Top Contributors

[![clemlatz](https://avatars.githubusercontent.com/u/5627688?v=4)](https://github.com/clemlatz "clemlatz (58 commits)")

---

Tags

ISBNbookBibliographyBiblys

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/biblys-data-client-php/health.svg)

```
[![Health](https://phpackages.com/badges/biblys-data-client-php/health.svg)](https://phpackages.com/packages/biblys-data-client-php)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

749284.3k35](/packages/civicrm-civicrm-core)[roundcube/roundcubemail

The Roundcube Webmail suite

7.0k1.4k3](/packages/roundcube-roundcubemail)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[nicebooks/isbn

ISBN tools

27352.4k3](/packages/nicebooks-isbn)

PHPackages © 2026

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