<commit_before># biblys/isbn

[![Build Status](https://travis-ci.org/biblys/isbn.svg?branch=master)](https://travis-ci.org/biblys/isbn)

This package can be used to:

- validate an ISBN code
- convert codes between ISBN-10, ISBN-13 and EAN (without hyphens) formats
- calculate the checksum digit
- show the registration agency (country or language)

## Installation

Install with composer:

```console
composer require biblys/isbn:^2.1.1
```

## Usage

Use case: converting an EAN (9782843449499) to an ISBN-13 (978-2-84344-949-9).

```php
<?php

use Biblys\Isbn\Isbn as Isbn;

$isbn = new Isbn('9782843449499');

try {
    $isbn->validate();
    $isbn13 = $isbn->format("ISBN-13");<commit_msg>Doc : fix code example<commit_after># biblys/isbn

[![Build Status](https://travis-ci.org/biblys/isbn.svg?branch=master)](https://travis-ci.org/biblys/isbn)

This package can be used to:

- validate an ISBN code
- convert codes between ISBN-10, ISBN-13 and EAN (without hyphens) formats
- calculate the checksum digit
- show the registration agency (country or language)

## Installation

Install with composer:

```console
composer require biblys/isbn:^2.1.1
```

## Usage

Use case: converting an EAN (9782843449499) to an ISBN-13 (978-2-84344-949-9).

```php
<?php

use Biblys\Isbn\Isbn as Isbn;
// require_once __DIR__.'/vendor/autoload.php';

$ean = '9782843449499';
$isbn = new Isbn($ean);

try {
    $isbn->validate();
    $isbn13 = $isbn->format("ISBN-13");
{'fraction_non_alphanumeric': 0.1506849315068493, 'fraction_numerical': 0.07123287671232877, 'mean_word_length': 4.274368231046932, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1282474', 'n_tokens_mistral': 610, 'n_tokens_neox': 547, 'n_words': 140}