files – Python File and Path manipulation

Platforms: Windows, Unix

Date:December 26, 2008

The files module for Python provides an easy way to deal with files, directories, and paths in a Pythonic way. It was created out of a frustration with the standard Python approach to files and directories, the venerable os module.

While the os module and its path component, os.path are quite usable and full-featured, they don’t feel pythonic. The files module tries to change that by grouping all the relevant features of os and os.path into three simple classes.

The files module has currently been tested on Unix. Windows testing will begin as soon as I get near enough to a Windows computer.

A quick word on usage: the files module was developed to be used with Python’s from ... import * syntax. Please save yourself the trouble of typing files. all the time.

Also, the files module is intended to be used with Python 3. It may break significantly in Python 2 (and then again, maybe not).

Indices and tables