exam2pptvideo package

Submodules

exam2pptvideo.exam_ppt module

class exam2pptvideo.exam_ppt.ExamPPT(sourcefile, title='', genre='classic')

Bases: object

It is designed as an abstract class to be inheritated for exam ppt generation of different languages,

Note

DON’T use this class directly. To define a ExamPPT for a lanugage

  1. Define subclass inheriting ExamPPT, e.g, ChineseExamPPT

  2. Define class variable _templates, which is a dict, key is template genre, value is template path

  3. Define class variable content_keys, which is a list, containing the heads in csv file

convert_to_ppt(destfile='test.pptx')

Convert csv file containing exam information into pptx file

Parameters

destfile (str) – pptx file path

exam2pptvideo.exam_video module

class exam2pptvideo.exam_video.ExamVideo(sourceppt)

Bases: object

It is designed as an abstract class to be inheritated for exam video generation of different languages,

Note

DON’T use this class directly. To define a ExamVideo for a lanugage

  1. Define subclass inheriting ExamVideo, e.g, ChineseExamVideo

  2. Define class variable _soundindex, which is a dict, key is slide type, value is sound path

create_videos(video_folder)

Generate videos from pptx

Parameters

video_folder (str) – path to store videos

exam2pptvideo.lib module

exam2pptvideo.lib.pdf2images(pdfpath, imgfolder='./', start=0, end=None)

Convert pdf into images

Parameters
  • pdfpath (str) – pdf file path

  • imgfolder (str) – image folder. Default is current folder

  • start (int) – start page of pdf

  • end (int) – end page pdf

Returns

number of images stored

Return type

int

exam2pptvideo.lib.pptx2pdf(pptx, pdffolder='./')

Convert pptx into pdf

Parameters
  • pptx (str) – pptx file

  • pdffile (str) – folder that the pdf is stored in

Returns

pdf file path

Return type

str

exam2pptvideo.lib.readCSV(filename)

Read csv file

Parameters

filename (str) – csv file name

Returns

records in csv file

Return type

list of dict

Module contents