Published October 22, 2026
| Version v0.4.0
Software
Open
queelius/arkiv: arkiv 0.4.0
Description
A bundle I/O layer for tools that write and read arkiv archives, so the
*-memex archives can stop carrying their own copies of the zip/tar
plumbing (six near-identical copies, with divergent bugs).
Added
write_bundle(path, members): write named in-memory members as a directory,.zip, or.tar.gz(by extension), creating parent directories. Byte-reproducible: sorted members, fixed timestamps and modes, no owner identity, and no output file name in the gzip header. Member names that are absolute or climb out of the archive are rejected.records_to_jsonl(records): UTF-8 JSONL bytes (ensure_ascii=False, non-JSON values viastr).open_member(path, member),iter_jsonl(path, member),peek_jsonl(path, member): stream one member out of a directory, zip, tar.gz, or bare.jsonl/.jsonl.gzwithout extracting. A missing member raisesFileNotFoundErroruniformly (tar link members are refused the same way); blank, malformed, and non-object lines are skipped;peek_jsonlreturnsNonefor absent or unreadable input.- Streaming reads treat bundles as untrusted:
open_member/iter_jsonlcap the decompressed bytes read (max_bytes, default 8 GiB, refusing zip/tar members whose declared size is over it upfront and bounding gzip streams as they decompress) and the length of one JSONL line (max_line_chars, default 64 Mi characters), raisingValueErrorinstead of buffering.peek_jsonlreads within a 64 MiB budget. A directory-bundle member that is a symlink, or resolves outside the archive, is refused, andwrite_bundlewill not write through one. Finding a tar.gz member streams the archive (stopping at the first match, with an entry cap and every header and skipped byte charged tomax_bytes) instead ofgetmember(), which parses all headers first. bundle_format(path): classify a path asdir,zip,tar.gz,jsonl, orjsonl.gz.- All of the above, plus
pack_bundle,unpack_bundle, andis_bundle, are exported from the package root.
Fixed
pack_bundleand the source fingerprint dropped every.db/.sqlite/.sqlite3file at any depth, so a database file that is content (an EHR export'smedia/viewer.db) silently vanished from bundles. Only the derived database at the archive root is skipped now; both paths share one rule,arkiv.bundle.is_source_path.
Changed
- The package ships a
py.typedmarker, so type checkers use its annotations instead of treating it as untyped. - The sdist is built from an explicit allowlist; earlier sdists included
untracked local tool configuration (
.claude/settings.local.json). pack_bundleoutput is now byte-reproducible as well (it previously stamped on-disk mtimes, the packer's uid/gid, and the wall clock into the gzip header).
Files
queelius/arkiv-v0.4.0.zip
Additional details
Related works
- Is supplement to
- Software: https://github.com/queelius/arkiv/tree/v0.4.0 (URL)
Software
- Repository URL
- https://github.com/queelius/arkiv