{"id":20072717,"url":"https://github.com/nh2/hackage-download","last_synced_at":"2025-05-05T21:30:28.115Z","repository":{"id":66390975,"uuid":"196673793","full_name":"nh2/hackage-download","owner":"nh2","description":"Script to download all of Hackage","archived":false,"fork":false,"pushed_at":"2019-07-14T01:22:07.000Z","size":3,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T04:22:43.872Z","etag":null,"topics":["hackage","haskell"],"latest_commit_sha":null,"homepage":"","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/nh2.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}},"created_at":"2019-07-13T03:30:49.000Z","updated_at":"2025-03-14T23:57:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"eee8e1b8-a5e9-4962-9373-47671f52a1e2","html_url":"https://github.com/nh2/hackage-download","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"6ec9749146b234367d2ad6f98a186973d3d304d2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nh2%2Fhackage-download","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nh2%2Fhackage-download/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nh2%2Fhackage-download/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nh2%2Fhackage-download/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nh2","download_url":"https://codeload.github.com/nh2/hackage-download/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252579978,"owners_count":21771247,"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":["hackage","haskell"],"created_at":"2024-11-13T14:41:53.825Z","updated_at":"2025-05-05T21:30:27.843Z","avatar_url":"https://github.com/nh2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hackage-download - Download all of [Hackage](https://hackage.haskell.org)\n\nScript to download all of Hackage. Either `--latest` versions or `--all` historical versions.\n\n\n## Usage\n\n```\n./hackage-download.py --latest\n```\n\n```\n./hackage-download.py --all\n```\n\nBoth drop each package into the current directory.\n\n\n## Performance\n\n`./hackage-download.py --latest` finishes in 77 seconds on my desktop with Gigabit Internet.\n\n* 13 seconds are `cabal list --simple`\n* 10 seconds is the downloading of 13981 latest `.tar.gz` packages (900 MB)\n* 54 seconds is the un-gzipping on my spinning disk (4.4 GB)\n\n\n## Interesting facts\n\n### `cabal get` is insanely slow\n\n**80x slower** than my parallel `wget`:\n\n```\ncabal list --simple | cut -d' ' -f1 | sort -u | parallel -j100 --load 10 cabal get {}\n12535.05s user 566.04s system 276% cpu 1:19:03.51 total\n```\n\nThis is with `cabal 2.2.0.0`.\n\n\n### Minimalist one-liner\n\nDownloading latest packages, with GNU `parallel` to render a progress bar:\n\n```\ncabal list --simple | python3 -c 'from fileinput import *; [print(\"https://hackage.haskell.org/package/\"+p+\"/\"+p+\"-\"+ver+\".tar.gz\") for (p,ver) in sorted(dict(map(str.split, input())).items())]' | time parallel --bar -P 100 -n 32 wget --quiet {}\n```\n\n\n### Some packages mess with you\n\n* Some packages from `cabal list --simple` fail to download from Hackage, e.g. with `410 Gone` or other errors.\n* Some `.tar.gz` packages set funny permissions on the unpacked files which makes removing them a bit of a nuisance.\n* Some `.tar.gz` packages have \"trailing garbage\", resulting in decrompression warnings.\n* As a result, the script must do lenient error handling, and will not report correctly on e.g. disk write errors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnh2%2Fhackage-download","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnh2%2Fhackage-download","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnh2%2Fhackage-download/lists"}