This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!
Project Description

This package monkey-patches some useful extensions on to pathlib from the Python standard library. These extensions are only supported on Posix systems.

Once installed, you can simply import Path from extended_pathlib just as you would from pathlib, and use the new functionality:

>>> from extended_pathlib import Path

>>> tmp = Path('/tmp')
>>> tmp.is_readable()
True

Installation

Use ‘pip3 install extended_pathlib’ to install. Requires Python2.7 or Python3.3 or better.

File Types

is_readable

Returns True if the given path points to an existing file or directory that is readable.

>>> Path('/usr/bin/python').is_readable()
True

is_writable

Returns True if the given path points to an existing file or directory that is writable.

>>> Path('/usr/bin/python').is_writable()
False

is_executable

Returns True if the given path points to an existing file or directory that is executable.

>>> Path('/usr/bin/python').is_executable()
True

is_hidden

Returns True if the given path points to an existing file or directory that is hidden (starts with ‘.’).

>>> Path('/usr/bin/python').is_hidden()
False

path_from

Returns relative path from start as a path object. This differs from Path.relative_to() in that relative_to() will not return a path that starts with ‘..’.

>>> cwd = Path('.')
>>> cwd.path_from('..')
PosixPath('tests')

sans_ext

Removes the file extension. This differs from Path.stem, which returns the final path component stripped of its extension. This returns the full path stripped of its extension.

>>> Path('a/b.c').sans_ext()
PosixPath('a/b')

write_bytes

Writes a binary file. This is the standard pathlib write_bytes() that was introduced in Python3.5, but back-ported to earlier versions.

write_text

Reads a binary file. This is the standard pathlib write_text() that was introduced in Python3.5, but back-ported to earlier versions.

read_bytes

Reads a binary file. This is the standard pathlib read_bytes() that was introduced in Python3.5, but back-ported to earlier versions.

read_text

Reads a text file. This is the standard pathlib read_text() that was introduced in Python3.5, but back-ported to earlier versions.

expanduser

Expand leading tilde (~) in paths.

Release History

Release History

0.4.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
extended_pathlib-0.4.0.tar.gz (3.7 kB) Copy SHA256 Checksum SHA256 Source Dec 30, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting