datalad_next.types.ArchivistLocator
- class datalad_next.types.ArchivistLocator(akey: AnnexKey, member: PurePosixPath, size: int | None = None, atype: ArchiveType | None = None)[source]
Bases:
objectRepresentation of a
dl+archive:archive member locatorThese locators are used by the
datalad-archivesandarchivistgit-annex special remotes. They identify a member of a archive that is itself identified by an annex key.Each member is annotated with its size (in bytes). Optionally, the file format type of the archive can be annotated too.
Syntax of
dl+archives:locatorsThe locators the following minimal form:
dl+archive:<archive-key>#path=<path-in-archive>
where
<archive-key>is a regular git-annex key of an archive file, and<path-in-archive>is a POSIX-style relative path pointing to a member within the archive.Two optional, additional attributes
sizeandatypeare recognized (onlysizeis also understood by thedatalad-archivesspecial remote).sizedeclares the size of the (extracted) archive member in bytes:dl+archive:<archive-key>#path=<path-in-archive>&size=<size-in-bytes>
atypedeclares the type of the containing archive using a label. Currently recognized labels aretar(a TAR archive, compressed or not), andzip(a ZIP archive). SeeArchiveTypefor all recognized labels.If no type information is given,
ArchivistLocator.from_str()will try to determine the archive type from the archive key (via*E-type git-annex backends, such as DataLad's defaultMD5E).The order in the fragment part of the URL (after
#) is significant.pathmust come first, followed bysizeoratype. If bothsizeandatypeare present,sizemust be declared first. A complete example of a URL is:dl+archive:MD5-s389--e9f624eb778e6f945771c543b6e9c7b2#path=dir/file.csv&size=234&atype=tar
- atype: ArchiveType | None = None
- member: PurePosixPath
- size: int | None = None