Duplicate ZIP Member Names: Audit a Drone Delivery Before Extraction
Inventory every ZIP member record and retain duplicate filenames before choosing which raster, inventory or report revision belongs in a drone handoff.

Identify the package before choosing its contents
A ZIP delivery can list the same member name more than once. If a review reduces the archive to a dictionary keyed only by filename, one record can disappear from the inventory before anyone decides which content belongs to the accepted release. Begin a NiVO data handoff by preserving the received archive and inspecting its member records. This tutorial uses Python zipfile to identify exact duplicate member names without extracting their payloads. It does not inspect an actual customer delivery or assert that a specific NiVO project contained a packaging defect. The constructed scenario concerns release identity rather than a measured survey result.
Record the archive revision, producing application and intended delivery manifest. Ask whether it is a single approved release or an accumulated package assembled from several revisions. Keep the original archive unchanged while the producer resolves any ambiguity. A familiar filename inside the ZIP is useful context, but it does not establish which payload the recipient intended to open. Preserve the archive identity alongside the member name and member-record position in the inspection output. That combination makes the initial finding reproducible without relying on the behavior of whichever desktop archive application happened to be used first.
Inventory member records rather than unique names
Python documents infolist as returning a ZipInfo object for each archive member in recorded order. The same documentation explicitly discusses archives containing duplicate names and explains that read or open can accept a ZipInfo object when a specific member must be selected. This supports a record-based inventory rather than assuming that each name is unique. The recipe below groups exact decoded filename strings while retaining each matching record separately. It does not normalize case, merge directory spellings or decide whether differently named members would collide in a particular receiving filesystem. Those are separate questions for an actual delivery environment.
Treat the inventory fields as observed metadata, not an authority ranking. A recorded uncompressed size or CRC can help distinguish entries during investigation, but the inspection does not read payload bytes or prove their content is correct. Likewise, a later archive record is not automatically the approved revision. The original timestamp can provide context without establishing acceptance. Ask the responsible producer which member belongs to the intended release and what source evidence supports that decision. Retain unresolved entries in the record instead of selecting one solely because a file browser displays it prominently or because its name matches an expected product.

Product context only; this photograph does not depict the constructed examples in this article.
Run a read-only duplicate-name inventory
The Python function below opens an identified local ZIP in read mode and enumerates non-directory members. It returns only names that occur more than once, with the zero-based position of each record, its recorded size and CRC. Directory records are excluded from this particular report, and original positions are retained rather than renumbered after exclusion. The illustrative command-line filename is supplied by the reviewer. No extraction, payload comparison or repair occurs. A result with no exact duplicate names answers that narrow question only; it does not certify that the archive contains every required file or that the contents meet a project specification.
Preserve the actual output, tool version, archive identity and any read error when applying the method to a real package. The constructed recipe tests exercise record retention and exact-name grouping in memory. They do not represent real rasters or delivery manifests. A reader failure should remain a failure in the review rather than being converted to an empty duplicate list. Similarly, do not label every duplicate as corruption: the archive library can represent such entries. The practical finding is an identity ambiguity that needs a documented release decision before a selected payload can be treated as the accepted analytical input.
import json, sys, zipfile
def duplicate_members(filename):
groups = {}
with zipfile.ZipFile(filename, "r") as archive:
for number, info in enumerate(archive.infolist()):
if info.is_dir():
continue
groups.setdefault(info.filename, []).append({
"memberNumber": number,
"recordedBytes": info.file_size,
"recordedCRC": f"{info.CRC:08x}",
})
return {name: records for name, records in groups.items() if len(records) > 1}
if __name__ == "__main__":
print(json.dumps(duplicate_members(sys.argv[1]), indent=2))Trace a constructed same-name revision ambiguity
Imagine a fictional archive containing two member records named maps/surface.tif. One record came from an earlier assembly step and another from a later addition. The inventory would retain both record positions even if a name-only view appeared to show one path. The example does not establish which payload is authoritative or imply that the later one is better. A real release decision needs the accepted source manifest, producing record or other responsible-owner evidence. Keep both original member records distinguishable while that decision is made, and avoid presenting an automatic extraction result as proof of which file the sender intended to supply.
If a supported follow-up reads a particular member, identify the corresponding ZipInfo record from the same archive inventory rather than resolving it only by its repeated name. Python documents this object-based selection for duplicate-name cases. Record the chosen member identity and the operation actually performed. The small published recipe stops before that stage and reports recorded metadata only. It does not compare payloads or select a winner. If identical-looking sizes or CRC values occur, do not treat that similarity as proof of approved revision identity. Establish the accepted content through the project release process and any appropriate content checks.
Resolve the package as a separate reviewed release
Ask the producer to provide an unambiguous candidate package or an explicit, reproducible selection record supported by the delivery requirements. Preserve the original archive and identify the candidate separately. Check that the intended raster, inventory, companions and reports remain represented after the ambiguity is resolved. A filename cleanup should not silently remove a needed dependency or mix members from different revisions. If the package includes several related analytical files, verify their actual release relationship rather than assuming that matching base names prove they were generated together. Document the decision so the receiving analyst can understand the candidate without reconstructing the assembly history.
Then repeat the relevant receiving checks on the candidate actually intended for use. Confirm that the recipient can identify the agreed contents and that analytical requirements are assessed through the appropriate source tools and project evidence. A tidy archive inventory is useful but does not validate coordinate systems, raster values, point attributes or survey accuracy. Keep those acceptance findings distinct from the duplicate-name finding. If the producer cannot resolve the ambiguity, retain the limitation in the handoff instead of choosing a convenient member and describing the entire delivery as verified. The review should make the remaining decision visible and accountable.
Deliver a record that preserves member identity
A clear handoff names the archive revision, exact repeated paths, member-record positions, observed metadata and the evidence supporting any selection or replacement package. Include the actual inspection output and unresolved reader limitations. Another analyst should be able to reproduce the inventory on the unchanged archive and understand which decision remains with the producer. Do not substitute a screenshot showing one repeated filename for that record. The constructed example and memory-only recipe checks are teaching evidence, not an audit of a real delivery, and should remain separate from any later project-specific acceptance documentation.
For NiVO mapping and inspection workflows, this prevents an ambiguous archive name from becoming an undocumented analytical source choice. It complements companion-file and release-identity reviews while addressing the structure of the package itself. The photograph provides product context and does not depict the constructed archive or a customer incident. Keep the received archive and the accepted member decision together through delivery. The recipient gains a practical explanation of which content was intended, what was actually inspected and which further project checks are still required before the selected files can support their proposed analytical use.



