Giter Club home page Giter Club logo

business-isbn's Introduction

Coverage Status

The Business::ISBN module

This is the README for the Business::ISBN Perl module, which handles International Standard Book Numbers.

You're probably looking at this because you don't know where else to find what you're looking for. Read this once and you might never have to read one again for any Perl module.

Documentation

To read about Business::ISBN, look at the embedded documentation in the module itself. Inside the distribution, you can format it with perldoc:

% perldoc lib/Business/ISBN.pm

If you have already installed the module, you can specify the module name instead of the file location:

% perldoc Business::ISBN

You can read the documentation and inspect the meta data at MetaCPAN.

The standard module documentation has example uses in the SYNOPSIS section, but you can also look in the examples/ directory (if it's there), or look at the test files in t/.

Installation

You can install this module with a CPAN client, which will resolve and install the dependencies:

% cpan Business::ISBN
% cpanm Business::ISBN

You can also install directly from the distribution directory, which will also install the dependencies:

% cpan .
% cpanm .

You could install just this module manually:

% perl Makefile.PL
% make
% make test
% make install

You probably don't want to do that unless you're fiddling with the module and only want to run the tests without installing anything.

Source location

The meta data, such as the source repository and bug tracker, is in Makefile.PL or the META.* files it creates. You can find that on those CPAN web interfaces, but you can also look at files directly in the source repository:

If you find a problem, file a ticket in the issue tracker:

Getting help

Although I'm happy to hear from module users in private email, that's the best way for me to forget to do something.

Besides the issue trackers, you can find help at Perlmonks or Stackoverflow, both of which have many competent Perlers who can answer your question, almost in real time. They might not know the particulars of this module, but they can help you diagnose your problem.

You might like to read brian's Guide to Solving Any Perl Problem.

You should have received a LICENSE file, but the license is also noted in the module files. About the only thing you can't do is pretend that you wrote code that you didn't.

Good luck!

Enjoy,

brian d foy, [email protected]

business-isbn's People

Contributors

briandfoy avatar dsteinbrunner avatar mbeijen avatar moregan avatar petdance avatar tepwil avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

business-isbn's Issues

normalization of ISBN 9783863267667

Perling the code

#!/usr/bin/perl -l
use Business::ISBN;
print Business::ISBN->new('9783863267667')->as_string;

spits out 978-3-86326-766-7. At the same time, the publisher typesets the ISBN of “Moderne Betriebssysteme” differently: 978-3-8632-6766-7. I asked the publisher around 2021-07-21 and the International ISBN agency on 2021-07-26. Pearson has not answered so far, and the International ISBN agency said it would inform the German one. Which of the two spellings with hyphens is correct™?
Crosspost: briandfoy/business-isbn-data#10 .

Is 2.010 suitable for release ?

When I check for new versions of the modules I build, I look at what CPAN is offering. Occasionally, there are multiple versions on offer from search.cpan and I can see that one is not intended a stable release. But for Business-ISBN only 2.010 is found, and yet the revision history says "Promote to a developer release".

Some valid 979 ISBN's are considered invalid

use Business::ISBN; 
use Data::Dumper;

my $isbn = Business::ISBN->new('9798986969305');

warn Data::Dumper::Dumper( $isbn->is_valid );

This outputs an empty string:

$VAR1 = '';

Reason for URI dependency unclear

This is only really a minor niggle.

But URI is declared as a dependency, but nothing in the code appears to use it.

So this seems like good grounds to either document why its needed or remove the requirement.

Downgrade Mojo to recommended

After studying your changes for 2.010, it seems to be sane to downgrade the Mojo requirement to recommends, but add a requirement or recommendation for LWP::Simple.

t/errors.t fails with Business-ISBN-Data-20230316.001

The test t/errors.t is failing after update of Business-ISBN-Data from 20210112.006 to 20230316.001.

    #   Failed test 'ISBN 9786316294241 error text mentions 'group''
    #   at t/errors.t line 17.
    #                   'Invalid publisher code'
    #     doesn't match '(?^:group)'

    #   Failed test 'ISBN 9786316294241 has a bad group'
    #   at t/errors.t line 18.

    #   Failed test 'ISBN 6316294247 error text mentions 'group''
    #   at t/errors.t line 17.
    #                   'Invalid publisher code'
    #     doesn't match '(?^:group)'

    #   Failed test 'ISBN 6316294247 has a bad group'
    #   at t/errors.t line 18.
    # Looks like you failed 4 tests of 11.

#   Failed test 'bad_group'
#   at t/errors.t line 28.
# Looks like you failed 1 test of 4.
t/errors.t ............... 

http://www.cpantesters.org/cpan/report/4b92b5ce-c8bd-11ed-9a72-66e2458b2395

LICENSE does not agree with lib/Business/ISBN.pm

Business-ISBN-3.002 has weird license declaration. While LICENSE file quotes Artistic 2.0 license, lib/Business/ISBN.pm (and other module) files declares "same terms as Perl itself" and that means GPL+ or Artistic 1 (see http://dev.perl.org/licenses/).

The current wordings implies that lib/Business/ISBN.pm (and other module) files are covered by GPL+ or Artistic 1 licenses and the other files like Makefile.PL, examples are covered by Artistic 2.0 license.

Is that really what the author wants?

Some correct ISBNs are not recognized as ISBNs

Hi!

I suddenly experienced that some new ISBN13s are not recognized by Business::ISBN module, it may be related to group 9916, in following example first ISBN is fine but second is not.

use Business::ISBN;

foreach my $wannabe ( qw/ 9789985984093 9789916120453 / ) {
  say "W: $wannabe ?";
  my $isbn = Business::ISBN->new( $wannabe );
  say  $isbn->as_string . " GROUP CODE: " . $isbn->group_code;
  say "GROUP: " . $isbn->group;
}

I checked out, that the second ISBN is correct for 2 different checkers:
http://www.hahnlibrary.net/libraries/isbncalc.html
https://www.isbn-check.com/

Wbr,

Gunnar

Version 2.010 is logically older than version 2.09

 perl -Mversion -E' say for sort { version->parse($a) <=> version->parse($b) } 
           qw( 2.01 2.02 2.07 2.08 2.09 2.09_01 2.09_02 2.010 2.010_01 )'
2.01    # oldest
2.010
2.010_01
2.02
2.07
2.08
2.09
2.09_01
2.09_02 # newest

Ability to check checksum on invalid ISBN's

Hello, it doesn't seem possible to check the checksum on invalid ISBN that have failed for one of the following checks, prefix, group code, publisher code or article code.

The is_valid_checksum method only works if the constructor has set the checksum value, which never happens if the isbn fails one of the other checks. The documentation seems to imply that is_valid_checksum will work even if the ISBN isn't considered valid... but maybe I'm just reading that wrong.

Maybe the docs just need to be more clear about the fact that it will only return GOOD_ISBN for valid checksums if the isbn is also valid. Unless fix_checksum is called first?

=item is_valid_checksum
Returns C<Business::ISBN::GOOD_ISBN> for valid checksums and
C<Business::ISBN::BAD_CHECKSUM> otherwise. This does not guarantee
that the rest of the ISBN is actually assigned to a book.
=cut

sub is_valid_checksum {
    my $self = shift;

    cluck "is_valid_checksum: Didn't get object!" unless ref $self;

    no warnings 'uninitialized';
    return GOOD_ISBN if $self->checksum eq $self->_checksum;

    return BAD_CHECKSUM;
    }

My use case is that Baker & Taylor generates their own ISBN's for DVD's that they sell. Those ISBN's have valid checksums, but fail the group code check. I would like to just check the checksum for those ISBN's, but that doesn't seem possible without calling fix_checksum first, which isn't intuitive since I don't need to fix the checksum, I just need the current checksum loaded.
Reference: https://bugs.launchpad.net/evergreen/+bug/1559281

Thanks
Josh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.