# `gbp.pkg.archive.Archive(object)` class documentation

Part of `gbp.pkg.archive` (View In Hierarchy)
No class docstring

Static Method | parse_filename | Given an filename return the basename (filename without the archive and compression extensions), archive format and compression method used.

@staticmethod
def parse_filename(filename):

Given an filename return the basename (filename without the archive and compression extensions), archive format and compression method used.

Parameters | filename | the name of the file (type: string)

Returns

tuple containing basename, archive format and compression method (type: `tuple` of `str`

    >>> Archive.parse_filename("abc.tar.gz")
    ('abc', 'tar', 'gzip')
    >>> Archive.parse_filename("abc.tar.bz2")
    ('abc', 'tar', 'bzip2')
    >>> Archive.parse_filename("abc.def.tbz2")
    ('abc.def', 'tar', 'bzip2')
    >>> Archive.parse_filename("abc.def.tar.xz")
    ('abc.def', 'tar', 'xz')
    >>> Archive.parse_filename("abc.zip")
    ('abc', 'zip', None)
    >>> Archive.parse_filename("abc.lzma")
    ('abc', None, 'lzma')
    >>> Archive.parse_filename("abc.tar.foo")
    ('abc.tar.foo', None, None)
    >>> Archive.parse_filename("abc")
    ('abc', None, None)

)