Unipath /

from distutils.core import setup

VERSION = "0.2.1"

Unipath is an object-oriented approach to file/pathname 
manipulations and filesystem calls, an alternative to ``os.path.*``,
``shutil.*``, and some ``os.*`` functions.  It's based on
Orendorff's but has been refactored to make application code
more concise, by focusing on what the programmer wants to do rather
than on low-level operations exactly like the C library.  For

- ``p.mkdir()`` succeeds silently if the directory already exists, and
- ``p.mkdir(True)`` creates intermediate directories a la
- ``p.rmtree(parents=True)`` combines ``shutil.rmtree``,
  ``os.path.isdir``, ``os.remove``, and ``os.removedirs``, to
  recursively remove whatever it is if it exists.  
-  ``p.read_file("rb")`` returns the file's contents in binary mode.  
- ``p.needs_update([other_path1, ...])`` returns True if p doesn't
  exist or has an older timestamp than any of the others.
- extra convenience functions in the ```` module.
  ``dict2dir`` creates a directory hierarchy described by a ``dict``.
  ``dump_path`` displays an ASCII tree of a directory hierarchy.

Unipath has a ``Path`` class for abstract pathname manipulations
(``p.parent``, ``p.expand()``), and a ``FSPath`` subclass for
filesystem calls (all the ones above).  You can do "from unipath
import FSPath as Path" and forget about the distinction, or use the
``Path`` class and be confident you'll never access the filesystem.
The ``Path`` class is also being proposed as an addition to the
standard libary (``os.path.Path``).  Compare::

    # Reference a file that's two directories above another file.
    p = os.path.join(os.path.dirname(os.path.dirname("/A/B/C")), "file.txt")
    p = Path("A/B/C").parent.parent.child("file.txt")
    p = Path("A/B/C").ancestor(2).child("file.txt")
    p0 = Path("/A/B/C");  p = Path(p0.parent.parent, "file.txt")

    # Change the extension of a path.
    p = os.path.splitext("image.jpg")[0] + ".png"
    p = Path("image.jpg").name + ".png"

Documentation is in the README and on the
`website <>`__.

Unipath comes with extensive
unittests, and has been tested on Python 2.5 and 2.4.4 on Linux.
Feedback and Windows/Macintosh testers are encouraged.

    description="Object-oriented alternative to os/os.path/shutil",
    author="Mike Orr",
        "" % VERSION,
    keywords="os.path filename pathspec path files directories filesystem",
        "License :: OSI Approved :: Python Software Foundation License",
        "Operating System :: OS Independent",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: Utilities",