Download the PHP package biblys/isbn without Composer
On this page you can find all versions of the php package biblys/isbn. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package isbn
biblys/isbn
biblys/isbn can be used to:
- validate a string against the ISBN-10, ISBN-13 and EAN-13 formats
- convert an ISBN to ISBN-10, ISBN-13, EAN-13, GTIN-14 and ISBN-A/DOI formats
- parse an ISBN to extract registration agency, publisher code, publication code, checksum, etc.
Installation
- Requirements: PHP 7.2 or above
Install with composer:
Usage
Convert
Use case: converting an EAN (9782843449499) to an ISBN-13 (978-2-84344-949-9).
All formatting methods:
Isbn::convertToIsbn10
Isbn::convertToIsbn13
Isbn::convertToEan13
Isbn::convertToGtin14
Isbn::convertToIsbnA
Validate
Use case: validating an incorrectly formed ISBN-13 (978-2-843-44949-9, should be 978-2-84344-949-9).
All validating methods:
Isbn::validateAsIsbn10
Isbn::validateAsIsbn13
Isbn::validateAsEan13
Isbn::isParsable
Learn more about validating ISBNs
Parse
Use case: extracting the publisher code from an ISBN.
Isbn::parse
returns a ParsedIsbn
object implementing the following methods:
ParsedIsbn->getGs1Element
:: EAN product codeParsedIsbn->getRegistrationGroupElement
: Country, geographical region or language aera codeParsedIsbn->getRegistrantElement
: Publisher (or imprint within a group) codeParsedIsbn->getPublicationElement
: Publication codeParsedIsbn->getCheckDigit
: Checksum used for validation
Development
Using Gitpod
You can start a dev environment by clicking
and start hacking in your browser right away!
Locally
If you'd rather set up a local dev environment, you'll need:
- PHP 7.x
- Composer
- (Optional) Docker to run tests and debug against different version of PHP
Clone this repository and run composer install
to get started!
Tests
Run tests with PHPUnit:
Run tests in a docker container:
Run tests in a docker container using a specific PHP version:
ISBN ranges update
New ISBN ranges may be added from time to time by the International ISBN Agency. Whenever it happens, this library must be updated. If a range update is necessary, please open an issue on GitHub. You can also open a pull request after updating the ranges your self with the following commands:
Or using a docker container: