{"id":32192028,"url":"https://github.com/tvirolai/clj-isbn","last_synced_at":"2025-10-22T01:56:33.194Z","repository":{"id":57713447,"uuid":"55394488","full_name":"tvirolai/clj-isbn","owner":"tvirolai","description":"An ISBN utility library for Clojure","archived":false,"fork":false,"pushed_at":"2020-08-11T08:44:08.000Z","size":65,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T08:51:59.202Z","etag":null,"topics":["bibliography","books","clojure","code4lib","conversion","identifiers","isbn"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tvirolai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-04T08:02:14.000Z","updated_at":"2020-08-11T08:44:10.000Z","dependencies_parsed_at":"2022-09-26T16:40:18.388Z","dependency_job_id":null,"html_url":"https://github.com/tvirolai/clj-isbn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tvirolai/clj-isbn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvirolai%2Fclj-isbn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvirolai%2Fclj-isbn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvirolai%2Fclj-isbn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvirolai%2Fclj-isbn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tvirolai","download_url":"https://codeload.github.com/tvirolai/clj-isbn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvirolai%2Fclj-isbn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280365580,"owners_count":26318385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bibliography","books","clojure","code4lib","conversion","identifiers","isbn"],"created_at":"2025-10-22T01:56:32.566Z","updated_at":"2025-10-22T01:56:33.185Z","avatar_url":"https://github.com/tvirolai.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clj-isbn\n\n[![Clojars Project](https://img.shields.io/clojars/v/clj-isbn.svg)](https://clojars.org/clj-isbn)\n[![Build Status](https://travis-ci.org/tvirolai/clj-isbn.svg?branch=master)](https://travis-ci.org/tvirolai/clj-isbn)\n[![Downloads](https://jarkeeper.com/tvirolai/clj-isbn/downloads.svg)](https://jarkeeper.com/tvirolai/clj-isbn)\n[![codecov](https://codecov.io/gh/tvirolai/clj-isbn/branch/master/graph/badge.svg)](https://codecov.io/gh/tvirolai/clj-isbn)\n\nA simple ISBN utility library for Clojure.\n\n## Latest version\n[![Clojars Project](http://clojars.org/clj-isbn/latest-version.svg)](http://clojars.org/clj-isbn)\n\n## Installation\n\nclj-isbn is hosted in [Clojars](https://clojars.org/clj-isbn).\n\nUsing Leiningen, add clj-isbn as a dependency to your project's project.clj:\n\n```clojure\n[clj-isbn \"1.0.0\"]\n```\n\nThen require it into your namespace:\n\n```clojure\n(ns foo.bar\n (:require [clj-isbn.core :as isbn]))\n```\n\nor\n\n```clojure\n(ns foo.bar\n (:require [clj-isbn.core :refer :all]))\n```\n\n## Usage\n\nTo validate an ISBN:\n\n```clojure\n(isbn/is-valid? \"85-359-0277-5\")\n=\u003e true\n```\n\nTo convert an ISBN-10 to ISBN-13:\n\n```clojure\n(isbn/isbn10-\u003eisbn13 \"85-359-0277-5\")\n=\u003e \"9788535902778\"\n```\n\nAnd vice versa:\n\n```clojure\n(isbn/isbn13-\u003eisbn10 \"978-91-501-1334-1\")\n=\u003e \"9150113348\"\n```\n\nThe conversion functions return the new ISBN codes without hyphens. You have to call the hyphenation function separately if you need them:\n\n```clojure\n(isbn/hyphenate \"9783799591232\")\n=\u003e \"978-3-7995-9123-2\"\n(isbn/hyphenate (isbn/isbn10-\u003eisbn13 \"097961631X\"))\n=\u003e \"978-0-9796163-1-0\"\n```\n\nIf you need to check if the ISBN is correctly hyphenated:\n\n```clojure\n(isbn/correctly-hyphenated? \"9783799591232\")\n=\u003e false\n(isbn/correctly-hyphenated? \"978-9-004-32443-5\")\n=\u003e false\n(isbn/correctly-hyphenated? \"978-952-68574-1-1\")\n=\u003e true\n```\nIf the ISBN is not hyphenated at all, false it is.\n\nTo calculate check digits:\n\n```clojure\n(isbn/isbn10-checkdigit \"85-359-0277\")\n=\u003e 5\n(isbn/isbn13-checkdigit \"978-951-98548-9\")\n=\u003e 2\n```\n\nTo get the publisher zone:\n\n```clojure\n(isbn/publisher-zone \"978-91-501-1334-1\")\n=\u003e \"Sweden\"\n```\n\nIt is also possible to extract the different components of an ISBN code:\n\n```clojure\n(isbn/get-prefix \"9789529351787\")\n=\u003e \"978-952\"\n(isbn/get-registrant-element \"9789529351787\")\n=\u003e \"93\"\n(isbn/get-publication-element \"9789529351787\")\n=\u003e \"5178\"\n(isbn/get-checkdigit \"9789529351787\")\n=\u003e \"7\"\n```\n\nIf the conversion, hyphenation or checksum calculation functions are fed an invalid value, nil value is returned.\n\n```clojure\n(isbn/publisher-zone \"9783799591232\")\n=\u003e \"German language\"\n(isbn/publisher-zone \"9783799591235\")\n=\u003e nil\n(isbn/hyphenate \"Yeah!\")\n=\u003e nil\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvirolai%2Fclj-isbn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftvirolai%2Fclj-isbn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvirolai%2Fclj-isbn/lists"}