Code Monkey home page Code Monkey logo

pybooksearch's Introduction

pyBookSearch

A simple terminal or GTK+ based interface to add books to a library file.

Designed to aid entry of books by scanning or typing in their ISBN or LCCN. A web search then looks up details and the results (including the ISBN, Title, and Author) are added to a CSV file.

Books may also be added manually in the GTK interface.

The interface is optimised for efficient repeated book entry:

  • pick up book
  • scan ISBN
  • put down book
  • repeat

Some ancilliary routines for post-processing are also included.

The main program is called my_library.py, use the --help option to get current command line options. At this time the two main options are:

  • -l FILE or --library=FILE Specify the file to use for the CSV output.
  • -t or --text Use text mode (not the GTK interface)
  • -d DELIMITER or --delimit=DELIMITER Specify the delimiter to use in the CSV file (default: |)
  • -f or --fill Fill all book fields from as many sources as is needed
  • -r or --requery Not yet implemented. Re-query all books in the library
  • -n or --no-questions Don't ask any questions, useful for redirected input

Dependencies

  • bs4 (BeautifulSoup, SoupStrainer)
  • (optional) gi.repository (Gtk, GObject)
  • (optional) fuzzywuzzy
  • various stuff from the standard library

pybooksearch's People

Contributors

chrrrisw avatar somesmart avatar

Watchers

 avatar  avatar  avatar

Forkers

somesmart

pybooksearch's Issues

Extend book fields to include LCCN

Now that we can search on LCCN, perhaps it's best to include this in the book and CSV as a separate field. In fact, we often get back additional ISBN information in the form of both ISBN_10 and ISBN_13 numbers, so perhaps we should store these separately.

use csv.Sniffer class to determine csv dialect

The current delimiter is now '|', but the test data uses ','. Either transform the test data, or use the csv.Sniffer class to determine the CSV dialect on read. Perhaps also allow selection of delimiter for writing via command line parameter.

Conflict resolution leaves choice in lower case.

In fill mode, if there is a conflict between two sources, the user choice is put into the book field in lower case. This is a result of the lower case comparison which should be left as-is, the user choices should be the original data.

auto_library is not being saved

I know you haven't worked on this in a long time, but hopefully you can still help me out. The script seems to work fine, but it doesn't appear to actually update the auto_library.csv file, despite saying "Saved ./auto_library.csv".

Any thoughts on what might be happening?

Move test data in auto_library.csv to another file.

As auto_library.csv is the default name for the output file, having the test data in this file means that users have to remove this file to start their own library. This will result in a local change to the repository that will potentially clash with future updates to the test data.

WARNING
When this is closed, all users of auto_library.csv should save a copy of their data elsewhere and then copy it back after pulling the change.

Re-organise code as a package

Eventually we may want to able to package the code. The reorg branch has been pushed with current functionality, but with the code reorganised to be more package like.

Should searchers make strings html/xml safe?

Currently the ISBNSearchOrg searcher replaces '&' with '&' to make the resultant strings HTML/XML safe. Should this be the case? Apart from the fact that this is an incomplete solution to the problem, should this really be done in the GTK interface where it's required - rather than corrupt the raw data?

AttributeError: 'NoneType' has no attribute 'strip'

I might be doing something stupid, but after doing a search for an ISBN, saving the results, and then trying to execute the script again, I get this error message immediately.

The full Traceback shows that it's originating from the new_book function originating in crwLibrary.py

It first fails on the self._binding = value.strip()

Any thoughts?

Fill mode

Fill mode should query as many searchers as possible to resolve all UNKNOWN fields in the book.

Re-query mode

Re-query mode should read in an existing library file and query the searchers again for any updated information. In combination with "fill mode" this will allow a library file to fill in any UNKNOWN fields that may have been added in the interim.

Add location field to books

For those of us with many bookcases, and for those packing books for transport, the ability to specify a location would be useful. In text mode the command could look something like:

l:box1

followed by all the books in the 'box1' location. To change location, simply type:

l:box2

or:

l:

to go back to not specifying a location.

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.