{"id":17563981,"url":"https://github.com/chimekkoo/pylibrus","last_synced_at":"2025-07-16T21:13:11.728Z","repository":{"id":65365295,"uuid":"590088552","full_name":"chimekkoo/pylibrus","owner":"chimekkoo","description":"Librus (polish school e-register) unofficial API client written in Python.","archived":false,"fork":false,"pushed_at":"2023-01-22T19:33:56.000Z","size":11,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T12:14:49.525Z","etag":null,"topics":["librus","librus-api","pip","python3"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pylibrus/","language":"Python","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/chimekkoo.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}},"created_at":"2023-01-17T16:25:29.000Z","updated_at":"2024-06-28T23:20:13.000Z","dependencies_parsed_at":"2023-02-12T18:00:42.483Z","dependency_job_id":null,"html_url":"https://github.com/chimekkoo/pylibrus","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chimekkoo%2Fpylibrus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chimekkoo%2Fpylibrus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chimekkoo%2Fpylibrus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chimekkoo%2Fpylibrus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chimekkoo","download_url":"https://codeload.github.com/chimekkoo/pylibrus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246180923,"owners_count":20736460,"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":["librus","librus-api","pip","python3"],"created_at":"2024-10-21T13:10:46.235Z","updated_at":"2025-03-29T12:14:52.863Z","avatar_url":"https://github.com/chimekkoo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyLibrus\n\n[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)\n![License MIT](https://img.shields.io/github/license/ChimekKoo/pylibrus)\n\nLibrus (polish school e-register) unofficial API client written in Python.\n\n# Installation\n```\npip3 install pylibrus\n```\n\n# Usage\n(Replace every field containing 'your' with your data)\n## Authorization\n- Authorize using existing token (load existing tokens pair)  \nor\n- Generate new OAuth token  \n    - using user credentials:\n        ```python\n        import pylibrus\n        access_token, refresh_token = pylibrus.auth.user_credentials(\n            username=\"yourusername\",\n            password=\"yourpassword\",\n            long_lived=True # optional, if set to True (default) token will be valid for 24h, if set to False token will be valid for 3h\n        )\n        print(\n            access_token, # used to access resources\n            refresh_token # used to regenerate access token without user credentials\n        )\n        ```\n    - using previousely generated refresh token:\n        ```python\n        import pylibrus\n        access_token, refresh_token = pylibrus.auth.refresh_token(\n            refresh_token=\"yourrefreshtoken\",\n            long_lived=True # default True (if not specified)\n        )\n        print(access_token, refresh_token)\n        ```\n## Accessing resources\nAccess resources using previousely generated access token (see [Authorization](#authorization)):\n```python\nimport pylibrus\nlib = pylibrus.Librus(\"youraccesstoken\") # previousely generated/cached access token\njson_res = lib.getResource(\"YourResourceName\")\nprint(json_res) # Raw API response (decoded JSON as dict)\n```\nList of available resources [here](resources.txt).\n## Examples\nGet user name using login/password authorization:\n```python\nimport pylibrus\nlib = pylibrus.Librus(pylibrus.auth.user_credentials(\n    username=\"yourusername\",\n    password=\"yourpassword\",\n)[0])\nnames = lib.getResource(\"Me\")[\"Me\"][\"User\"]\nprint(f\"Hello {names['FirstName']} {names['LastName']}\")\n```\nGet number of user's grades using new access token generated using previousely cached refresh token:\n```python\nimport pylibrus\nlib = pylibrus.Librus(pylibrus.auth.refresh_token(\n    refresh_token=\"yourrefreshtoken\"\n)[0])\ngrades = lib.getResource(\"Grades\")[\"Grades\"]\nprint(len(grades))\n```\n# Contribute\nAny pull requests are welcome.\nYou can set up a development environment like this:\n```\ngit clone https://github.com/YOU/YOUR_FORK.git .\npython3 -m venv venv\nsource venv/bin/activate\npip3 install -r requirements.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchimekkoo%2Fpylibrus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchimekkoo%2Fpylibrus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchimekkoo%2Fpylibrus/lists"}