Skip to content

scotttherobot/ElementPool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ElementPool

This is a Python parser for Amateur Radio Exam element question pools. This was tested and built against the 2014 Element 2 (Technician Class) question pool.

Usage

All you need is a filename.

import ElementPool

# Instantiate an object using the file path
pool = ElementPool.ElementPool('pools/2014-2018 Tech Pool.txt')

# To get at the raw data structures, you can call sortedQuestions()
sortedQs = pool.sortedQuestions()

# If you don't care if they're sorted
unsorted = pool.questions

# You can even treat it like a string.
print pool

Data structure

What does the question data structure look like? Here's a short sample of what is returned from pool.sortedQuestions(). I've broken up each question tuple some for readability.

[
('T1A01', {
   'choices': [
      ('A', 'Providing personal radio communications for as many citizens as possible'), 
      ('B', 'Providing communications for international non-profit organizations'), 
      ('C', 'Advancing skills in the technical and communication phases of the radio art'), 
      ('D', 'All of these choices are correct ')
   ], 
   'prompt': 'Which of the following is a purpose of the Amateur Radio Service as stated in the FCC rules and regulations?', 
   'id': 'T1A01', 
   'figure': '', 
   'correct': 'C'
}), 
('T6C08', {
   'choices': [
      ('A', 'Variable capacitor'), 
      ('B', 'Variable inductor'), 
      ('C', 'Variable resistor'), 
      ('D', 'Variable transformer')
   ],
   'prompt': 'What is component 9 in figure T2?', 
   'id': 'T6C08', 
   'figure': 'T2', 
   'correct': 'C'
})
]

About

A parser for Amateur Radio Exam question pools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages