thisisparker / xword-dl

⬛⬜⬛ Command line tool to scrape crosswords from online solvers and save them as .puz files ⬛⬜⬛
MIT License
140 stars 30 forks source link

RFE: iPuz output choice #123

Open ehcloninger opened 10 months ago

ehcloninger commented 10 months ago

In talking with the creator of the Forkyz Android app, I wonder if we could build support for writing iPuz into xword-dl as an option. iPuz has more metadata than puz, so some reasonable defaults would have to be inferred or chosen. There's already a library in PyPI to read/write the puzzles. I'll see if I can shoehorn in the support, but it may be beyond my meager skills.

ehcloninger commented 10 months ago

I played with this briefly today but I'm not sure I like the direction of it. svisser/crossword has 2 utility functions that read/write both puz and ipuz with their own data type holding the content. I was able to send the puzzle file read by xword-dl using cw = crossword.from_puz(puz) and create an iPuz using ipuz = crossword.to_ipuz(cw). Some of the puzzle structure gets lost in the transmission, so the puzzle grid ends up as nulls in the output.

I'm not sure this is a great use of time. I actually solved the thing that was causing the itch. I would load a bunch of crosswords I downloaded using xword-dl onto my phone. When I opened Forkyz, all the data was messed up in the picker. @yourealwaysbe explained how the import function works in the app and now those crosswords have the correct metadata in the picker.