### Install isbnlib Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Install the isbnlib package using pip. In some cases, you may need to use sudo. ```bash $ pip install isbnlib ``` -------------------------------- ### Get ISBN Language/Country Info Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Retrieves the language or country information associated with an ISBN. ```python import isbnlib isbnlib.info('0826497527') ``` -------------------------------- ### Retrieve Metadata with Default Configuration Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Fetch ISBN metadata using the 'meta' function with default service configurations. This is a straightforward way to get book information. ```python from isbnlib import canonical, meta, description isbn = canonical("978-0446310789") data = meta(isbn) ... ``` -------------------------------- ### Get Metadata from Open Library in BibTeX Format Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Retrieve metadata for a given ISBN from the Open Library service and format it as BibTeX. Ensure the 'openl' service is available. ```python from isbnlib import meta from isbnlib.registry import bibformatters SERVICE = "openl" # now you can use the service isbn = "9780446310789" bibtex = bibformatters["bibtex"] print(bibtex(meta(isbn, SERVICE))) ``` -------------------------------- ### Get ISBN Metadata (OpenLibrary) Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Fetches main metadata for an ISBN using the OpenLibrary.org API. No API key is needed. ```python import isbnlib isbnlib.meta('0826497527', service='openl') ``` -------------------------------- ### Get ISBN Metadata (Google Books) Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Fetches main metadata for an ISBN using the Google Books service. No API key is needed. ```python import isbnlib isbnlib.meta('0826497527', service='goob') ``` -------------------------------- ### Get canonical ISBNs from text Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Extracts ISBNs from text and returns them in their canonical form. ```python import isbnlib isbnlib.get_canonical_isbn('Some text with 9780321534965 and 0826497527 inside.') ``` -------------------------------- ### Get ISBN Metadata (Wikipedia) Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Fetches main metadata for an ISBN using the Wikipedia API. No API key is needed. ```python import isbnlib isbnlib.meta('0826497527', service='wiki') ``` -------------------------------- ### Get DOI from ISBN-13 Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Retrieves the DOI's ISBN-A identifier from a given ISBN-13. ```python import isbnlib isbnlib.doi('9780321534965') ``` -------------------------------- ### Add API Key for Metadata Service Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Configures an API key for a specific metadata service. ```python import isbnlib isbnlib.config.add_apikey(service='some_service', apikey='your_api_key') ``` -------------------------------- ### Configure isbnlib with API Key and Custom Cache Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Configure isbnlib to use a specific API key for a metadata service (e.g., 'isbndb') and set a custom cache implementation. This is necessary for services requiring authentication or custom caching strategies. ```python from myapp.utils import MyCache # import the functions you need, plus 'config' and 'registry' from isbnlib import canonical, config, meta, registry # you should use 'config' first config.add_apikey("isbndb", "kjshdfkjahsdflkjh") # then 'registry' registry.set_cache(MyCache()) # Only now should you use metadata functions # (there are no adaptions for core functions, # so they can be used at any time) isbn = canonical("978-0446310789") data = meta(isbn, service="isbndb") ... ``` -------------------------------- ### Import and Use Core ISBN Functions Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Import and utilize core ISBN validation and canonicalization functions. This is suitable for basic ISBN checks and normalization. ```python # import the core functions you need from isbnlib import canonical, is_isbn10, is_isbn13 isbn = canonical("978-0446310789") if is_isbn13(isbn): ... ... ``` -------------------------------- ### classify(isbn) Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Provides a dictionary of classifiers for a canonical ISBN. Note that most underlying data is for English books. ```APIDOC ## classify(isbn) ### Description Returns a dictionary of **classifiers** for a canonical ISBN. For the meaning of these classifiers see OCLC_. Most of the data in the underlying service are for books in English. (See issue 138_). ### Parameters * **isbn** (string) - Required - The canonical ISBN to classify. ``` -------------------------------- ### goom(words) Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Fetches a list of references from Google Books' multiple references service based on a list of words. ```APIDOC ## goom(words) ### Description Returns a list of references from **Google Books multiple references**. ### Parameters * **words** (list of strings) - Required - Words to search for references. ``` -------------------------------- ### desc(isbn) Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Returns a brief description of a book using its ISBN. Note that most available data pertains to US books. ```APIDOC ## desc(isbn) ### Description Returns a small description of the book. *Almost all data available are for US books!* ### Parameters * **isbn** (string) - Required - The ISBN of the book to describe. ``` -------------------------------- ### ISBN Metadata and Formatting Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Functions for retrieving metadata associated with an ISBN and formatting it. ```APIDOC ## ISBN Metadata and Formatting ### `mask(isbn, separator='-')` **Description**: Formats a canonical ISBN by adding hyphens (or a specified separator). **Parameters**: - `isbn` (string) - A canonical ISBN string. - `separator` (string, optional) - The separator to use for masking. Defaults to '-'. ### `info(isbn)` **Description**: Retrieves the language or country information assigned to an ISBN. **Parameters**: - `isbn` (string) - A valid ISBN string. ### `meta(isbn, service='default')` **Description**: Fetches main metadata associated with an ISBN from various online services. **Parameters**: - `isbn` (string) - A valid ISBN string. - `service` (string, optional) - The metadata service to use ('goob', 'wiki', 'openl'). Defaults to 'default' (Google Books). **Supported Services**: - `goob`: Google Books service (no API key needed). - `wiki`: wikipedia.org API (no API key needed). - `openl`: OpenLibrary.org API (no API key needed). **Note**: API keys can be added using `config.add_apikey(service, apikey)`. ``` -------------------------------- ### cover(isbn) Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Retrieves a dictionary containing the URL for a book's cover, based on its ISBN. Note that most available data pertains to US books. ```APIDOC ## cover(isbn) ### Description Returns a dictionary with the url for cover. *Almost all data available are for US books!* ### Parameters * **isbn** (string) - Required - The ISBN of the book to get the cover for. ``` -------------------------------- ### ISBN Transformation Functions Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst These functions allow conversion between ISBN-10 and ISBN-13 formats, and canonicalization. ```APIDOC ## ISBN Transformation Functions ### `to_isbn10(isbn13)` **Description**: Transforms a valid ISBN-13 string into its ISBN-10 representation. **Parameters**: - `isbn13` (string) - A valid ISBN-13 string. ### `to_isbn13(isbn10)` **Description**: Transforms a valid ISBN-10 string into its ISBN-13 representation. **Parameters**: - `isbn10` (string) - A valid ISBN-10 string. ### `canonical(isbnlike)` **Description**: Returns the canonical form of an ISBN-like string, keeping only digits and 'X'. **Parameters**: - `isbnlike` (string) - An ISBN-like string. ### `clean(isbnlike)` **Description**: Cleans an ISBN-like string by removing characters that are not valid for an ISBN. **Parameters**: - `isbnlike` (string) - An ISBN-like string. ### `ean13(isbnlike)` **Description**: Transforms an ISBN-like string into a validated canonical ISBN-13 EAN-13 number. **Parameters**: - `isbnlike` (string) - An ISBN-like string. ``` -------------------------------- ### ren(filename) Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Renames a file by extracting ISBN metadata from its filename. ```APIDOC ## ren(filename) ### Description Renames a file using metadata for an ISBN in the filename. ### Parameters * **filename** (string) - Required - The name of the file to be renamed. ``` -------------------------------- ### Convert ISBN-13 to ISBN-10 Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Transforms a valid ISBN-13 string into its ISBN-10 equivalent. ```python import isbnlib isbnlib.to_isbn10('9780321534965') ``` -------------------------------- ### Convert ISBN-10 to ISBN-13 Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Transforms a valid ISBN-10 string into its ISBN-13 equivalent. ```python import isbnlib isbnlib.to_isbn13('0826497527') ``` -------------------------------- ### editions(isbn, service='merge') Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Retrieves a list of ISBNs for editions related to a given ISBN. It supports multiple providers like Open Library, LibraryThing, and Wikipedia, with a default 'merge' option. ```APIDOC ## editions(isbn, service='merge') ### Description Returns the list of ISBNs of editions related with this ISBN. By default uses 'merge' (merges 'openl', 'thingl' and 'wiki'), but other providers are available: 'openl' (uses the search API from **Open Library**), 'thingl' (uses the service ThingISBN from **LibraryThing**), 'wiki' (uses the service Citation from **Wikipedia**) and 'any' (first tries 'wiki', if no data then 'openl'). ### Parameters * **isbn** (string) - Required - The ISBN to find related editions for. * **service** (string) - Optional - Defaults to 'merge'. Specifies the provider to use ('openl', 'thingl', 'wiki', 'any'). ``` -------------------------------- ### Extract ISBN-like strings Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Extracts substrings that appear to be ISBNs from a given text. ```python import isbnlib isbnlib.get_isbnlike('Some text with 9780321534965 and 0826497527 inside.') ``` -------------------------------- ### Check for non-ISBN Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Identifies strings that are definitively not valid ISBNs, with 'strict' level checking. ```python import isbnlib isbnlib.notisbn('9786610326266', level='strict') ``` -------------------------------- ### Transform to EAN13 Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Converts a canonical ISBN-13 string into a validated EAN13 number. ```python import isbnlib isbnlib.ean13('9780321534965') ``` -------------------------------- ### Clean ISBN Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Removes non-legal characters from an ISBN-like string. ```python import isbnlib isbnlib.clean('asdf 979-10-90636-07-1 bla bla') ``` -------------------------------- ### Canonicalize ISBN Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Strips an ISBN-like string to its canonical form (digits and 'X'). ```python import isbnlib isbnlib.canonical('ISBN 979-10-90636-07-1') ``` -------------------------------- ### Mask ISBN Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Formats a canonical ISBN with hyphens using a specified separator. ```python import isbnlib isbnlib.mask('9780321534965') ``` -------------------------------- ### isbn_from_words(words) Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Determines the most probable ISBN from a list of words, tailored for the user's geographic area. ```APIDOC ## isbn_from_words(words) ### Description Returns the most probable ISBN from a list of words (for your geographic area). ### Parameters * **words** (list of strings) - Required - A list of words to derive an ISBN from. ``` -------------------------------- ### Validate ISBN-10 Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Checks if a given string is a valid ISBN-10. ```python import isbnlib isbnlib.is_isbn10('0826497527') ``` -------------------------------- ### doi2tex(DOI) Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Generates BibTeX formatted metadata for a given Digital Object Identifier (DOI). ```APIDOC ## doi2tex(DOI) ### Description Returns metadata formatted as BibTeX for a given DOI. ### Parameters * **DOI** (string) - Required - The Digital Object Identifier. ``` -------------------------------- ### Validate ISBN-13 Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Checks if a given string is a valid ISBN-13. ```python import isbnlib isbnlib.is_isbn13('9780321534965') ``` -------------------------------- ### ISBN Validation Functions Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst These functions are used to validate whether a given string conforms to ISBN-10 or ISBN-13 formats. ```APIDOC ## ISBN Validation Functions ### `is_isbn10(isbn10like)` **Description**: Validates if the provided string is a valid ISBN-10. **Parameters**: - `isbn10like` (string) - A string that may represent an ISBN-10. ### `is_isbn13(isbn13like)` **Description**: Validates if the provided string is a valid ISBN-13. **Parameters**: - `isbn13like` (string) - A string that may represent an ISBN-13. ``` -------------------------------- ### ISBN Extraction and Identification Source: https://github.com/xlcnd/isbnlib/blob/dev/README.rst Functions for extracting ISBNs from text and identifying specific ISBN-related information. ```APIDOC ## ISBN Extraction and Identification ### `notisbn(isbnlike, level='strict')` **Description**: Checks an ISBN-like string with the goal of invalidating it. Useful for identifying non-ISBN strings. **Parameters**: - `isbnlike` (string) - An ISBN-like string. - `level` (string, optional) - The level of strictness for validation. Defaults to 'strict'. ### `get_isbnlike(text, level='normal')` **Description**: Extracts all substrings from a given text that appear to be ISBNs. **Parameters**: - `text` (string) - The input text to search within. - `level` (string, optional) - The level of matching. Defaults to 'normal'. ### `get_canonical_isbn(isbnlike, output='bouth')` **Description**: Extracts ISBNs from a string and transforms them into their canonical form. **Parameters**: - `isbnlike` (string) - The input string potentially containing ISBNs. - `output` (string, optional) - Specifies the output format. Defaults to 'bouth'. ### `doi(isbn)` **Description**: Retrieves the DOI's ISBN-A from a given ISBN-13. **Parameters**: - `isbn` (string) - A valid ISBN-13 string. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.