JASchilz / Ham2Anki

Script to process ham radio exam questions from http://ncvec.org into Anki flash cards. Using Python and the strategy pattern.
MIT License
27 stars 3 forks source link

Expansion to commercial licenses #3

Open ethancedwards8 opened 6 months ago

ethancedwards8 commented 6 months ago

Thanks for the project, currently using it to study for the ham licenses.

Is there any chance that this project could be easily expanded to the commercial license elements? https://www.fcc.gov/wireless/bureau-divisions/mobility-division/commercial-radio-operator-license-program/examinations.

JASchilz commented 6 months ago

Hi @ethancedwards8 . It's definitely an interesting idea: I can see how it's connected to this project and how it would be valuable.

To give you an idea of the current process, because a new question pool for the amateur questions drops around the beginning of each year, I've got a calendar reminder each year to take a look at that new question pool and make it into a card deck using this script. That involves a couple of hours of remembering how to use the script, cleaning up any irregularities in the pool document so that my script can parse it, validating the output, etc.

So although I'm not personally interested in adding the commercial licenses to my workflow or doing a one-time creation, I'd definitely be happy to assist anyone who does want to do that. And if you were to come up with the code changes for that, then you would of course be welcome to either maintain that code in your own fork or even potentially merge it into this copy.

At the highest level, everything needed by this project is in the question pools that you linked to: the question, the header, the possible answers, and the answer key. The project is coded in a modular way, such that if you can provide a Python function which can parse these things then it can generate the cards.

Taking a glance at the question pools for the commercial licenses, I do see some differences that would require a bit of coding: the question pools are stored as PDF documents with page headers; the answer key is at the bottom of each page; etc. All together, with moderate Python skill, I feel like this would be a "2 hours if you understood right away what you're doing and what your approach will be; 5 hours given that you'll be spending time figuring out what to do, futzing with input, etc." kind of project.

If that's something you'd like to take on let me know! I can give you some pointers for getting started. :)

ethancedwards8 commented 6 months ago

For sure! This is something I can handle, I just wanted to ask if you were okay with it being slightly out of scope.

I can definitely try and implement this, I'll take any tips you can throw my way. I did have a chance to poke around in the code and am confident I can figure the PDF parsing out. Thanks for the detailed response.

JASchilz commented 6 months ago

Awesome! If you've already poked around, then you might already have my hints figured out.

Basically, you'll need to implement a class that implements the extract_questions method here: https://github.com/JASchilz/Ham2Anki/blob/6e2a641f497c9537b1c3e403d64b69ffe5e2f1d5/reader/ncev_txt.py#L29-L52 .

The main thing I imagine you'll need to figure out is whether you'll process the PDFs directly in that class, or whether you'd like to do any kind of pre-processing outside of the class, like running some external script to dump the PDFs to text, etc.

My main criteria for whether or not to include it in this main repo would be how self-contained it is: if you write a reader that is either entirely self contained in the sense that it reads the PDFs directly or in the sense that whatever pre-processing steps are well described in the class or file docstring such that anyone else might follow the instructions, then I would be inclined to have it in the main repo. If it's more of a one-off that requires your own knowledge to use, then it would be more appropriate to keep in your own fork. :)

In any case, probably don't plan on listing this project as the help page for the deck: you can reference this project as a tool that you've used, but I won't be in a good position to provide support for any inquiries about the deck itself, the prospect of updating it, etc.