drivendataorg / drivendataorg/cloudpathlib

Pure path classes

Open
#31 7 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
628
Forks
88
Avg merge
17h 28m
Merged PRs (30d)
2

Description

[pathlib](https://docs.python.org/3/library/pathlib.html) has this notion of pure paths `PurePath` (`PurePosixPath`, `PureWindowsPath`) vs concrete paths `Path` (`PosixPath`, `WindowsPath`).

> Path classes are divided between pure paths, which provide purely computational operations without I/O, and concrete paths, which inherit from pure paths but also provide I/O operations.

> Pure paths are useful in some special cases; for example:
>
>1. If you want to manipulate Windows paths on a Unix machine (or vice versa). You cannot instantiate a WindowsPath when running on Unix, but you can instantiate PureWindowsPath.
> 2. You want to make sure that your code only manipulates paths without actually accessing the OS. In this case, instantiating one of the pure classes may be useful since those simply don’t have any OS-accessing operations.

Would it be useful for cloudpathlib to have pure paths that let you manipulate paths for a cloud provider without needing to authenticate?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.