{"id":49016549,"url":"https://github.com/muhammadrafayasif/labs-to-pdf","last_synced_at":"2026-04-19T02:18:03.217Z","repository":{"id":321928398,"uuid":"1079232992","full_name":"muhammadrafayasif/labs-to-pdf","owner":"muhammadrafayasif","description":"A python script that compiles and executes lab programs, captures results, and generates formatted PDF reports ready for submission.","archived":false,"fork":false,"pushed_at":"2025-11-21T15:26:18.000Z","size":786,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-21T17:18:08.367Z","etag":null,"topics":["assignments","automation","python3","script"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhammadrafayasif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-19T11:52:41.000Z","updated_at":"2025-11-21T15:26:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/muhammadrafayasif/labs-to-pdf","commit_stats":null,"previous_names":["muhammadrafayasif/labs-to-pdf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/muhammadrafayasif/labs-to-pdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadrafayasif%2Flabs-to-pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadrafayasif%2Flabs-to-pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadrafayasif%2Flabs-to-pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadrafayasif%2Flabs-to-pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhammadrafayasif","download_url":"https://codeload.github.com/muhammadrafayasif/labs-to-pdf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadrafayasif%2Flabs-to-pdf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31991753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assignments","automation","python3","script"],"created_at":"2026-04-19T02:18:01.385Z","updated_at":"2026-04-19T02:18:03.209Z","avatar_url":"https://github.com/muhammadrafayasif.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧾 Automated Lab Report Generator (Python + ReportLab)\n\nThis project automatically compiles, runs, and generates PDF lab reports for programming labs.  \nIt handles everything — from compiling C++ files to capturing output and formatting it into a professional, university-style PDF with your name, roll number, and department.\n\n---\n\n## 📸 Sample Output\n\nThe generated PDF includes:\n\n- University logo and title page\n- Each lab question’s source code\n- Automatically captured program output (styled like a terminal)\n- Execution time for each task\n- Automatic date and metadata\n\nExample PDF: [CT-24000.pdf](/Lab%201/CT-24000_Lab1.pdf)\n\n---\n\n## ⚙️ Features\n\n- ✅ Automatic Compilation — Uses `g++` to compile each `.cpp` file\n- 📤 Output Capture — Captures console output and formats it like a terminal\n- 🖋️ Beautiful PDF Generation — Uses ReportLab for clean, styled reports\n- 🧑‍🎓 Customizable Branding — Add your own logo, name, roll number, department, and degree\n- 📂 Multi-Lab Support — Process multiple folders like `\"Lab 1\"`, `\"Lab 2\"`, etc.\n- ⏱️ Execution Timing — Displays how long each program took to run\n- 🛠️ Error Handling — Gracefully reports compilation or runtime errors\n\n---\n\n## 🗂️ Project Structure\n\n```bash\n📦 labs-to-pdf/\n│\n├── Lab 1/\n│   ├── 1.cpp\n│   ├── 2.cpp\n│   └── ...\n│\n├── logo.png                # University logo for the title page\n├── make_pdfs.py            # Main automation script\n└── README.md\n```\n\n---\n\n## 🧰 Requirements\n\nYou’ll need:\n\n* Python 3.8+\n* A C++ compiler (e.g., `g++`)\n* ReportLab for PDF generation\n\nInstall dependencies with:\n\n```bash\npip install reportlab\n```\n\n---\n\n## 🧑‍💻 Usage\n\n1. Place your files inside folders like `Lab 1`, `Lab 2`, etc.\n2. Update configuration at the top of `make_pdfs.py`:\n\n```python\nEXTENSION = \"cpp\"\nLOGO_PATH = \"./logo.png\"\nPROCESS = [\"Lab 1\"] # Folder names, must match exactly\nKEEP_TOGETHER = True # Skip to next page if the question starts at the end of page\nKEEP_EXE = False # Remove or keep the .exe file generated automatically\n\n\"\"\" Enter the user inputs for each lab in the following order:  \n    INPUTS = [\n        [Q1 INPUTS, Q2 INPUTS, Q3 INPUTS, ...], # For Lab 1 (According to the first lab provided in the PROCESS list)\n        [Q1 INPUTS, Q2 INPUTS, Q3 INPUTS, ...], # For Lab 2 (According to the second lab provided in the PROCESS list)\n        ...\n    ]\n\n    For example, If Q2 does not take input, leave it as an empty string\n    [\"2 2\", \"\", \"1 4\"]\n\"\"\"\nINPUTS = [\n    \n]\n\n\"\"\" The QUESTIONS list follows the same format as the INPUT list provided above \"\"\"\nQUESTIONS = [\n    \n]\n\nEXECUTION_TIMEOUT = 5  # seconds\n\nUNIVERSITY = \"NED University of Engineering and Technology\"\nNAME = \"NAME\"\nROLL_NO = \"CT-24000\"\nDEPARTMENT = \"Department of Computer Science and Information Technology\"\nDEGREE = \"Bachelor of Science (BS)\"\n```\n\n3. Run the generator:\n\n```bash\npython make_pdfs.py\n```\n\n4. PDFs will be generated inside each lab folder individually.\n\n---\n\n## 🧠 Tips\n\n* A custom font can be used, simply replace `font.ttf` with another font of your choice.\n* Ensure your files compile cleanly and produce output.\n* Customize fonts, colors, and layout by editing the paragraph and table styles in the script.\n* Adjust the `EXECUTION_TIMEOUT` constant in the script if your programs take longer to run.\n\n---\n\n## 🪪 License\n\nThis project is released under the [MIT License](LICENSE).\n\nFeel free to modify and adapt it for your institution or personal use.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadrafayasif%2Flabs-to-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhammadrafayasif%2Flabs-to-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadrafayasif%2Flabs-to-pdf/lists"}