{"id":27194809,"url":"https://github.com/classchartsapi/classcharts-api-js","last_synced_at":"2025-04-09T19:36:35.355Z","repository":{"id":39743460,"uuid":"422264799","full_name":"classchartsapi/classcharts-api-js","owner":"classchartsapi","description":"A Node.js and Deno library for requesting information from the ClassCharts API","archived":false,"fork":false,"pushed_at":"2024-11-07T17:22:09.000Z","size":890,"stargazers_count":9,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-23T16:36:51.228Z","etag":null,"topics":["classcharts","deno","hacktoberfest","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://classchartsapi.github.io/classcharts-api-js/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/classchartsapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2021-10-28T15:50:34.000Z","updated_at":"2024-11-07T17:22:12.000Z","dependencies_parsed_at":"2024-05-28T15:36:55.570Z","dependency_job_id":"1c97d55e-15ba-4430-94c3-5710e56adbbf","html_url":"https://github.com/classchartsapi/classcharts-api-js","commit_stats":{"total_commits":123,"total_committers":5,"mean_commits":24.6,"dds":0.09756097560975607,"last_synced_commit":"e91fb1688db5e7ac4210124d5ddfc40537f614c0"},"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classchartsapi%2Fclasscharts-api-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classchartsapi%2Fclasscharts-api-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classchartsapi%2Fclasscharts-api-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/classchartsapi%2Fclasscharts-api-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/classchartsapi","download_url":"https://codeload.github.com/classchartsapi/classcharts-api-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248098525,"owners_count":21047456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["classcharts","deno","hacktoberfest","nodejs","typescript"],"created_at":"2025-04-09T19:36:34.884Z","updated_at":"2025-04-09T19:36:35.343Z","avatar_url":"https://github.com/classchartsapi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003ch1 align=\"center\"\u003eClassCharts API JS\u003c/h1\u003e\n\t\u003cp align=\"center\"\u003e\n\tA Node.js and Deno wrapper for getting information from the Classcharts API.\n\t\u003c/p\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/classchartsapi/classcharts-api-js\"\u003eSource\u003c/a\u003e\n\t\u003cspan\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\t\u003ca href=\"https://github.com/classchartsapi/classcharts-api-js/issues\"\u003eIssues\u003c/a\u003e\n\t\u003cspan\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\t\u003ca href=\"https://www.npmjs.com/package/classcharts-api\"\u003eNPM\u003c/a\u003e\n  \u003cspan\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\t\u003ca href=\"https://deno.land/x/classcharts_api\"\u003eDeno\u003c/a\u003e\n\t\u003cspan\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\t\u003ca href=\"https://discord.gg/DTcwugcgZ2\"\u003eDiscord\u003c/a\u003e\n  \u003cspan\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\t\u003ca href=\"https://classchartsapi.github.io/classcharts-api-js\"\u003eLibrary Docs\u003c/a\u003e\n\t\u003cspan\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\t\u003ca href=\"https://classchartsapi.github.io/api-docs/\"\u003eAPI Docs\u003c/a\u003e\n\u003c/p\u003e\n\n# Introduction\n\nThe ClassCharts API is a typescript wrapper around the ClassCharts API. It\nallows you to easily make requests to the ClassCharts API without having to\nworry about the underlying implementation of making requests.\n\n## Help\n\nFor any help with the library, please join the\n[discord](https://discord.gg/DTcwugcgZ2) where you can ask questions and get\nhelp from the community.\n\n# Contributing\n\nContributions are welcome! There are lots of API endpoints which we simply do\nnot have access to to implement, so if you have access to them, please consider\ncontributing! If you have any questions, feel free to ask in the\n[discord](https://discord.gg/DTcwugcgZ2).\n\n# Installation\n\n## Requirements\n\n- Node.js 20 or newer\\\n  OR\n- Deno\n\n## NPM\n\n```bash\nnpm install classcharts-api\n```\n\n## Deno\n\nThe imports in the examples are for Node.js, but can easily be substituted for\nDeno.\n\n```typescript\nimport {\n  ParentClient,\n  StudentClient,\n} from \"https://deno.land/x/classcharts_api/mod.ts\";\n```\n\n# Logging In\n\nBefore making any requests, you must login to the client. This will get you a\nsession ID which will be used for all requests.\n\n## Student Client\n\n```typescript\nimport { StudentClient } from \"classcharts-api\";\n\n// Date of birth MUST in the format DD/MM/YYYY\nconst client = new StudentClient(\"classchartsCode\", \"01/01/2000\");\nawait client.login();\n```\n\n## Parent Client\n\n?\u003e The parent client is not tested, as I do not have access to a parent account.\nIf you experience any issues, please open an issue or PR.\n\n```typescript\nimport { ParentClient } from \"classcharts-api\";\n\nconst client = new ParentClient(\"username\", \"password\");\nawait client.login();\n```\n\n# Universal Methods\n\nAll the following methods can be used on both the student and parent client.\nEach example expects the client to be already logged in.\n\n## `.getStudentInfo`\n\n```typescript\nconst studentInfo = await client.getStudentInfo();\nconsole.log(studentInfo);\n/**\n{\n  success: 1,\n  data: {\n    user: {\n      id: 2339528,\n      ...\n    }\n  },\n  meta: {\n    session_id: '5vf2v7n5uk9jftrxaarrik39vk6yjm48',\n    ...\n  }\n}\n*/\n```\n\n## `.getActivity`\n\n```typescript\n// Dates must be in format YYYY-MM-DD\nconst activity = await client.getActivity({\n  from: \"2023-04-01\",\n  to: \"2023-05-10\",\n  last_id: \"12\",\n});\nconsole.log(activity);\n```\n\n## `.getFullActivity`\n\n```typescript\n// Dates must be in format YYYY-MM-DD\nconst activity = await client.getFullActivity({\n  from: \"2023-04-01\",\n  to: \"2023-05-10\",\n});\nconsole.log(activity);\n```\n\n## `.getBehaviour`\n\nGets behaviour for a given date range.\n\n```typescript\n// Dates must be in format YYYY-MM-DD\nconst behaviour = await client.getBehaviour({\n  from: \"2023-04-01\",\n  to: \"2023-05-10\",\n});\nconsole.log(behaviour);\n\n/**\n{\n  \"success\": 1,\n  \"data\": {\n    \"timeline\": [\n      {\n        \"positive\": 426,\n        ...\n      },\n    ],\n\t...\n  \"meta\": {\n    \"start_date\": \"2023-04-01T00:00:00+00:00\",\n    ...\n  }\n}\n*/\n```\n\n## `.getHomeworks`\n\nGets homeworks for a given date range.\n\n```typescript\n// Dates must be in format YYYY-MM-DD\nconst homeworks = await client.getHomeworks({\n  from: \"2023-04-01\",\n  to: \"2023-05-10\",\n\tdisplayDate: 'issue_date' // Can be 'due_date' or 'issue_date'\n});\nconsole.log(homeworks);\n\n/**\n{\n  success: 1,\n  data: [\n    {\n      lesson: '7A/Pe1',\n\t\t\t...\n\t\t},\n  ],\n  meta: {\n    start_date: '2023-04-01T00:00:00+00:00',\n\t\t...\n  }\n}\n```\n\n## `.getLessons`\n\nGets lessons for a specific date.\n\n```typescript\n// Dates must be in format YYYY-MM-DD\nconst lessons = await client.getLessons({\n  date: \"2023-04-01\",\n});\nconsole.log(lessons);\n\n/**\n{\n  \"success\": 1,\n  \"data\": [\n    {\n      \"teacher_name\": \"Mr J Doe\",\n      ...\n\t\t}\n\t\t...\n  ],\n  \"meta\": {\n    \"dates\": [\n      \"2023-05-04\"\n    ],\n    ...\n  }\n}\n*/\n```\n\n## `.getBadges`\n\nGets all earned badges.\n\n```typescript\nconst badges = await client.getBadges();\nconsole.log(badges);\n\n/**\n{\n  success: 1,\n  data: [\n    {\n      id: 123,\n\t\t\tname: 'Big Badge',\n\t\t\t...\n    },\n\t\t...\n  ],\n  meta: []\n}\n*/\n```\n\n## `.getAnnouncements`\n\nGets all announcements.\n\n```typescript\nconst announcements = await client.getAnnouncements();\nconsole.log(announcements);\n\n/**\n {\n  success: 1,\n  data: [\n    {\n      id: 321453,\n      title: \"A big announcement\",\n      description: \"\u003cp\u003eSchool will be closing early today!\u003c/p\u003e\",\n      ...\n    }\n  ],\n  meta: []\n}\n*/\n```\n\n## `.getDetentions`\n\n?\u003e This method does not include `meta` in the response, since I do not have\naccess to this endpoint to test it. If you have access to this endpoint, please\nopen a PR to add the `meta` response. Thanks!\n\nGets all detentions.\n\n```typescript\nconst detentions = await client.getDetentions();\nconsole.log(detentions);\n\n/**\n {\n    \"success\": 1,\n    \"data\": [\n        {\n            \"id\": 12345678,\n            \"attended\": \"no\",\n            \"date\": \"2024-03-28T00:00:00+00:00\",\n            ...\n        }\n    ],\n    \"meta\": {\n        \"detention_alias_plural\": \"detentions\"\n    }\n}\n*/\n```\n\n## `.getAttendance`\n\n?\u003e This method does not include `meta` in the response, since I do not have\naccess to this endpoint to test it. If you have access to this endpoint, please\nopen a PR to add the `meta` response. Thanks!\n\nGets attendance.\n\n```typescript\nconst attendance = await client.getAttendance();\nconsole.log(attendance);\n```\n\n# Parent Specific Methods\n\n## `.getPupils`\n\nGets a list of all pupils the parent has access to.\n\n```typescript\nconst pupils = await client.getPupils();\nconsole.log(pupils);\n/**\n[\n\t{\n\t\tid: 123,\n\t\tname: 'John Doe',\n\t\t...\n\t},\n\t...\n]\n*/\n```\n\n## `.selectPupil`\n\nSelects a pupil to make subsequent requests for.\n\n```typescript\nawait client.selectPupil(123);\n```\n\n## `.changePassword`\n\nChanges the parent's password.\n\n```typescript\nawait client.changePassword(\"oldPassword\", \"newPassword\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclasschartsapi%2Fclasscharts-api-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclasschartsapi%2Fclasscharts-api-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclasschartsapi%2Fclasscharts-api-js/lists"}