Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

an efficient python path API for walking a filesystem with generators

Project Description

Pathtool: An efficient Python Path API

:Author: Noah Gift
:Version: $Revision: 0.1.0 $
:Copyright: This document has been placed in the public domain.


Pathtool is an efficient API to walking a filesystem, and it aims to be
very simple, yet powerful. By calling path you can pass it a path to a
filesystem, apply an optional unix style pattern filter, and an optional
action callback function.

This allows you do to powerful things to a filesystem in one line of code!

There is a record dictionary that contains useful key/value combinations such
as a unique_id hash, ctime, mtime, size, and extension. These records can easily
be used to create custom action callbacks. Additionally a future API will integrate
chainable actions.

.. contents::

Example Usage:

from pathtool import path
path("/tmp", filter=".mp3")

This would search the /tmp directory and return the path to all matches to the *.mp3
pattern. This is because it is using a default callback action that just prints out
the path to a match. You can create your own callback and do things like create tar
archives, delete files, move files, deduplicate files, compare sizes, etc.

The API is subject to some small changes, so no promises for now.

QUESTIONS: noah dot gift at

Release History

This version
History Node


Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate