<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Project><name>Unipath</name>
<shortdesc>Object-oriented alternative to os/os.path/shutil</shortdesc>
<description>*2009-03-29: Home page is currently down.  Download tarball below, and see the
README for complete documentation.  The source will be on Bitbucket after PyCon.*

Unipath is package for doing pathname calculations and filesystem access in
an object-oriented manner, an alternative to ``os.path.*``,
``shutil.*``, ``glob``, and some ``os.*`` functions..  It's based on Jason
Orendorff's *path.py* but does not adhere as strictly to the underlying
functions' syntax, in order to provide more user convenience and higher-level
functionality.  For example:

- ``p.mkdir()`` succeeds silently if the directory already exists, and
- ``p.mkdir(True)`` creates intermediate directories a la
  ``os.makedirs``.   
- ``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 ``unipath.tools`` module.
  ``dict2dir`` creates a directory hierarchy described by a ``dict``.
  ``dump_path`` displays an ASCII tree of a directory hierarchy.

The ``Path`` class subclasses ``AbstractPath``, which contains only those
methods that don't consult the filesystem.  Most users just use the ``Path``
class and ignore the base class, but it's there for specialized uses.

Here's a comparision of some ``Path`` operations and their stdlib equivalents:

    # 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 &lt;http://sluggo.scrapping.cc/python/unipath/&gt;`__.

Unipath is for Python 2.4 or higher, and comes with a test suite.  The API is
pretty much stable now.  The development repository is
http://bitbucket.org/sluggo/unipath .</description>
<homepage rdf:resource="http://sluggo.scrapping.cc/python/unipath/" />
<maintainer><foaf:Person><foaf:name>Mike Orr</foaf:name>
<foaf:mbox_sha1sum>abd47a5965a698cd5c45b06b4f96ea7a3536d1e9</foaf:mbox_sha1sum></foaf:Person></maintainer>
<release><Version><revision>0.2.1</revision></Version></release>
</Project></rdf:RDF>