isbn 1.0.4 copy "isbn: ^1.0.4" to clipboard
isbn: ^1.0.4 copied to clipboard

A library for parsing, validating, and generating ISBN codes easily. Supports ISBN-10 and ISBN-13 formats.

example/example.dart

import 'package:isbn/isbn.dart';

/// This example illustrates the main features of the library
///
/// For more examples, look at /tests
void main() {
  /// Initialize the main object
  Isbn isbn = Isbn();

  /// Check if a string is in ISBN-10 format
  print(isbn.isIsbn10('ISBN 4-19-830127-1'));

  /// Check if a string is in ISBN-13 format
  print(isbn.isIsbn13('ISBN 97818nope4677'));

  /// Convert a string into ISBN 10 format
  print(isbn.toIsbn10('isbn 0-8264-9752-7'));

  /// Convert a string into ISBN 13 format
  print(isbn.toIsbn13('record: isbn 0-8264-9752-7'));

  /// Parse text for ISBNs
  /// Specify detection levels to use. Options: [loose, normal, strict]
  final text = r'ISBN 9781849284677'
      'data: 9780312640583 thisworks'
      'record: isbn 978-0312640583'
      'also works: isbn 978031264058 3';
  print(isbn.getIsbnFromString(text, level: 'normal'));

  /// Convert a string to its canonical ISBN representation
  print(isbn.toCanonical('978-03126-4058-3'));

  /// Convert convert a string to EAN13 format
  print(isbn.toEAN13('978-03126-4058-3'));
}
4
likes
160
pub points
53%
popularity

Publisher

verified publisher0xdir.com

A library for parsing, validating, and generating ISBN codes easily. Supports ISBN-10 and ISBN-13 formats.

Repository (GitHub)
View/report issues

Topics

#data #isbn #books #metadata #standards

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (LICENSE)

More

Packages that depend on isbn