{"id":19876973,"url":"https://github.com/lol768/warwick-libraryhog","last_synced_at":"2026-06-08T01:01:32.137Z","repository":{"id":149448567,"uuid":"74704994","full_name":"lol768/Warwick-LibraryHog","owner":"lol768","description":"Hogs library items by renewing them.","archived":false,"fork":false,"pushed_at":"2017-05-30T13:12:27.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T08:43:11.357Z","etag":null,"topics":["library","renewal","university"],"latest_commit_sha":null,"homepage":null,"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/lol768.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":"2016-11-24T21:04:23.000Z","updated_at":"2017-05-30T13:13:22.000Z","dependencies_parsed_at":"2023-06-19T17:50:51.632Z","dependency_job_id":null,"html_url":"https://github.com/lol768/Warwick-LibraryHog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lol768/Warwick-LibraryHog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lol768%2FWarwick-LibraryHog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lol768%2FWarwick-LibraryHog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lol768%2FWarwick-LibraryHog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lol768%2FWarwick-LibraryHog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lol768","download_url":"https://codeload.github.com/lol768/Warwick-LibraryHog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lol768%2FWarwick-LibraryHog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34043822,"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-07T02:00:07.652Z","response_time":124,"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":["library","renewal","university"],"created_at":"2024-11-12T16:34:54.341Z","updated_at":"2026-06-08T01:01:32.117Z","avatar_url":"https://github.com/lol768.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"LibraryHog\n==========\n\nA simple script which automatically renews all items checked out from the University of Warwick's library.\n\n![Screenshot](https://lol768.com/i/movajfs6TEJg9Q)\n\nA note on renewals\n------------------\n\nRenewals are possible if:\n\n* The item is not on hold\n* At least a day has passed since the last renewal\n\nWhen renewals happen, the due date is extended to the current date + the standard loan length (2 weeks).\n\nThus, to maximise the time you can have a single book without returning it, it is best to make a renewal attempt\nevery day:\n\n* If another library user places a hold, you will have renewed as close as possible to the hold, and will get the\nlargest amount of the standard loan length\n* Renewing every day like this will continuously move the due date one day in the future, so at all points in time\nthere will be two weeks to read the book\n\nA note on holds\n---------------\n\nWhen a library user requests a hold on a book, the hold is **sent to everyone** who has the title in question out on loan. This stops everyone from renewing the title until one of the copies is returned. As a result, the \"loser\" is whoever has the closest due date because they have no choice but to return the book by this date or face a fine. Once a hold is fulfilled it becomes possible to renew the book again.\n\nThis means that if you use this script and there are multiple copies of a book, you should *never* need to return the book (assuming less holds than book copies are requested). You'll still receive emails about holds as normal, but you can just ignore them.\n\nNB: if all of the other users who are also sent the hold notificaton are using a script like this, everyone will have the same due date. This seems like an unlikely scenario, but if you're not careful you'll end up with a fine - if the renews continuously fail up until the due date you'll need to return the book. The best approach to take when this happens is to immediately request a hold as soon as the title is returned.\n\nUsing the script\n----------------\n\nAuthentication is via LDAP (not WebSignOn), so the script needs to know your Warwick usercode and password. It is\nsuggested that you carefully read through the script prior to using it in the interests of security. It's very simple\nand well-documented.\n\nYou can either provide the credentials at runtime (the script will prompt you) or set two environment variables:\n\n```\nexport WARWICK_USERNAME=\"uxxxxxxx\"\nexport WARWICK_PASSWORD=\"password123\"\npython3 main.py\n```\n\nThe latter approach is suggested for automation. If you're planning on using the script with a cronjob, it's suggested\nto only run it once a day at 0030 or similar:\n\n```\n30 0 * * * /path/to/lib_hog.sh\n```\n\nIf you are going to store your password for this use, you must ensure it is done in a secure manner to comply with\nthe ITS AUP.\n\nTODO\n----\n\n* Watch recently returned items (due to a hold) and request a hold as soon as they are checked out.\n\nMotivation and ethical considerations\n-------------------------------------\n\nMotivations:\n\n* Different library users are arbitrarily given different loan lengths. University staff take out books for the entire\n  academic year by default which forces use of holds to try and take out items which would otherwise be available.\n* Holds placed very close to the due date on an item you were planning to renew are inconvenient. The fine amount\n  is also impacted.\n\nEthical considerations:\n\n* The script should not be used to take out an item for longer than is required to read/refer to/make notes on it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flol768%2Fwarwick-libraryhog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flol768%2Fwarwick-libraryhog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flol768%2Fwarwick-libraryhog/lists"}