<div dir="ltr"><div>Here's a comparison table of os, os.path, shutil, pathlib, and path.py.</div><div><br></div><div>The full version is at</div><div><a href="https://github.com/westurner/pyfilemods">https://github.com/westurner/pyfilemods</a> (README.rst)</div><div>and at</div><div><a href="https://westurner.github.io/pyfilemods">https://westurner.github.io/pyfilemods</a>. </div><div class="gmail_extra"><br></div><div class="gmail_extra">I ran a few set intersections and went ahead and </div><div class="gmail_extra">wrote a report to compare function/method signatures and sources.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra"><font face="monospace, monospace">attr table</font></div><div class="gmail_extra"><font face="monospace, monospace">==========</font></div><div class="gmail_extra"><font face="monospace, monospace"><br></font></div><div class="gmail_extra"><font face="monospace, monospace">================== == ======= ====== ======= =======</font></div><div class="gmail_extra"><font face="monospace, monospace">attr               os os.path shutil pathlib path.py </font></div><div class="gmail_extra"><font face="monospace, monospace">================== == ======= ====== ======= =======</font></div><div class="gmail_extra"><font face="monospace, monospace">`__div__`_                                    X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`__rdiv__`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`absolute`_                          X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`abspath`_            X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`access`_          X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`altsep`_          X  X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`anchor`_                            X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`as_posix`_                          X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`as_uri`_                            X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`atime`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`basename`_           X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`bytes`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`capitalize`_                                 X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`casefold`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`cd`_                                         X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`center`_                                     X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`chdir`_           X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`chmod`_           X                 X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`chown`_           X          X               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`chroot`_          X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`chunks`_                                     X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`commonpath`_         X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`commonprefix`_       X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`copy`_                       X               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`copy2`_                      X               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`copyfile`_                   X               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`copymode`_                   X               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`copystat`_                   X               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`copytree`_                   X               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`count`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`ctime`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`curdir`_          X  X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`cwd`_                               X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`defpath`_         X  X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`devnull`_         X  X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`dirname`_            X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`dirs`_                                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`drive`_                             X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`encode`_                                     X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`endswith`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`exists`_             X              X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`expand`_                                     X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`expandtabs`_                                 X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`expanduser`_         X              X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`expandvars`_         X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`ext`_                                        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`extsep`_          X  X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`files`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`find`_                                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`fnmatch`_                    X               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`format`_                                     X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`format_map`_                                 X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`get_owner`_                                  X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`getatime`_           X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`getctime`_           X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`getcwd`_          X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`getmtime`_           X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`getsize`_            X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`glob`_                              X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`group`_                             X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`home`_                              X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`in_place`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`index`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`is_absolute`_                       X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`is_block_device`_                   X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`is_char_device`_                    X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`is_dir`_                            X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`is_fifo`_                           X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`is_file`_                           X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`is_reserved`_                       X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`is_socket`_                         X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`is_symlink`_                        X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`isabs`_              X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`isalnum`_                                    X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`isalpha`_                                    X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`isdecimal`_                                  X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`isdigit`_                                    X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`isdir`_              X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`isfile`_             X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`isidentifier`_                               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`islink`_             X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`islower`_                                    X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`ismount`_            X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`isnumeric`_                                  X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`isprintable`_                                X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`isspace`_                                    X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`istitle`_                                    X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`isupper`_                                    X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`iterdir`_                           X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`join`_               X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`joinpath`_                          X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`lchmod`_                            X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`lexists`_            X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`lines`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`link`_            X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`listdir`_         X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`ljust`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`lower`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`lstat`_           X                 X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`lstrip`_                                     X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`makedirs`_        X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`makedirs_p`_                                 X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`maketrans`_                                  X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`match`_                             X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`merge_tree`_                                 X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`mkdir`_           X                 X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`mkdir_p`_                                    X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`module`_                                     X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`move`_                       X               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`mtime`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`name`_            X                 X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`namebase`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`normcase`_           X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`normpath`_           X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`open`_            X                 X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`os`_                 X       X                      </font></div><div class="gmail_extra"><font face="monospace, monospace">`owner`_                             X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`pardir`_          X  X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`parent`_                            X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`parents`_                           X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`partition`_                                  X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`parts`_                             X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`pathconf`_        X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`pathsep`_         X  X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`read_bytes`_                        X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`read_hash`_                                  X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`read_hexhash`_                               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`read_md5`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`read_text`_                         X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`readlink`_        X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`readlinkabs`_                                X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`realpath`_           X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`relative_to`_                       X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`relpath`_            X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`relpathto`_                                  X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`remove`_          X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`remove_p`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`removedirs`_      X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`removedirs_p`_                               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`rename`_          X                 X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`renames`_         X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`replace`_         X                 X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`resolve`_                           X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`rfind`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`rglob`_                             X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`rindex`_                                     X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`rjust`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`rmdir`_           X                 X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`rmdir_p`_                                    X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`rmtree`_                     X               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`rmtree_p`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`root`_                              X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`rpartition`_                                 X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`rsplit`_                                     X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`rstrip`_                                     X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`samefile`_           X              X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`sameopenfile`_       X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`samestat`_           X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`sep`_             X  X                              </font></div><div class="gmail_extra"><font face="monospace, monospace">`size`_                                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`special`_                                    X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`split`_              X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`splitall`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`splitdrive`_         X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`splitext`_           X                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`splitlines`_                                 X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`splitpath`_                                  X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`splitunc`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`startswith`_                                 X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`stat`_            X  X       X      X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`statvfs`_         X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`stem`_                              X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`strip`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`stripext`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`suffix`_                            X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`suffixes`_                          X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`swapcase`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`symlink`_         X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`symlink_to`_                        X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`text`_                                       X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`title`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`touch`_                             X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`translate`_                                  X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`uncshare`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`unlink`_          X                 X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`unlink_p`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`upper`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`using_module`_                               X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`utime`_           X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`walk`_            X                          X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`walkdirs`_                                   X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`walkfiles`_                                  X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`with_name`_                         X               </font></div><div class="gmail_extra"><font face="monospace, monospace">`with_suffix`_                       X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`write_bytes`_                       X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`write_lines`_                                X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`write_text`_                        X        X      </font></div><div class="gmail_extra"><font face="monospace, monospace">`zfill`_                                      X      </font></div><div class="gmail_extra"><font face="monospace, monospace">================== == ======= ====== ======= =======</font></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 14, 2018 at 2:22 PM, Wes Turner <span dir="ltr"><<a href="mailto:wes.turner@gmail.com" target="_blank">wes.turner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">path.py conveniently defines very many (most?) file operations as methods:<div><a href="https://github.com/jaraco/path.py/blob/master/path.py" target="_blank">https://github.com/jaraco/<wbr>path.py/blob/master/path.py</a></div><div><br></div><div><a href="https://pathpy.readthedocs.io/en/latest/api.html" target="_blank">https://pathpy.readthedocs.io/<wbr>en/latest/api.html</a></div><div><br></div><div>The division operator is mapped to os.path.join:</div><div><br></div><div>Path('a') / '/root' == Path('/root')<div><div class="gmail-h5"><br><br>On Monday, March 12, 2018, George Fischhof <<a href="mailto:george@fischhof.hu" target="_blank">george@fischhof.hu</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2018-03-12 22:16 GMT+01:00 Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>On 12 March 2018 at 20:57, George Fischhof <<a href="mailto:george@fischhof.hu" target="_blank">george@fischhof.hu</a>> wrote:<br>
> Good day all,<br>
><br>
> as it seemed to be a good idea, I wrote a PEP proposal for pathlib to<br>
> contain file operations.<br>
><br>
> Here is the draft. What do you think about this?<br>
<br>
</span>I don't know for certain what I think I feel about the idea - in<br>
general, it seems plausible. But I think you'll need to get down to<br>
specifics in the PEP, exactly what functions do you suggest get added<br>
to pathlib?<br>
<span><font color="#888888"><br>
Paul<br>
</font></span></blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">

<div class="gmail_extra" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline">Basically </span> file and directory operations: copy, rename, move, delete. With all variants.<br></div><div class="gmail_extra" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">I will collect them, and put intot PEP</div>

<br></div><div class="gmail_extra">George</div></div>
</blockquote></div></div></div>
</blockquote></div><br></div></div>