{"id":25905693,"url":"https://github.com/asmwarrior/calendar_generator","last_synced_at":"2026-06-10T05:31:34.090Z","repository":{"id":279969679,"uuid":"940591133","full_name":"asmwarrior/calendar_generator","owner":"asmwarrior","description":"python script to generate monthly calendar for a semester","archived":false,"fork":false,"pushed_at":"2025-02-28T13:24:11.000Z","size":269,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T19:41:13.521Z","etag":null,"topics":["calendar","generator","pdf","python","reportlab"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asmwarrior.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}},"created_at":"2025-02-28T12:55:57.000Z","updated_at":"2025-02-28T14:06:48.000Z","dependencies_parsed_at":"2025-02-28T19:51:23.621Z","dependency_job_id":null,"html_url":"https://github.com/asmwarrior/calendar_generator","commit_stats":null,"previous_names":["asmwarrior/calendar_generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/asmwarrior/calendar_generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmwarrior%2Fcalendar_generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmwarrior%2Fcalendar_generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmwarrior%2Fcalendar_generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmwarrior%2Fcalendar_generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asmwarrior","download_url":"https://codeload.github.com/asmwarrior/calendar_generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmwarrior%2Fcalendar_generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34139178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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":["calendar","generator","pdf","python","reportlab"],"created_at":"2025-03-03T05:16:49.482Z","updated_at":"2026-06-10T05:31:34.070Z","avatar_url":"https://github.com/asmwarrior.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calendar_generator\nThis Python script generates a monthly semester calendar in PDF format, displaying class schedules, lesson times, and with weekends highlighted.\nThe calendar is customizable and supports English and other language text, such as Chinese language.\n\n## Screenshot\n\nBelow is a screenshot of the generated PDF (`calendar_2025_03.pdf`):\n\n![Generated Calendar Screenshot](calendar_2025_03.png)\n\n---\n\n## Features\n\n- **Customizable Calendar**: Generate a calendar for any month and year.\n- **Class Schedule Integration**: Populate the calendar with class schedules from a JSON file.\n- **Highlight Weekends**: Saturdays and Sundays are highlighted for better visibility.\n- **Multi-Language Support**: Supports English and other language text.\n- **PDF Output**: Generates a clean and printable PDF file.\n\n---\n\n## Requirements\n\n- Python 3.x\n- `reportlab` library (for PDF generation)\n- A JSON file containing class schedule data (e.g., `class-of-semester-2024-2025-2.json`)\n\n---\n\n## Installation\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/asmearrior/calendar_generator.git\n   cd calendar_generator\n   ```\n\n2. **Install Dependencies**:\n   Install the required Python libraries using `pip`:\n   ```bash\n   pip install reportlab\n   ```\n\n3. **Prepare Class Schedule Data**:\n   - Create a JSON file (e.g., `class-of-semester-2024-2025-2.json`) with your class schedule data.\n   - The JSON file should follow the structure defined in the script.\nThe script expects a JSON file with the following structure:\n\n```json\n{\n    \"semester_start_day\": \"2025-02-24\",\n    \"lessons\": [\n        {\n            \"name\": \"Math\",\n            \"student\": \"Grade 1\",\n            \"week_day\": [\n                {\n                    \"week\": \"1-5,6-8,11-17\",\n                    \"day\": \"5\",\n                    \"lesson\": \"1,2\",\n                    \"room\": \"Room 1A\"\n                },\n                {\n                    \"week\": \"17\",\n                    \"day\": \"3\",\n                    \"lesson\": \"1,2\",\n                    \"room\": \"Room 1B\"\n                }\n            ]\n        }\n    ]\n}\n```\n### JSON Structure Description\n\n1. **`semester_start_day`**:\n   - The start date of the semester in `YYYY-MM-DD` format.\n   - Example: `\"2025-02-24\"` means the semester starts on February 24, 2025.\n\n2. **`lessons`**:\n   - A list of classes or lessons to be scheduled in the calendar.\n   - Each lesson has the following fields:\n     - **`name`**: The name of the class (e.g., `\"Math\"`).\n     - **`student`**: The group or grade attending the class (e.g., `\"Grade 1\"`).\n     - **`week_day`**: A list of scheduling details for the class, including:\n       - **`week`**: The weeks during which the class occurs. Can be a single week, a range of weeks, or a combination (e.g., `\"1-5,6-8,11-17\"`).\n       - **`day`**: The day of the week (1 = Monday, 2 = Tuesday, ..., 7 = Sunday).\n       - **`lesson`**: The lesson periods (e.g., `\"1,2\"` for periods 1 and 2).\n       - **`room`**: The room where the class is held (e.g., `\"Room 1A\"`).\n\n### Example Explanation\n\n- The semester starts on **February 24, 2025**.\n- There is one class named **Math** for **Grade 1**.\n- The class occurs:\n  - On **Fridays (day 5)** during weeks **1-5, 6-8, and 11-17**, in **Room 1A**, during periods **1 and 2**.\n  - On **Wednesdays (day 3)** during week **17**, in **Room 1B**, during periods **1 and 2**.\n\n---\n\n\n\n## Usage\n\nRun the script with the following command:\n\n```bash\npython calendar_generator.py [month] [year]\n```\n\n- **Arguments**:\n  - `month` (optional): The month for which to generate the calendar (default: current month).\n  - `year` (optional): The year for which to generate the calendar (default: current year).\n\n### Example\n\nTo generate a calendar for March 2025:\n```bash\npython calendar_generator.py 3 2025\n```\n\nThis will generate a PDF file named `calendar_2025_03.pdf`.\n\n---\n\n## Customization\n\n- **Fonts**: You can change the font by modifying the `pdfmetrics.registerFont` section in the script.\n- **Column Widths**: Adjust the `col_widths` variable to change the width of table columns.\n- **Row Heights**: Modify the `row_heights` variable to adjust the height of table rows.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.\n\n---\n\n## Author\n\nasmwarrior\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmwarrior%2Fcalendar_generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasmwarrior%2Fcalendar_generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmwarrior%2Fcalendar_generator/lists"}