Skip to content

Allow large data files to be stored gzip-compressed - #35

Open
fsargent wants to merge 1 commit into
PrefLib:mainfrom
fsargent:preflib-gzip-support
Open

fsargent wants to merge 1 commit into
PrefLib:mainfrom
fsargent:preflib-gzip-support

Conversation

@fsargent

@fsargent fsargent commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

GitHub rejects files over 100 MB, and PrefLib's largest file today is 79 MB. The 2025 Australian Senate profiles for NSW, Victoria and Queensland are 116, 106 and 96 MB as plain SOI, but only 6–7 MB gzipped. This PR lets a data file over 50 MB be stored as <name>.gz while everything else keeps using its plain name and contents:

  • info.txt lists 00080-00000001.soi;
  • metadata.csv gives the MD5 of the plain file, so change detection is unaffected;
  • scripts/zipall.py writes the plain .soi into the release zip, keeping the timestamp, so downloads and the website see no difference.

A new scripts/datafiles.py resolves either form and parses compressed files under their plain name (preflibtools reads the type from the extension). sanitychecks.py, compute_metadata.py and zipall.py use it. Files without a .gz take the same code paths as before, apart from a 1 MB read buffer for the MD5. The README gets a short "Large data files" section.

Tested on a scratch dataset with one plain and one compressed SOI file:

  • sanitychecks.py --escalate-warnings passes;
  • compute_metadata.py gives the compressed file the plain file's MD5 and the same properties;
  • zipall.py writes the plain file under its plain name, byte-identical to the original.

The Senate dataset PR depends on this one.

GitHub rejects files over 100 MB. A data file may now be stored as
<name>.gz; info.txt, metadata.csv and the release zips keep using the
plain name and contents. scripts/datafiles.py resolves and reads either
form for sanitychecks.py, compute_metadata.py and zipall.py.
@fsargent
fsargent force-pushed the preflib-gzip-support branch from 43b4067 to 248d17c Compare November 22, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant