Python isbn request library for "Scripting Layer for Android" (sl4a)
Python Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

ISBN Android Cataloging

This is a SL4A (Scripting Layer for Android) script that I used for cataloguing my personal book library.

It scans a barcode, looks it up with the api, and stores the information in a text file.


  • Move the and scripts to the SL4A folder on your phone (mine is /sdcard/sl4a/scripts/


  • Execute

  • Print out the exit_code.png image. You scan that to exit the script.

  • The results of the catalog are stored in the same folder as, and the file is called books.txt

Known Issues

  • If the metadata of a book contains non-ascii characters, the script breaks when it tries to write to the catalog (fh.write()). The solution, I think, is to encode everything in unicode. I'm not sure what type of encoding the API is using. The error that is being raised is "UnicodeEncodeError".

  • I've had issues with certain books in the past. I don't remember which barcode format it was, but certain older formats are not scanned correctly by my phone's scanner, which causes the API query to fail. Maybe this is a result of my ignorance on barcode types. I left a "convert" function, that currently just returns the barcode that it is passed. It also takes a barcode format argument, which is coming from the phone's barcode scanner. This could be used to make the necessary conversions so that the API query won't fail.

  • Occasionally, when trying to scan the exit_code.png barcode, my phone picks up an EAN_8 barcode with some strange number.

Future Ideas

  • Add a manual input GUI for barcodes that are not found in the worldcat database

  • Text to speech verification with the android API's

  • Multiple ISBN lookup API's to fall back on if a query is not found on worldcat