shell/gawk script (for prices I stored in Private Comments)
Talk Hacking LibraryThing
Join LibraryThing to post.
1omargosh
This post isn't about a GreaseMonkey or Stylish script, but I thought it was germane to this group anyway, and I was proud of it too (my first time messing making a shell script and messing with (g)awk, woohoo!), so I thought I'd show it off / share it. Who knows, maybe others will find it (well, a customization of it) useful too. It does require running stuff on a *nix command line though.
As I've been cataloging, I've tried to make a note of the price I paid for each book in its Private Comment field. I wanted to be able to add up how much I've spent total on books (well, with some extrapolation, since I didn't record this for every book). I made a shell script to help me. There's more about it on this wiki page (including a link to it and a sample output).
It processes the Private Comment field of the .tsv export to look for amounts, converts some from other currencies, adds them all up, spits out some totals and averages, and, the fanciest part, spits out a histogram showing how many books were bought per dollar increment, e.g.:
As I've been cataloging, I've tried to make a note of the price I paid for each book in its Private Comment field. I wanted to be able to add up how much I've spent total on books (well, with some extrapolation, since I didn't record this for every book). I made a shell script to help me. There's more about it on this wiki page (including a link to it and a sample output).
It processes the Private Comment field of the .tsv export to look for amounts, converts some from other currencies, adds them all up, spits out some totals and averages, and, the fanciest part, spits out a histogram showing how many books were bought per dollar increment, e.g.:
$04.01-$05: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 168
$05.01-$06: ■■■■■■■■■■■■■■■■■■■■■■■■■■■ 135
$06.01-$07: ■■■■■■■■■■■■■■■■■■■■■■■■■ 123
2bnsmith
>1 omargosh: The link to your wiki does not seem to work?
3norabelle414
>2 bnsmith: The wiki URL was changed a few years ago. For old links you'll need to change "https://www.librarything.com/wiki" to "https://wiki.librarything.com" so in this case https://www.librarything.com/wiki/index.php/User:Omargosh/bookcosts needs to be changed to https://wiki.librarything.com/index.php/User:Omargosh/bookcosts
5Keeline
For decades I have tried to share the concept that many better booksellers and collectors understand:
There is no single value for even a specifically identified book with a known printing and condition.
It depends entirely on who is selling, who is buying, where it is offered, and when it is offered (year and time of year).
Often one finds asking prices on eBay or used book databases. If you still see these prices, the books are available but have not sold. So maybe they are too high for the market. Once an item sells, it disappears so is not available for reference.
The eBay system has two price lists. The easiest to access is by making a search and applying the "Completed Items" filter. Of course, some items actually sold and sometimes the seller withdrew a listing. So the results have to be read carefully. It covers sales for about 3 months and only searches listing titles. The accuracy of identification is highly variable and listings routinely don't summarize the condition in bookseller terms.
The other eBay price listing that goes back farther in time — by years — is called Terrapeak.
Biblio.com and WorthPoint.com have expensive paid "prices realized" databases. There are others as well.
Of course, some systems are more likely to have some books than others. A Shakespeare First Folio has almost certainly never been offered for sale on eBay. Most Tom Swift swift books, even ones that sell for $750, don't get included in live auctions typically so very few are listed in something like ABPC (American Book Prices Current — selected published live auction records).
If information that seems useful is stored in Private Comments, perhaps JSON is a way to go for interpretation. I don't know the data type for this field. It might be TEXT which allows 65,535 bytes (64 kB). Unicode will consume this faster, of course. It could be a bigger type but why would they do so? It's just supposed to be a comment, after all. Making it too large invites abuse that impacts database backups, etc.
But I've long thought that Private Comments is an appropriate place for comps. But you'd need more than a price. What is the condition stated and how does this compare with the copy in the collection? What is the unit of currency? Who was selling? Where was it listed? Did it sell? What about dust jackets and condition?
It is so complicated.
James
There is no single value for even a specifically identified book with a known printing and condition.
It depends entirely on who is selling, who is buying, where it is offered, and when it is offered (year and time of year).
Often one finds asking prices on eBay or used book databases. If you still see these prices, the books are available but have not sold. So maybe they are too high for the market. Once an item sells, it disappears so is not available for reference.
The eBay system has two price lists. The easiest to access is by making a search and applying the "Completed Items" filter. Of course, some items actually sold and sometimes the seller withdrew a listing. So the results have to be read carefully. It covers sales for about 3 months and only searches listing titles. The accuracy of identification is highly variable and listings routinely don't summarize the condition in bookseller terms.
The other eBay price listing that goes back farther in time — by years — is called Terrapeak.
Biblio.com and WorthPoint.com have expensive paid "prices realized" databases. There are others as well.
Of course, some systems are more likely to have some books than others. A Shakespeare First Folio has almost certainly never been offered for sale on eBay. Most Tom Swift swift books, even ones that sell for $750, don't get included in live auctions typically so very few are listed in something like ABPC (American Book Prices Current — selected published live auction records).
If information that seems useful is stored in Private Comments, perhaps JSON is a way to go for interpretation. I don't know the data type for this field. It might be TEXT which allows 65,535 bytes (64 kB). Unicode will consume this faster, of course. It could be a bigger type but why would they do so? It's just supposed to be a comment, after all. Making it too large invites abuse that impacts database backups, etc.
But I've long thought that Private Comments is an appropriate place for comps. But you'd need more than a price. What is the condition stated and how does this compare with the copy in the collection? What is the unit of currency? Who was selling? Where was it listed? Did it sell? What about dust jackets and condition?
It is so complicated.
James

