How to stream and sync the archive¶
The archive resource downloads bulk collections of the Vulners database — useful for
seeding a local mirror or a data pipeline. Collections can be gigabytes, so these calls
use a longer timeout profile automatically.
Download a whole collection¶
fetch_collection buffers and decodes the entire archive in memory. Good for small-to-
medium collections:
Stream a large collection record by record¶
For big collections, iter_collection (async: aiter_collection) follows the archive
redirect to storage and yields each record lazily, so the whole archive never has to be
held in memory:
Fast decoding is built in
Archive decode is ISA-L accelerated (isal) and multi-member zip streaming
(stream-unzip) works out of the box — both ship with the core package, no extra needed.
Sync only what changed¶
To keep a mirror up to date, fetch just the entries changed since your last sync with
fetch_collection_update and a timezone-aware datetime:
Guard against untrusted decompression¶
Archives are compressed. To bound how many bytes the client will decompress (a defense
against decompression bombs), set max_response_bytes on the client: