internetarchive / internetarchive/openlibrary-client

Adding books requires identifiers

Open
#380 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
506
Forks
110
PR merge metrics
No merged PRs in 30d

Description

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](https://openlibrary.org/books/add).

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](https://github.com/internetarchive/openlibrary-client/blob/master/olclient/openlibrary.py#L765).

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🙂

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the value-error path in olclient/openlibrary.py around line 765 and reproduce it with the Book example in the issue. Compare the client behavior with the linked web-form behavior and determine whether identifiers should be optional. Done means creating a book without an ISBN or LCCN works consistently with the intended behavior, with appropriate test coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.