Package: textbook-assembler
Textbook AssemblerA tool for assembling a collection of PDF resources into a single "textbook"While it's nice to teach from a textbook, the modern teacher has a huge array of resources to pull from, including unpublished notes, lecture slides, and even code repositories. Providing students with these resources as a huge library of PDFs is intimidating, disorienting, and confusing. This is especially true when you don't need the entire resource, only a few pages or slides.This package aims to solve this problem by giving teachers an easy way to merge a large volume of files into a single "textbook", which can then be distributed to students. References and links are added to ensure proper credit assignment for everything used in the class.UsageInstall the package using pip:pip install textbook-assemblerTo run the script with default arguments, use:python -m textbook_assemblerThe following arguments are available:python -m textbook_assembler --help

options:
  -h, --help            show this help message and exit
  --lesson_path LESSON_PATH, -l LESSON_PATH
                        Path to the CSV file containing the lesson plan for the textbook
  --source_dir SOURCE_DIR, -s SOURCE_DIR
                        Path to directory containing PDFs to be assembled
  --output_path OUTPUT_PATH, -o OUTPUT_PATH
                        Output path for the assembled textbook
  --bibtex_path BIBTEX_PATH, -b BIBTEX_PATH
                        Path a bibtex file containing reference information for the PDFs in the lesson plan
  --ref_path REF_PATH, -r REF_PATH
                        Path to YAML with mapping between bibtex references and source filesThe defaults are:--lesson_plan materials/lesson_plan.csv
    --source_dir materials/pdfs
    --output_path materials/output/textbook.pdf
    --bibtex_path materials/citations.bib
    --ref_path materials/ref_to_file.yamlDetails and ExampleThe script requires 4 inputs:A directory of PDF files to be assembledA "lesson plan", a csv file with the following columns:week, date, topic, reference, chapter, page_start, page_endA YAML file mapping bibtex reference ids to PDF file namesA bibtex file with citations for all documents included in the lesson planAn example setup is provided in thematerials/directory.Lesson PlanThe lesson plan is the most particular thing required. It should be a CSV file where the rows are class resources, and the columns
are specific metadata about that resource. The required columns are:week, the week of the class the resource will be useddate, the date of the class the resource will be usedtopic, a short description of the topic of the resourcereference, the bibtex ID for this resourcechapter, the chapter number of the resource being usedpage_start, the firstpdf page numberedpage students should readpage_end, the lastpdf page numberedpage students should readNone values are permitted in thechapter,page_start, andpage_endcolumns, but nowhere else. A missing value inpage_startwill be filled with0, while a missing value inpage_endwill be filled with the last page of the resource. Thus, the following entry:WeekDateTopicReferenceChapterpage_startpage_end14-OctConsumption, Savings, Balance of PaymentsGLSNoneNoneNoneWould assign the entire "GLS" reference for students. This can be mixed-and-matched; see the example inmaterials/lesson_plan.csvfor a full exampleReference to File mappingAnother file you need to provide is a mapping from bibtex reference IDs to PDF filenames. This should be a sample YAML file. Here is the mapping from the example inmaterials/ref_to_file.yaml:GLS:GLS_Inter...U:uribe-notes.pdfS1:rbc_notes...S2:stylized_...SE:rbc_exten...The...is a flag for the script to auto-complete. You only need to provide as much of the PDF as is necessary to get a unique match, but you can also provide the entire filename if you like.BibtexThe required bibtex is a normal bibtex object. The only requirements are that:All IDs declared in the bibtex file are used in the lesson planNo unused bibtex entries are present