erykjj / jwlmanager

Multi-platform GUI for managing JW Library (.jwlibrary and .jwlplaylist) files: view, delete, edit, merge (via export/import), etc.
MIT License
63 stars 8 forks source link

Excel Export Feature #95

Closed vegsetup closed 11 months ago

vegsetup commented 12 months ago

Morning Brothers,

I really enjoy using your JWLManager to clean up my JW information every few weeks. I have also used it very successfully to help others clean out their bloated JW Library database.

However I also used https://github.com/AntonyCorbett/JWLMerge to export my study bible notes to Excel, both to share and as a backup. The Excel export that Corbett made use of allowed very easy filtering of the exported information and in a simple format that could be shared. Unfortunately JWLMerge is now archived and no longer being developed, neither does it work with the current database schema of JW Library.

Would it be possible to adapt his Excel export code to work with your system to provide the same functionality?

Below is a sample of what the exported file from JWLMerge would look like.

Copy of Export from JW Library.xlsx

Thank you Veg

erykjj commented 11 months ago

This will be the final pre-release: https://github.com/erykjj/jwlmanager/releases/tag/v3.0.0-RC2

vegsetup commented 11 months ago

Hi Eryk, just back. Wil start testing.

On Tue, 3 Oct 2023, 23:03 Eryk J., @.***> wrote:

@vegsetup https://github.com/vegsetup please test as thouroughly as you can. Thank you! https://github.com/erykjj/jwlmanager/releases/tag/v3.0.0-RC

— Reply to this email directly, view it on GitHub https://github.com/erykjj/jwlmanager/issues/95#issuecomment-1745722070, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCWNXHRZN7HGQPOUXZFQ5PLX5R4SNAVCNFSM6AAAAAA47RIJICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBVG4ZDEMBXGA . You are receiving this because you were mentioned.Message ID: @.***>

vegsetup commented 11 months ago

Morning Eryk,

In RC2, with the bible notes in the study bible, the reference or HEADING column is now only showing the book and chapter, not the verse for completeness. Have attached my Excel so you can see.

Also, with the bible notes in the study bible, I could not find a pattern but some of the references/HEADINGS are now showing up while others are not. This again has only started since August. I sorted by date created and date modified and again in both instances some appear and others nots. Will see in the Excel as well. As an example, if you filter out BOOK 16 in the EXCEL you will see some of the references/HEADINGS are there but others not. Interestingly nothing is there for BOOK 17 which is Esther.

JWL_Notes_2023-10-05.xlsx

It seems import from Excel is not working. When I press on IMPORT it wants it in UTF-8 format, does not give you the option to import in XLSX format. When you proceed you can choose which format you want to import but when you choose XLSX it pops up with the following error:

JWLManager v3.0.0-RC2 Windows-10-10.0.22621-SP0

Traceback (most recent call last): File "pandas\compat_optional.py", line 132, in import_optional_dependency File "importlib__init__.py", line 126, in import_module File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1140, in _find_and_load_unlocked ModuleNotFoundError: No module named 'openpyxl'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "JWLManager.py", line 1646, in init File "pandas\io\excel_base.py", line 504, in read_excel File "pandas\io\excel_base.py", line 1580, in init File "pandas\io\excel_openpyxl.py", line 552, in init File "pandas\compat_optional.py", line 135, in import_optional_dependency ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl.

Here is a copy of the excel I was trying to import and you will notice the one change I made to line 5 on Title and Note

JWL_Notes_2023-10-05.xlsx

I have not done any testing yet on publications.

erykjj commented 11 months ago

Welcome back and thanks for the report!!! It was a missing dependency (required for reading the Excel file). I've added it into the build process now. I've also removed the alert about UTF-8 formatting as it doesn't apply to MS Excel files. Please test again with this (last :-)) pre-release: https://github.com/erykjj/jwlmanager/releases/tag/v3.0.0-RC3

As to the empty HEADINGs, I have a pretty good idea what's up with that, and just need to make a decision as to how to proceed. So I'll explain later and get your input then ;-)

erykjj commented 11 months ago

I just noticed that the zipped Windows build almost trippled in size!!! Something is not right there - I just added a small library/module. I'll have to look into that now ;-\

erykjj commented 11 months ago

I just noticed that the zipped Windows build almost trippled in size!!! Something is not right there - I just added a small library/module. I'll have to look into that now ;-\

Fixed: https://github.com/erykjj/jwlmanager/releases/tag/v3.0.0-RC4

erykjj commented 11 months ago

So, about the HEADINGs, here is your export, with book 17 (Esther) showing blank in the HEADING column: 2023-10-05_11-46-06

In the Data Viewer, I generate the reference (including the verse), but it is based on the currently-selected language (not the language of the Bible edition): 2023-10-05_11-49-13

The JW Library app, generates this reference (Book and Chapter only), based on the language of the Bible used - even though in the archive it is blank: 2023-10-05_11-50-43

What it comes down to is that the information in that field is generated/updated in on-the-spot the JW Library app. It also appears that (as of v14 of the JW Library app), that field (in the database) isn't even used.

I will keep the Data Viewer feature, but I'm thinking of not including the HEADING field in the export/import process. What do you think? How useful is it to have it in the Excel? One can sort by BK, CH and VS. Does one need to see "Esther 9" in there? Would "Esther 9:10" be even more useful/practical?

Please think about this and give me your input ;-)

vegsetup commented 11 months ago

Okay, tested RC4 with the study bible.

Export and Import work well now with no errors or UTF-8 message popping up. There is one thing I noticed with the import. I edited the one line in the excel spreadsheet, when I imported the Excel spreadsheet into JWLManager I noticed that the note count increased by two. It seems that the JWLManager added an extra note instead of editing it. This was also evident in JW Library, the editing I did in Excel did not edit the note, it left the old note and it added the editing as a separate note on the same scripture. That may be by design but thought it worth while mentioning.

On your explanation above about the HEADING, I noticed something similar. In the screen shot below, the first two records where created days apart and are from the same book. When the DataViewer has the Book | Chapter then it shows in the HEADING column on the Excel sheet. When the DataViewer has the Book | Chapter | Verse it comes up as blank in the HEADING column. Somehow it seems the records that have the Book | Chapter | Verse mostly always have TAGS on them....????

2023-10-05 19_07_56-Data Viewer_ 46 Notes

On your question of how useful it is to have the BOOK name in Excel, from my vantage point it is very useful and important. The best of us is never going to know which bible book is "40" or "17". The actual name helps to clarify that very quickly. Having something like "Esther 9:10" in the Excel sheet is very useful and practical?

erykjj commented 11 months ago

There is one thing I noticed with the import. I edited the one line in the excel spreadsheet, when I imported the Excel spreadsheet into JWLManager I noticed that the note count increased by two. It seems that the JWLManager added an extra note instead of editing it. This was also evident in JW Library, the editing I did in Excel did not edit the note, it left the old note and it added the editing as a separate note on the same scripture. That may be by design but thought it worth while mentioning.

Very good observations. By design: if the TITLE changes, another note is added, even if NOTE is exactly the same; if the TITLE is unchanged, the note is overwritten by the last one to be imported. Please confirm this is what is happening.

vegsetup commented 11 months ago

On the Enjoy Life and Watchtowers

The Export and import to XLS work well.

This may be a repeat of what was said before but just in case:

In the Enjoy Life, the CHAPTER name is working in the HEADING column for CHAP 52 but then stops in CHAP 53 In the Watchtower, the ARTICLE name is working in the HEADING column for the May 2023 Study Article 23 but then stops in the May 2023 Study Article 24.

erykjj commented 11 months ago

When the DataViewer has the Book | Chapter then it shows in the HEADING column on the Excel sheet. When the DataViewer has the Book | Chapter | Verse it comes up as blank in the HEADING column.

The Data Viewer adds the "Book Chapter:Verse" only if the field was empty. I can adjust that for all fields.

erykjj commented 11 months ago

On the Enjoy Life and Watchtowers

The Export and import to XLS work well.

This may be a repeat of what was said before but just in case:

In the Enjoy Life, the CHAPTER name is working in the HEADING column for CHAP 52 but then stops in CHAP 53 In the Watchtower, the ARTICLE name is working in the HEADING column for the May 2023 Study Article 23 but then stops in the May 2023 Study Article 24.

That's why I'm pretty sure it's not related to my app but the way JW Library writes to the database in the archive. Bug???

vegsetup commented 11 months ago

Very good observations. By design: if the TITLE changes, another note is added, even if NOTE is exactly the same; if the TITLE is unchanged, the note is overwritten by the last one to be imported. Please confirm this is what is happening.

Excellent, confirmed this is how it is working. Thank you for the explanation.

erykjj commented 11 months ago

OK, final one (I hope :-) https://github.com/erykjj/jwlmanager/releases/tag/v3.0.0-RC5 Please tell me if this behaves as expected/desired. Thank you for all your testing, @vegsetup !!

vegsetup commented 11 months ago

Morning Eryk,,

It may be a bug as you say but the BETA testers have not mentioned any problems. Will keep my eyes and ears open.

For myself personally, having something like "Esther 9:10" in the Excel sheet for the study bible is important as it provides a easy way to isolate the scripture the title and note is referring too.

In the Enjoy Life publication and even the Watchtower it is less important as you able to work out the chapter of each record by looking at the DOCUMENT column of the Enjoy Life and the ISSUE column of the Watchtower.

Enjoy your day.

erykjj commented 11 months ago

How about something like 17009010 (BBCCCVVV) for the scripture references? Would that help? That's already in the link.

vegsetup commented 11 months ago

Hi Eryk,

That is an option, one would just have to find out which book is 17 to know where your are in the Bible. In the list editing you could always do a search and replace in the excel sheet or add another column to add the actual book name.

Not as nice as the actual full scripture listed Esther 9:10 but maybe that is all that is possible with the current database structure.

Thanks Eryk, hope the weekend goes well.

On Fri, 6 Oct 2023, 13:41 Eryk J., @.***> wrote:

How about something like 17009010 (BBCCCVVV) for the scripture references? Would that help? That's already in the link.

— Reply to this email directly, view it on GitHub https://github.com/erykjj/jwlmanager/issues/95#issuecomment-1750498363, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCWNXHTMCLJ7KQM3J7UPBKLX57U5TAVCNFSM6AAAAAA47RIJICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJQGQ4TQMZWGM . You are receiving this because you were mentioned.Message ID: @.***>

erykjj commented 11 months ago

https://github.com/erykjj/jwlmanager/releases/tag/v3.0.0