Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding books requires identifiers #380

Open
gedankenstuecke opened this issue Aug 31, 2023 · 5 comments
Open

Adding books requires identifiers #380

gedankenstuecke opened this issue Aug 31, 2023 · 5 comments

Comments

@gedankenstuecke
Copy link

It seems that the library currently requires specifying either an ISBN or LCCN identifier in order to be able to create a new book, which differs from the behaviour of the web form for the book creation, where the identifiers are optional.

To reproduce this should work just fine

from olclient.openlibrary import OpenLibrary
import olclient.common as common
ol = OpenLibrary()
book = common.Book(title="My test book title", authors=[common.Author(name="Testy McTestFace")], publisher=u"Publisher", publish_date=u"2018")
new_book = ol.create_book(book)

This will trigger the value error.

I'm not sure if this is expected behaviour that was designed to work like this, or whether the openlibrary-client is just out-of-sync with how the web-form behaves? If it's the latter I'd be happy to give it a shot to adjust it according to the web form🙂

@LeadSongDog
Copy link

LeadSongDog commented Aug 31, 2023

Because auto imports happen much faster than manual ones, they should be made in a more trustworthy way, from reliable source metadata (not the crapfest that is BWB and AMZ).

That isn’t the only inconsistency to address. At

VALID_IDS = ['isbn_10', 'isbn_13', 'lccn', 'ocaid']
the VALID_IDS include ocaids, but at
raise ValueError("ISBN10/13 or LCCN required")
they do not.

DRY: let’s have one list of first-class identifiers in one place, please.

That said, it would make sense to support other identifiers, not just these four. This is part of the reason we’ve had such poor uptake of pre-ISBN books from libraries outside the anglosphere, where Worldcat and LCCN coverage is less common. There are six first-class and 66 second-class identifiers listed on the edition edit page drop-down for "Select one of many…" under ID Numbers. For starters, we should pick up the BSB-ID, the Biblioteca Nacional de Español Depósito Legal, and the BnF identifiers to be treated as first-class. They are reliably and neutrally curated, far more so than Goodreads, Library Thing, Google, AMZ, and other such newcomers operating with commercial purposes. The British Library and BNB ids could also be worthwhile inclusions in the first-class list.

@cclauss
Copy link
Collaborator

cclauss commented Aug 31, 2023

msg = f"{' or '.join(VALID_IDS)} required"
>>> msg
'isbn_10 or isbn_13 or lccn or ocaid required'

@LeadSongDog
Copy link

@cclauss
Right. That too needs to be DRYed.

@gedankenstuecke
Copy link
Author

Thanks for chiming in folks!

Because auto imports happen much faster than manual ones, they should be made in a more trustworthy way, from reliable source metadata (not the crapfest that is BWB and AMZ).

I guess that means that the openlibrary-client is supposed to require some form of external ID for importing books, correct? 🙂

@cclauss
Copy link
Collaborator

cclauss commented Aug 31, 2023

msg = f"{' or '.join(VALID_IDS)} required" is dry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants