Add the specified books to the library. Books should be an iterable of 2-tuples, each 2-tuple of the form (mi, format_map) where mi is a Metadata object and format_map is a dictionary of the form {fmt: path_or_stream}, for example: {'EPUB': '/path/to/file.epub'}.
comments+=""" <a title="The link may be broken">⚠️</a>"""
comments+="""</p>"""
if'wayback'inbook:
comments+=f"""<p class="wayback">An archival copy appears to be available: <a class="wayback" href="{book['wayback']}">Wayback machine on archive.org</a></p>"""
ifcomments:
md.comments=comments
# # get the meta HTML
# with open(bookpath / "meta.html") as fin:
# t = html5lib.parse(fin.read(), namespaceHTMLElements=False)
"eventually clear any previously generated library"
]
},
{
"cell_type": "code",
"execution_count": 49,
"id": "582272f3-f04b-4b46-9c03-3793d9efc97f",
"execution_count": 79,
"id": "503027dd-aada-4a75-8d44-6eb60834e87e",
"metadata": {},
"outputs": [],
"source": [
"!rm -rf calibre"
]
},
{
"cell_type": "markdown",
"id": "4a37f258-6129-4b4f-b9bb-27b7d4e68c53",
"metadata": {},
"source": [
"Calibre-debug allows you to run a python script in a python session that has access to the full calibre API. It creates a new calibre database in a folder called calibre in this working directory"
]
},
{
"cell_type": "code",
"execution_count": 82,
"id": "2a1aede7-7d55-47de-88eb-5e29cd93439e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Traceback (most recent call last):\n",
" File \"runpy.py\", line 194, in _run_module_as_main\n",
" File \"runpy.py\", line 87, in _run_code\n",
" File \"site.py\", line 45, in <module>\n",
" File \"site.py\", line 41, in main\n",
" File \"calibre/debug.py\", line 336, in main\n",
" File \"calibre/debug.py\", line 243, in run_script\n",
" File \"polyglot/builtins.py\", line 110, in exec_path\n",
" File \"/home/murtaugh/projects/books/repos/verlag/calibre-add-books.py\", line 164, in <module>\n",
" results = db.add_books(books_to_add) \n",
" File \"calibre/db/cache.py\", line 1770, in add_books\n",
" File \"calibre/db/cache.py\", line 74, in call_func_with_lock\n",
" File \"calibre/db/cache.py\", line 1721, in create_book_entry\n",
" File \"calibre/db/cache.py\", line 1667, in author_sort_from_authors\n",
" File \"calibre/utils/icu.py\", line 180, in change_case\n",
Another example (with a [wayback link (with wayback frame)](http://web.archive.org/web/20110814075540/http://data.constantvzw.org/s-a-s/16_zummer.pdf)... [and direct pdf](http://web.archive.org/web/20110814075540id_/http://data.constantvzw.org/s-a-s/16_zummer.pdf)):
nice! the raw_url gives a direct interface free link (though the wayback interface can be handy for allowing navigating different snapshots)...
next step... Making an editable document version of ALL the data ... how manageable would/could such a document be, could/should it be broken into separate lists based on type / project ?
What can these document / list / spreadsheet forms look like in a collectively editable version? (etherpad, ethercalc, hackpad, ...) **or** is JSON the format already (with json-ld we **HAVE** the link to RDF), what does a YAML representation of the JSON look like, are there shared JSON editors ?! (or do we enter Google Wave territory here)
This is quite readable (apart from the unicode stuff --- which I'm assuming there must be a way around)... But the quantity is large, and the division between items not nice (separate streams for each would be nicer)... But it's better than a markdown table or definition list. Being able to specify an order to the fields would also be very useful for sure (or to start, alphabetizing them).
info [('status', 'Selected text'), ('languages', 'English, Español'), ('year', '2013'), ('date_added', '2013-05-16'), ('license', 'creativecommons.org/licenses/by-nc-sa/3.0/'), ('projects', ['The Libre Graphics Research Unit is a traveling lab where new ideas for creative tools are developed. The Research Unit is an initiative of four European media-labs actively engaged in Free/Libre and Open Source Software and Free Culture. This cross-disciplinary project involves artists', 'designers and programmers and is developed in dialogue with the Libre Graphics community.']), ('themes', ['Body and technology', 'Digital tools', 'Free Software', 'free culture', 'Report'])]
info [('status', 'Resource'), ('language', 'English'), ('year', '2013'), ('date_added', '2013-05-16'), ('projects', ['The Libre Graphics Research Unit is a traveling lab where new ideas for creative tools are developed. The Research Unit is an initiative of four European media-labs actively engaged in Free/Libre and Open Source Software and Free Culture. This cross-disciplinary project involves artists', 'designers and programmers and is developed in dialogue with the Libre Graphics community.']), ('themes', ['Digital tools'])]
info [('status', 'Publication'), ('language', 'Français'), ('year', '2013'), ('date_added', '2013-04-16'), ('license', 'GPLv2'), ('projects', ['Manuals that have been co/written or edited by Constant members and have been produced / published by FLOSS Manuals publishers', 'Open Source Video']), ('themes', ['Digital tools', 'Free Software', 'free culture'])]
info [('status', 'Publication'), ('language', 'Français'), ('year', '2012'), ('date_added', '2013-05-16'), ('license', 'GPLv2'), ('projects', ['Manuals that have been co/written or edited by Constant members and have been produced / published by FLOSS Manuals publishers']), ('themes', ['Design and typography', 'Digital tools', 'Free Software', 'free culture'])]
info [('status', 'Selected text'), ('languages', 'English, Español, Français'), ('year', '2013'), ('date_added', '2013-05-16'), ('projects', ['The Libre Graphics Research Unit is a traveling lab where new ideas for creative tools are developed. The Research Unit is an initiative of four European media-labs actively engaged in Free/Libre and Open Source Software and Free Culture. This cross-disciplinary project involves artists', 'designers and programmers and is developed in dialogue with the Libre Graphics community.']), ('themes', ['Digital tools'])]
info [('status', 'Selected text'), ('language', 'English'), ('year', '1998'), ('date_added', '2007-04-25'), ('projects', ['Museums and New Media']), ('themes', ['Rethinking the author'])]