Skip to main content

An object-oriented path interface to archives, images, remote filesystems, etc

Project description

Latest version released on PyPi Documentation

Pathlab provides an object-oriented path interface to archives, images, remote filesystems, etc. It is built upon pathlib and includes built-in support for:

  • tar archives
  • zip archives
  • iso disc images (inc Rock Ridge; exc Joliet and UDF)
  • JFrog Artifactory (via requests)

You can also define your own Path subclass with its own accessor.


Requires Python 3.6+. Use pip:

pip install --user pathlab


These usage examples are adapted from the pathlib documentation.

Getting a path type:

>>> from pathlab import TarAccessor
>>> TarPath = TarAccessor('project.tgz').TarPath

Listing subdirectories:

>>> root = TarPath('/')
>>> [x for x in root.iterdir() if x.is_dir()]

Listing Python source files in this directory tree:

>>> list(root.glob('**/*.py'))

Navigating inside a directory tree:

>>> p = TarPath('/etc')
>>> q = p / 'init.d' / 'reboot'
>>> q
>>> q.resolve()

Querying path properties:

>>> q.exists()
>>> q.is_dir()

Opening a file:

>>> with as f: f.readline()

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pathlab, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size pathlab-0.2.tar.gz (12.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page