Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sort_by functionality, export location in file, extract bookmark_id, add column to CSV output #1

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

Th0masL
Copy link
Owner

@Th0masL Th0masL commented Jan 30, 2023

This PR includes most of the improvements made in other forks (see Network graph), plus some extra improvements.

Example of new output, sorted by Location:

$ ./export-kobo.py KoboReader.sqlite --order_by location

Type:           highlight
Title:          Some Book
Author:         Some Author
Location:       0.272727 ops/ch05.html#point(/1/4/1:1)
Date created:   2023-01-29T21:05:25.000
Reference text:
=== === ===
Some text 1
=== === ===


Type:           highlight
Title:          Some Book
Author:         Some Author
Location:       0.278409 ops/ch06.html#point(/1/4/1:1)
Date created:   2023-01-29T21:09:15.000
Reference text:
=== === ===
Some text 2
=== === ===

@Th0masL
Copy link
Owner Author

Th0masL commented Jan 30, 2023

This PR resolves the issue pettarin/export-kobo/issues/3

@Th0masL
Copy link
Owner Author

Th0masL commented Jan 30, 2023

This should also more or less resolve the issue pettarin/export-kobo/issues/5.

We can now use the value of Location to try to extract the Chapter, like on the example of output :

                              v
Location:       0.272727 ops/ch05.html#point(/1/4/1:1)

But this is not going to always work, because the chapter number/name might not always be present in the name of the HTML file of the ebook.

@Th0masL Th0masL merged commit 8ffdc0c into master Jan 30, 2023
@Th0masL Th0masL deleted the development branch January 30, 2023 01:01
@kriss6557
Copy link

kriss6557 commented Sep 2, 2023

Hi Thomas,
I can see the Bookmark/chapterprogress column shows a percentage of the book where the highlight is.


Location: 0.272727 ops/ch05.html#point(/1/4/1:1)
Here 27,2727%

Multiplied by the number of pages in the book, we can get the page of the highlight, which is more useful I think.

But I can see no information regarding the number of pages of a book.

Maybe content/___NumPages but for pdf only. It doesn’t seem to give any information for epub/mobi files for instance.

Do you know a way of getting a book’s number of pages ?
This would make it a more "readable" information.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants