forked from dozens/books
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
c3e42563c6 | |||
8a59c47485 | |||
12fa2770d5 | |||
2dc0d374cd | |||
23d6d84d43 | |||
44bf8fabbd | |||
70fb11b3a1 | |||
a10152ff67 | |||
9238b1816d | |||
a04db2f312 | |||
dbceefe37c | |||
53d8718ee9 |
2
Makefile
Normal file
2
Makefile
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
default: books.csv genfeed.py
|
||||||
|
./genfeed.py < books.csv > feed.xml
|
19
README.md
19
README.md
@ -4,9 +4,17 @@ This is a catalog of all the books in my calibre library!
|
|||||||
|
|
||||||
If you see a title here you would like to borrow, let me know! I'd be happy to share :)
|
If you see a title here you would like to borrow, let me know! I'd be happy to share :)
|
||||||
|
|
||||||
## How To
|
## How To (For me)
|
||||||
|
|
||||||
If you're going to explore this dataset, I recommend using the awesome csvkit.
|
- go to calibre and "convert books" -> "create a catalog...."
|
||||||
|
- save it to the dir
|
||||||
|
- `j all`
|
||||||
|
|
||||||
|
## How To (For you)
|
||||||
|
|
||||||
|
If you want to browse the collection, I would look at `books.rec`.
|
||||||
|
|
||||||
|
If you're going to really explore this dataset, I recommend using the awesome csvkit.
|
||||||
|
|
||||||
=> <https://csvkit.readthedocs.io/en/latest/index.html>
|
=> <https://csvkit.readthedocs.io/en/latest/index.html>
|
||||||
|
|
||||||
@ -17,15 +25,20 @@ It will allow you to do stuff like:
|
|||||||
- look at some stats: `csvcut -c languages,size,formats books.csv | csvstat`
|
- look at some stats: `csvcut -c languages,size,formats books.csv | csvstat`
|
||||||
- find the largest pdfs in the collection: `csvcut -c title_sort,formats,size books.csv | csvgrep -c formats -m pdf | csvsort -c size -r | head`
|
- find the largest pdfs in the collection: `csvcut -c title_sort,formats,size books.csv | csvgrep -c formats -m pdf | csvsort -c size -r | head`
|
||||||
- `csvjson books.csv | jq | whatever`
|
- `csvjson books.csv | jq | whatever`
|
||||||
|
- show the most recently added books: `csvcut -c 13,1,3 books.csv | csvsort -c timestamp -r | head -n 20`
|
||||||
- You can also perform actual SQL queries on it, and convert the data between csv and sqlite database: <https://csvkit.readthedocs.io/en/latest/tutorial/3_power_tools.html>
|
- You can also perform actual SQL queries on it, and convert the data between csv and sqlite database: <https://csvkit.readthedocs.io/en/latest/tutorial/3_power_tools.html>
|
||||||
|
|
||||||
## RSS feed
|
## RSS feed
|
||||||
|
|
||||||
An RSS feed has been kindly provided by [the Rsszard of Syndication](https://tilde.town/~lucidiot)
|
An RSS feed has been kindly provided by [the Rsszard of Syndication](https://tilde.town/~lucidiot)
|
||||||
and is available at https://AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.
|
and is available at https://git.tilde.town/dozens/books/raw/branch/main/feed.xml
|
||||||
|
|
||||||
Generating the feed requires you to have Python 3.7 or later installed, as well
|
Generating the feed requires you to have Python 3.7 or later installed, as well
|
||||||
as the [xmltodict](https://pypi.org/project/xmltodict) package:
|
as the [xmltodict](https://pypi.org/project/xmltodict) package:
|
||||||
`pip3 install xmltodict`.
|
`pip3 install xmltodict`.
|
||||||
|
|
||||||
To generate the feed, run `./geenfeed.py <books.csv >lefeed.xml`.
|
To generate the feed, run `./geenfeed.py <books.csv >lefeed.xml`.
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
|
||||||
|
- type definitions for Book
|
||||||
|
839
books.csv
839
books.csv
File diff suppressed because one or more lines are too long
24256
books.rec
Normal file
24256
books.rec
Normal file
File diff suppressed because one or more lines are too long
12142
feed.xml
Normal file
12142
feed.xml
Normal file
File diff suppressed because one or more lines are too long
@ -64,8 +64,7 @@ def main():
|
|||||||
"atom:link": {
|
"atom:link": {
|
||||||
"@rel": "self",
|
"@rel": "self",
|
||||||
"@type": "application/rss+xml",
|
"@type": "application/rss+xml",
|
||||||
# TODO: set the correct public URL of your feed!
|
"@href": "https://git.tilde.town/dozens/books/raw/branch/main/feed.xml",
|
||||||
"@href": "http://fuck",
|
|
||||||
},
|
},
|
||||||
"language": "en-US",
|
"language": "en-US",
|
||||||
"pubDate": datetime.now(timezone.utc)
|
"pubDate": datetime.now(timezone.utc)
|
||||||
|
14
justfile
Normal file
14
justfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# show all commands
|
||||||
|
default:
|
||||||
|
just --list
|
||||||
|
|
||||||
|
# generate rss
|
||||||
|
rss:
|
||||||
|
./genfeed.py < books.csv > feed.xml
|
||||||
|
|
||||||
|
# make rec
|
||||||
|
rec:
|
||||||
|
csvformat books.csv | csv2rec > books.rec
|
||||||
|
|
||||||
|
# do the damn thing
|
||||||
|
all: rec rss
|
Loading…
x
Reference in New Issue
Block a user