Name | cs.ebooks JSON |
Version |
20240316
JSON |
| download |
home_page | |
Summary | Utilities and command line for working with EBooks. Basic support for talking to Apple Books, Calibre, CBZ, Kindle, Kobo, Mobi, PDF. These form the basis of my personal Kindle/Kobo/Calibre workflow. |
upload_time | 2024-03-16 05:53:40 |
maintainer | |
docs_url | None |
author | |
requires_python | |
license | GNU General Public License v3 or later (GPLv3+) |
keywords |
python3
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Utilities and command line for working with EBooks.
Basic support for talking to Apple Books, Calibre, CBZ, Kindle, Kobo, Mobi, PDF.
These form the basis of my personal Kindle/Kobo/Calibre workflow.
*Latest release 20240316*:
Fixed release upload artifacts.
The command `python -m cs.ebooks help -l` gives the basic usage information:
help:
apple subcommand [...]
Subcommands:
dbshell
Start an interactive database shell.
help [-l] [subcommand-names...]
Print the full help for the named subcommands,
or for all subcommands if no names are specified.
-l Long help even if no subcommand-names provided.
ls
List books in the library.
md
List metadata.
shell
Run a command prompt via cmd.Cmd using this command's subcommands.
calibre [-C calibre_library] [-K kindle-library-path] subcommand [...]
-C calibre_library
Specify calibre library location.
-K kindle_library
Specify kindle library location.
-O other_calibre_library
Specify alternate calibre library location, the default library
for pull etc. The default comes from $CALIBRE_LIBRARY_OTHER.
Subcommands:
add [-nqv] bookpaths...
Add the specified ebook bookpaths to the library.
--cbz Also make a CBZ.
-n No action: recite planned actions.
-q Quiet: only emit warnings.
-v Verbose: report all actions and decisions.
convert [-fnqv] formatkey dbids...
Convert books to the format `formatkey`.
-f Force: convert even if the format is already present.
-n No action: recite planned actions.
-q Quiet: only emit warnings.
-v Verbose: report all actions and decisions.
dbshell
Start an interactive database prompt.
help [-l] [subcommand-names...]
Print the full help for the named subcommands,
or for all subcommands if no names are specified.
-l Long help even if no subcommand-names provided.
info
Report basic information.
linkto [-1fnqv] [-d linkto-dir] [-F fmt,...] [-o link-format] [dbids...]
Export books to linkto-dir by hard linking.
-1 Link only the first format found.
-d linkto-dir Specify the target directory, default from $MEDIA_BOOKSPATH
or ~/media/books.
-F fmt,... Source formats, default: ['CBZ', 'EPUB']
-f Force. Replace existing links.
-n No action. Report planned actions.
-o link-format Link name format.
-q Quiet.
-v Verbose.
ls [-l] [-o ls-format] [book_specs...]
List the contents of the Calibre library.
-l Long mode, listing book details over several lines.
-o ls_format Output format for use in a single line book listing.
-r Reverse the listing order.
-t Order listing by timestamp.
make_cbz book_specs...
Add the CBZ format to the designated Calibre books.
prefs
List the library preferences.
pull [-fnqv] [/path/to/other-library] [identifiers...]
Import formats from another Calibre library.
-f Force. Overwrite existing formats with formats from other-library.
-n No action: recite planned actions.
-q Quiet. Only issue warnings and errors.
-v Verbose. Print more information.
/path/to/other-library: optional path to another Calibre library tree
identifier-name: the key on which to link matching books;
the default is mobi-asin
If the identifier '?' is specified the available
identifiers in use in other-library are listed.
identifier-values: specific book identifiers to import
If no identifiers are provided, all books which have
the specified identifier will be pulled.
shell
Run an interactive Python prompt with some predefined names:
calibre: the CalibreTree
options: self.options
tag [-n] [--] [-]tag[,tag...] book_specs...
dedrm [-D dedrm_package_path] subcommand [args...]
-D Specify the filesystem path to the DeDRM/noDRM plugin top level.
For example, if you had a checkout of git@github.com:noDRM/DeDRM_tools.git
at /path/to/DeDRM_tools--noDRM you could supply:
-D /path/to/DeDRM_tools--noDRM/DeDRM_plugin
or place that value in the $DEDRM_PACKAGE_PATH environment variable.
Subcommands:
help [-l] [subcommand-names...]
Print the full help for the named subcommands,
or for all subcommands if no names are specified.
-l Long help even if no subcommand-names provided.
import module_name...
Exercise the DeDRM python import mechanism for each module_name.
kindlekeys [import]
import Read a JSON list of key dicts and update the cached keys.
remove filenames...
Remove DRM from the specified filenames.
shell
Run a command prompt via cmd.Cmd using this command's subcommands.
help [-l] [subcommand-names...]
Print the full help for the named subcommands,
or for all subcommands if no names are specified.
-l Long help even if no subcommand-names provided.
kindle [-C calibre_library] [-K kindle-library-path] [subcommand [...]]
-C calibre_library
Specify calibre library location.
-K kindle_library
Specify kindle library location.
Subcommands:
app_path [content-path]
Report or set the content path for the Kindle application.
dbshell
Start an interactive database prompt.
export [-fnqv] [ASINs...]
Export AZW files to Calibre library.
-f Force: replace the AZW3 format if already present.
-n No action, recite planned actions.
-q Quiet: report only warnings.
-v Verbose: report more information about actions and inaction.
ASINs Optional ASIN identifiers to export.
The default is to export all books with no "calibre.dbid" fstag.
help [-l] [subcommand-names...]
Print the full help for the named subcommands,
or for all subcommands if no names are specified.
-l Long help even if no subcommand-names provided.
import_tags [-nqv] [ASINs...]
Import Calibre book information into the fstags for a Kindle book.
This will support doing searches based on stuff like
titles which are, naturally, not presented in the Kindle
metadata db.
info
Report basic information.
ls [-l]
List the contents of the library.
-l Long mode.
shell
Run a command prompt via cmd.Cmd using this command's subcommands.
kobo subcommand [...]
Subcommands:
export [-fnqv] [volumeids...]
Export Kobo books to Calibre library.
-f Force: replace the EPUB format if already present.
-n No action, recite planned actions.
-q Quiet: report only warnings.
-v Verbose: report more information about actions and inaction.
volumeids
Optional Kobo volumeid identifiers to export.
The default is to export all books.
(TODO: just those with no "calibre.dbid" fstag.)
help [-l] [subcommand-names...]
Print the full help for the named subcommands,
or for all subcommands if no names are specified.
-l Long help even if no subcommand-names provided.
info
Report basic information.
ls [volumeids...]
List the contents of the library.
(TODO: -l Long mode.)
volumeids
Optional Kobo volumeid identifiers to list.
shell
Run a command prompt via cmd.Cmd using this command's subcommands.
mobi subcommand [...]
Subcommands:
extract mobipath [outdir]
Extract the contents of the MOBI file mobipath
into the directory outdir, default based on the mobipath basename.
Prints the outdir and the name of the top file.
help [-l] [subcommand-names...]
Print the full help for the named subcommands,
or for all subcommands if no names are specified.
-l Long help even if no subcommand-names provided.
make_cbz mobipath [cbzpath]
Unpack a MOBI file and construct a CBZ file.
Prints the path of the CBZ file to the output.
The default cbzpath is mobibase.cbz where mobibase is the
basename of mobipath with its extension removed.
shell
Run a command prompt via cmd.Cmd using this command's subcommands.
pdf subcommand [...]
Subcommands:
extract_images pdf-files...
Extract the images from the named page files.
help [-l] [subcommand-names...]
Print the full help for the named subcommands,
or for all subcommands if no names are specified.
-l Long help even if no subcommand-names provided.
make_cbz pdf-files...
Extract the images from the named page files.
scan pdf-files...
Scan the PDF-data in pdf-files and report.
shell
Run a command prompt via cmd.Cmd using this command's subcommands.
xi pdf-files...
Extract the images from the named page files.
shell
Run a command prompt via cmd.Cmd using this command's subcommands.
# Release Log
*Release 20240316*:
Fixed release upload artifacts.
*Release 20240305*:
Minor changes.
*Release 20240201.4*:
* CBZ support.
* Kobo support.
* PDF support.
* Assorted new things and doubtless new bugs.
*Release 20240201.3*:
* CBZ support.
* Kobo support.
* PDF support.
* Assorted new things and doubtless new bugs.
*Release 20240201.2*:
* CBZ support.
* Kobo support.
* PDF support.
* Assorted new things and doubtless new bugs.
*Release 20240201.1*:
* Kobo support.
* CBZ support.
* PDF support.
* Several new features and doubtless bugs.
*Release 20240201*:
* Kobo support.
* PDF support.
* CBZ support.
* Many new things and fixes.
*Release 20230704*:
* CalibreCommand.cmd_linkto: link series members to a subdirectory unless a specific link_format is supplied.
* CalibreTree: do not make a db session for startup_shutdown, instead offer a separate db_session context manager because we need the db released to run any Calibre executable.
* CalibreCommand.cmd_ls: hold a db session during the listing.
* Assorted internal changes.
*Release 20230110*:
* cs.ebooks.dedrm: new experimental module to use DeDRM/noDRM outside the Calibre plugin environment.
* Use the dedrm stuff in "kindle export" and "calibre add".
* Set $DEDRM_PACKAGE_PATH to the path to the DeDRM_plugin subdirectory of a checkout of git@github.com:noDRM/DeDRM_tools.git.
*Release 20221228*:
* CalibreCommand.popbooks: do not require argv to be empty at the end.
* KindleBook: new amazon_url property returning an Amazon web page URL based on the ASIN.
* New default_kindle_library() function consulting the envvar and app defaults; adjust KindleTree to use this.
* New kindle_content_path_default() and kindle_content_path() functions; use these in default_kindle_library().
* KindleCommand: new "app-path" subcommand to report or set the Kindle application content path.
* CalibreCommand.cmd_ls: new -r (reverse) and -t (timestamp) sorting options.
* Assorted minor updates.
*Release 20220805*:
* CalibreCommand.books_from_spec: UPPERCASE matches a format.
* CalibreCommand: new cmd_linkto to link book files into an external directory with nice names.
* CalibreTree: fix .fspath and the associated .pathto and format paths.
*Release 20220626*:
* CalibreBook: new setter mode for .tags, CalibreCommand: new cmd_tags to update tags.
* CalibreBook.pull_format: AZW formats: also check for AZW4.
* CalibreCommand.books_from_spec: /regexp: search the tags as well.
* CalibreBook: subclass FormatableMixin; CalibreCommand.cmd_ls: new "-o ls_format" option for the top line format.
*Release 20220606*:
Initial PyPI release.
Raw data
{
"_id": null,
"home_page": "",
"name": "cs.ebooks",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python3",
"author": "",
"author_email": "Cameron Simpson <cs@cskk.id.au>",
"download_url": "https://files.pythonhosted.org/packages/e9/36/66081962e9222e69f6c9a662e6b9851bb5f010d91e53ac4de8c60cb6d329/cs.ebooks-20240316.tar.gz",
"platform": null,
"description": "Utilities and command line for working with EBooks.\nBasic support for talking to Apple Books, Calibre, CBZ, Kindle, Kobo, Mobi, PDF.\nThese form the basis of my personal Kindle/Kobo/Calibre workflow.\n\n*Latest release 20240316*:\nFixed release upload artifacts.\n\nThe command `python -m cs.ebooks help -l` gives the basic usage information:\n\n help:\n apple subcommand [...]\n Subcommands:\n dbshell\n Start an interactive database shell.\n help [-l] [subcommand-names...]\n Print the full help for the named subcommands,\n or for all subcommands if no names are specified.\n -l Long help even if no subcommand-names provided.\n ls\n List books in the library.\n md\n List metadata.\n shell\n Run a command prompt via cmd.Cmd using this command's subcommands.\n calibre [-C calibre_library] [-K kindle-library-path] subcommand [...]\n -C calibre_library\n Specify calibre library location.\n -K kindle_library\n Specify kindle library location.\n -O other_calibre_library\n Specify alternate calibre library location, the default library\n for pull etc. The default comes from $CALIBRE_LIBRARY_OTHER.\n Subcommands:\n add [-nqv] bookpaths...\n Add the specified ebook bookpaths to the library.\n --cbz Also make a CBZ.\n -n No action: recite planned actions.\n -q Quiet: only emit warnings.\n -v Verbose: report all actions and decisions.\n convert [-fnqv] formatkey dbids...\n Convert books to the format `formatkey`.\n -f Force: convert even if the format is already present.\n -n No action: recite planned actions.\n -q Quiet: only emit warnings.\n -v Verbose: report all actions and decisions.\n dbshell\n Start an interactive database prompt.\n help [-l] [subcommand-names...]\n Print the full help for the named subcommands,\n or for all subcommands if no names are specified.\n -l Long help even if no subcommand-names provided.\n info\n Report basic information.\n linkto [-1fnqv] [-d linkto-dir] [-F fmt,...] [-o link-format] [dbids...]\n Export books to linkto-dir by hard linking.\n -1 Link only the first format found.\n -d linkto-dir Specify the target directory, default from $MEDIA_BOOKSPATH\n or ~/media/books.\n -F fmt,... Source formats, default: ['CBZ', 'EPUB']\n -f Force. Replace existing links.\n -n No action. Report planned actions.\n -o link-format Link name format.\n -q Quiet.\n -v Verbose.\n ls [-l] [-o ls-format] [book_specs...]\n List the contents of the Calibre library.\n -l Long mode, listing book details over several lines.\n -o ls_format Output format for use in a single line book listing.\n -r Reverse the listing order.\n -t Order listing by timestamp.\n make_cbz book_specs...\n Add the CBZ format to the designated Calibre books.\n prefs\n List the library preferences.\n pull [-fnqv] [/path/to/other-library] [identifiers...]\n Import formats from another Calibre library.\n -f Force. Overwrite existing formats with formats from other-library.\n -n No action: recite planned actions.\n -q Quiet. Only issue warnings and errors.\n -v Verbose. Print more information.\n /path/to/other-library: optional path to another Calibre library tree\n identifier-name: the key on which to link matching books;\n the default is mobi-asin\n If the identifier '?' is specified the available\n identifiers in use in other-library are listed.\n identifier-values: specific book identifiers to import\n If no identifiers are provided, all books which have\n the specified identifier will be pulled.\n shell\n Run an interactive Python prompt with some predefined names:\n calibre: the CalibreTree\n options: self.options\n tag [-n] [--] [-]tag[,tag...] book_specs...\n dedrm [-D dedrm_package_path] subcommand [args...]\n -D Specify the filesystem path to the DeDRM/noDRM plugin top level.\n For example, if you had a checkout of git@github.com:noDRM/DeDRM_tools.git\n at /path/to/DeDRM_tools--noDRM you could supply:\n -D /path/to/DeDRM_tools--noDRM/DeDRM_plugin\n or place that value in the $DEDRM_PACKAGE_PATH environment variable.\n Subcommands:\n help [-l] [subcommand-names...]\n Print the full help for the named subcommands,\n or for all subcommands if no names are specified.\n -l Long help even if no subcommand-names provided.\n import module_name...\n Exercise the DeDRM python import mechanism for each module_name.\n kindlekeys [import]\n import Read a JSON list of key dicts and update the cached keys.\n remove filenames...\n Remove DRM from the specified filenames.\n shell\n Run a command prompt via cmd.Cmd using this command's subcommands.\n help [-l] [subcommand-names...]\n Print the full help for the named subcommands,\n or for all subcommands if no names are specified.\n -l Long help even if no subcommand-names provided.\n kindle [-C calibre_library] [-K kindle-library-path] [subcommand [...]]\n -C calibre_library\n Specify calibre library location.\n -K kindle_library\n Specify kindle library location.\n Subcommands:\n app_path [content-path]\n Report or set the content path for the Kindle application.\n dbshell\n Start an interactive database prompt.\n export [-fnqv] [ASINs...]\n Export AZW files to Calibre library.\n -f Force: replace the AZW3 format if already present.\n -n No action, recite planned actions.\n -q Quiet: report only warnings.\n -v Verbose: report more information about actions and inaction.\n ASINs Optional ASIN identifiers to export.\n The default is to export all books with no \"calibre.dbid\" fstag.\n help [-l] [subcommand-names...]\n Print the full help for the named subcommands,\n or for all subcommands if no names are specified.\n -l Long help even if no subcommand-names provided.\n import_tags [-nqv] [ASINs...]\n Import Calibre book information into the fstags for a Kindle book.\n This will support doing searches based on stuff like\n titles which are, naturally, not presented in the Kindle\n metadata db.\n info\n Report basic information.\n ls [-l]\n List the contents of the library.\n -l Long mode.\n shell\n Run a command prompt via cmd.Cmd using this command's subcommands.\n kobo subcommand [...]\n Subcommands:\n export [-fnqv] [volumeids...]\n Export Kobo books to Calibre library.\n -f Force: replace the EPUB format if already present.\n -n No action, recite planned actions.\n -q Quiet: report only warnings.\n -v Verbose: report more information about actions and inaction.\n volumeids\n Optional Kobo volumeid identifiers to export.\n The default is to export all books.\n (TODO: just those with no \"calibre.dbid\" fstag.)\n help [-l] [subcommand-names...]\n Print the full help for the named subcommands,\n or for all subcommands if no names are specified.\n -l Long help even if no subcommand-names provided.\n info\n Report basic information.\n ls [volumeids...]\n List the contents of the library.\n (TODO: -l Long mode.)\n volumeids\n Optional Kobo volumeid identifiers to list.\n shell\n Run a command prompt via cmd.Cmd using this command's subcommands.\n mobi subcommand [...]\n Subcommands:\n extract mobipath [outdir]\n Extract the contents of the MOBI file mobipath\n into the directory outdir, default based on the mobipath basename.\n Prints the outdir and the name of the top file.\n help [-l] [subcommand-names...]\n Print the full help for the named subcommands,\n or for all subcommands if no names are specified.\n -l Long help even if no subcommand-names provided.\n make_cbz mobipath [cbzpath]\n Unpack a MOBI file and construct a CBZ file.\n Prints the path of the CBZ file to the output.\n The default cbzpath is mobibase.cbz where mobibase is the\n basename of mobipath with its extension removed.\n shell\n Run a command prompt via cmd.Cmd using this command's subcommands.\n pdf subcommand [...]\n Subcommands:\n extract_images pdf-files...\n Extract the images from the named page files.\n help [-l] [subcommand-names...]\n Print the full help for the named subcommands,\n or for all subcommands if no names are specified.\n -l Long help even if no subcommand-names provided.\n make_cbz pdf-files...\n Extract the images from the named page files.\n scan pdf-files...\n Scan the PDF-data in pdf-files and report.\n shell\n Run a command prompt via cmd.Cmd using this command's subcommands.\n xi pdf-files...\n Extract the images from the named page files.\n shell\n Run a command prompt via cmd.Cmd using this command's subcommands.\n\n# Release Log\n\n\n\n*Release 20240316*:\nFixed release upload artifacts.\n\n*Release 20240305*:\nMinor changes.\n\n*Release 20240201.4*:\n* CBZ support.\n* Kobo support.\n* PDF support.\n* Assorted new things and doubtless new bugs.\n\n*Release 20240201.3*:\n* CBZ support.\n* Kobo support.\n* PDF support.\n* Assorted new things and doubtless new bugs.\n\n*Release 20240201.2*:\n* CBZ support.\n* Kobo support.\n* PDF support.\n* Assorted new things and doubtless new bugs.\n\n*Release 20240201.1*:\n* Kobo support.\n* CBZ support.\n* PDF support.\n* Several new features and doubtless bugs.\n\n*Release 20240201*:\n* Kobo support.\n* PDF support.\n* CBZ support.\n* Many new things and fixes.\n\n*Release 20230704*:\n* CalibreCommand.cmd_linkto: link series members to a subdirectory unless a specific link_format is supplied.\n* CalibreTree: do not make a db session for startup_shutdown, instead offer a separate db_session context manager because we need the db released to run any Calibre executable.\n* CalibreCommand.cmd_ls: hold a db session during the listing.\n* Assorted internal changes.\n\n*Release 20230110*:\n* cs.ebooks.dedrm: new experimental module to use DeDRM/noDRM outside the Calibre plugin environment.\n* Use the dedrm stuff in \"kindle export\" and \"calibre add\".\n* Set $DEDRM_PACKAGE_PATH to the path to the DeDRM_plugin subdirectory of a checkout of git@github.com:noDRM/DeDRM_tools.git.\n\n*Release 20221228*:\n* CalibreCommand.popbooks: do not require argv to be empty at the end.\n* KindleBook: new amazon_url property returning an Amazon web page URL based on the ASIN.\n* New default_kindle_library() function consulting the envvar and app defaults; adjust KindleTree to use this.\n* New kindle_content_path_default() and kindle_content_path() functions; use these in default_kindle_library().\n* KindleCommand: new \"app-path\" subcommand to report or set the Kindle application content path.\n* CalibreCommand.cmd_ls: new -r (reverse) and -t (timestamp) sorting options.\n* Assorted minor updates.\n\n*Release 20220805*:\n* CalibreCommand.books_from_spec: UPPERCASE matches a format.\n* CalibreCommand: new cmd_linkto to link book files into an external directory with nice names.\n* CalibreTree: fix .fspath and the associated .pathto and format paths.\n\n*Release 20220626*:\n* CalibreBook: new setter mode for .tags, CalibreCommand: new cmd_tags to update tags.\n* CalibreBook.pull_format: AZW formats: also check for AZW4.\n* CalibreCommand.books_from_spec: /regexp: search the tags as well.\n* CalibreBook: subclass FormatableMixin; CalibreCommand.cmd_ls: new \"-o ls_format\" option for the top line format.\n\n*Release 20220606*:\nInitial PyPI release.\n\n",
"bugtrack_url": null,
"license": "GNU General Public License v3 or later (GPLv3+)",
"summary": "Utilities and command line for working with EBooks. Basic support for talking to Apple Books, Calibre, CBZ, Kindle, Kobo, Mobi, PDF. These form the basis of my personal Kindle/Kobo/Calibre workflow.",
"version": "20240316",
"project_urls": {
"URL": "https://bitbucket.org/cameron_simpson/css/commits/all"
},
"split_keywords": [
"python3"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6ea0f4a33b6d71d80f1344e90f8c51b9e7e620e3bd84c70bd34a93496f6d1360",
"md5": "f869defffc48bfed20d35ed93d0bc75c",
"sha256": "8f777e0f4603d4513e0cf0066cbaceb5ba6098273536f8679414fcc2d398cff6"
},
"downloads": -1,
"filename": "cs.ebooks-20240316-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f869defffc48bfed20d35ed93d0bc75c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 61651,
"upload_time": "2024-03-16T05:53:38",
"upload_time_iso_8601": "2024-03-16T05:53:38.421088Z",
"url": "https://files.pythonhosted.org/packages/6e/a0/f4a33b6d71d80f1344e90f8c51b9e7e620e3bd84c70bd34a93496f6d1360/cs.ebooks-20240316-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e93666081962e9222e69f6c9a662e6b9851bb5f010d91e53ac4de8c60cb6d329",
"md5": "6f51d7a90b2091193faadbe0fd69f065",
"sha256": "f7716d67de0b491bc025ae28d2950ce43a2a885f32793c69e207b09c465c7de0"
},
"downloads": -1,
"filename": "cs.ebooks-20240316.tar.gz",
"has_sig": false,
"md5_digest": "6f51d7a90b2091193faadbe0fd69f065",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 57358,
"upload_time": "2024-03-16T05:53:40",
"upload_time_iso_8601": "2024-03-16T05:53:40.764548Z",
"url": "https://files.pythonhosted.org/packages/e9/36/66081962e9222e69f6c9a662e6b9851bb5f010d91e53ac4de8c60cb6d329/cs.ebooks-20240316.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-16 05:53:40",
"github": false,
"gitlab": false,
"bitbucket": true,
"codeberg": false,
"bitbucket_user": "cameron_simpson",
"bitbucket_project": "css",
"lcname": "cs.ebooks"
}