Skip to main content

pathlib extensions

Project description

pathliberty

Extended object-oriented filesystem paths library.
pathliberty is the Python package that allows you to subclass a pathlib.PosixPath in a proper way. To define your own custom path subclass, declare subclasses AbstractPathAccessor and AbstractPath.

Features

Support SSH remote path via Paramiko:

from pathliberty import SSHPath
from pathliberty.ssh import SSHSession
from getpass import getuser

host = 'localhost'
ssh_session = SSHSession(
    host,
    password=******,
)
ssh_path = SSHPath(f'/home/{getuser()}', ssh=ssh_session)
assert ssh_path.parent == SSHPath('/home', host=host)

Installation

pip install pathliberty

Project details


Download files

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

Source Distribution

pathliberty-0.6.1.tar.gz (7.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page