{"id":34571097,"url":"https://github.com/biblys/isbn","last_synced_at":"2026-05-20T07:15:17.763Z","repository":{"id":16200467,"uuid":"18947229","full_name":"biblys/isbn","owner":"biblys","description":"A PHP library to validate, convert and parse ISBNs and EANs","archived":false,"fork":false,"pushed_at":"2026-04-15T07:20:49.000Z","size":361,"stargazers_count":56,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-04-15T09:30:25.633Z","etag":null,"topics":["eans","hacktoberfest","isbn","isbn-ranges","php"],"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/biblys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":"clemlatz","issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2014-04-19T17:54:57.000Z","updated_at":"2026-04-08T09:12:47.000Z","dependencies_parsed_at":"2025-04-26T07:22:28.103Z","dependency_job_id":"12bd910c-5657-41fe-aab6-60cad8865c29","html_url":"https://github.com/biblys/isbn","commit_stats":{"total_commits":174,"total_committers":12,"mean_commits":14.5,"dds":"0.49425287356321834","last_synced_commit":"2e4729cbf873d0141174573222ea61f1b688f0f6"},"previous_names":[],"tags_count":83,"template":false,"template_full_name":null,"purl":"pkg:github/biblys/isbn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biblys%2Fisbn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biblys%2Fisbn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biblys%2Fisbn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biblys%2Fisbn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biblys","download_url":"https://codeload.github.com/biblys/isbn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biblys%2Fisbn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31982787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T17:30:12.329Z","status":"ssl_error","status_checked_at":"2026-04-18T17:29:59.069Z","response_time":103,"last_error":"SSL_read: 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":["eans","hacktoberfest","isbn","isbn-ranges","php"],"created_at":"2025-12-24T09:35:49.710Z","updated_at":"2026-04-18T20:09:38.761Z","avatar_url":"https://github.com/biblys.png","language":"PHP","funding_links":["https://liberapay.com/clemlatz"],"categories":[],"sub_categories":[],"readme":"# biblys/isbn\n\n[![tests](https://github.com/biblys/isbn/actions/workflows/tests.yml/badge.svg)](https://github.com/biblys/isbn/actions/workflows/tests.yml)\n[![Latest Stable Version](https://poser.pugx.org/biblys/isbn/v/stable)](https://packagist.org/packages/biblys/isbn)\n[![Total Downloads](https://poser.pugx.org/biblys/isbn/downloads)](https://packagist.org/packages/biblys/isbn)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)\n[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/biblys/isbn)\n\nbiblys/isbn can be used to:\n\n- [validate](#validate) a string against the ISBN-10, ISBN-13 and EAN-13 formats\n- [convert](#convert) an ISBN to ISBN-10, ISBN-13, EAN-13, GTIN-14 and ISBN-A/DOI formats\n- [parse](#parse) an ISBN to extract registration agency, publisher code, publication code, checksum, etc.\n\n[CHANGELOG](https://github.com/biblys/isbn/releases)\n\n## Installation\n\n### \n- Requirements: PHP 7.2 or above\n\nInstall with composer:\n\n```console\ncomposer require biblys/isbn:~3.0\n```\n\n## Usage\n\n### Convert\n\nUse case: converting an EAN (9782843449499) to an ISBN-13 (978-2-84344-949-9).\n\n```php\n\u003c?php\n\nuse Biblys\\Isbn\\Isbn;\n\ntry {\n    $input = \"9782843449499\";\n    $isbn13 = Isbn::convertToIsbn13($input);\n    echo \"ISBN-13: $isbn13\"; // Prints ISBN-13: 978-2-84344-949-9\n} catch(Exception $e) {\n    echo \"An error occurred while attempting to format ISBN $input: \".$e-\u003egetMessage();\n}\n```\n\nAll formatting methods:\n\n- `Isbn::convertToIsbn10`\n- `Isbn::convertToIsbn13`\n- `Isbn::convertToEan13`\n- `Isbn::convertToGtin14`\n- `Isbn::convertToIsbnA`\n\n### Validate\n\nUse case: validating an incorrectly formed ISBN-13 (978-2-843-44949-9, should\nbe 978-2-84344-949-9).\n\n```php\n\u003c?php\n\nuse Biblys\\Isbn\\Isbn;\n\ntry {\n    $input = \"978-2-843-44949-9\";\n    Isbn::validateAsIsbn13($input);\n    echo \"ISBN $input is valid!\";\n} catch(Exception $e) { // Will throw because third hyphen is misplaced\n    echo \"ISBN $input is invalid: \".$e-\u003egetMessage();\n}\n```\n\nAll validating methods:\n\n- `Isbn::validateAsIsbn10`\n- `Isbn::validateAsIsbn13`\n- `Isbn::validateAsEan13`\n- `Isbn::isParsable`\n\n[Learn more about validating ISBNs](https://github.com/biblys/isbn/wiki/Validating-ISBNs-using-the-new-public-API)\n\n### Parse\n\nUse case: extracting the publisher code from an ISBN.\n\n```php\n\u003c?php\nuse Biblys\\Isbn\\Isbn;\n\n$input = \"9782956420132\";\n$isbn = Isbn::parse($input);\necho $isbn-\u003egetRegistrantElement(); // Prints \"9564201\"\n\n```\n\n`Isbn::parse` returns a `ParsedIsbn` object implementing the following methods:\n- `ParsedIsbn-\u003egetGs1Element`:: EAN product code\n- `ParsedIsbn-\u003egetRegistrationGroupElement`: Country, geographical region or language aera code\n- `ParsedIsbn-\u003egetRegistrantElement`: Publisher (or imprint within a group) code\n- `ParsedIsbn-\u003egetPublicationElement`: Publication code\n- `ParsedIsbn-\u003egetCheckDigit`: Checksum used for validation\n\n\n## Development\n\n### Using Gitpod\n\nYou can start a dev environment by clicking\n[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/biblys/isbn)\nand start hacking in your browser right away!\n\n### Locally\n\nIf you'd rather set up a local dev environment, you'll need:\n\n- PHP 7.x\n- Composer\n- (Optional) Docker to run tests and debug against different version of PHP\n\nClone this repository and run `composer install` to get started!\n\n## Tests\n\nRun tests with PHPUnit:\n\n```console\ncomposer install\ncomposer test\n```\n\nRun tests in a docker container:\n\n```console\ncomposer docker:test\n```\n\nRun tests in a docker container using a specific PHP version:\n\n```console\nPHP_VERSION=7.1 composer docker:test\n```\n\n## ISBN ranges update\n\nNew ISBN ranges may be added from time to time by the\n[International ISBN Agency](https://www.isbn-international.org/). Whenever it\nhappens, this library must be updated. If a range update is necessary, please\nopen an issue on GitHub.\nYou can also open a pull request after updating the ranges your self with the\nfollowing commands:\n\n```console\ncomposer install\ncomposer run update-ranges\n```\n\nOr using a docker container:\n\n```console\ncomposer docker:update-ranges\n```\n\n## Create a minor release after ranges autoupdate\n\n```shell\nread \"PR_NUMBER?Pull request number: \"\ngh pr merge --auto -dr \"$PR_NUMBER\" \\\n    \u0026\u0026 git fetch --tags \\\n    \u0026\u0026 CURRENT_VERSION=$(git tag --sort=-v:refname | head -n 1) \\\n    \u0026\u0026 IFS='.' read -r major minor patch \u003c\u003c\u003c \"$CURRENT_VERSION\" \\\n    \u0026\u0026 NEW_VERSION=\"$major.$minor.$((patch + 1))\" \\\n    \u0026\u0026 read \"RELEASE_NOTES?Release notes: \" \\\n    \u0026\u0026 gh release create \"$NEW_VERSION\" --title \"$NEW_VERSION\" --notes \"$RELEASE_NOTES\"\n```\n\n\n## Changelog\n\n[See GitHub releases](https://github.com/biblys/isbn/releases)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiblys%2Fisbn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiblys%2Fisbn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiblys%2Fisbn/lists"}