Registry / serialization / pathtools

pathtools

JSON →
library0.1.2pypypi✓ verified 22d ago

Pathtools is a Python library providing pattern matching and various utilities for file system paths. The library is currently at version 0.1.2 and was last updated in 2011, indicating an abandoned or extremely slow release cadence.

pip install pathtools
INSTALL
IMPORT
SIG · PATHTOOLS
P
pathtools
serializationpythonv0.1.2
Install
2.2s avg
Import
Disk
20MB
Pass rate
6/ 10
Env Coverage6 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 2s
py 3.11
✓ —
✓ 2.1s
py 3.12
✕ build_error
✕ build_error
py 3.13
✕ build_error
✕ build_error
py 3.9
✓ —
✓ 2.4s
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

filter_paths
from pathtools.patterns import filter_paths
match_path
from pathtools.patterns import match_path
absolute_path
from pathtools.path import absolute_path

This example demonstrates how to use `filter_paths` from `pathtools.patterns` to filter a list of file paths based on inclusion and exclusion patterns.

import os from pathtools.patterns import filter_paths # Create some dummy files for demonstration os.makedirs("temp_dir", exist_ok=True) with open("temp_dir/file1.txt", "w") as f: f.write("test") with open("temp_dir/image.png", "w") as f: f.write("test") with open("temp_dir/document.pdf", "w") as f: f.write("test") all_paths = [ "temp_dir/file1.txt", "temp_dir/image.png", "temp_dir/document.pdf", "temp_dir/another.txt", "ignore_me.log" ] # Filter paths to include only .txt files and exclude 'ignore_me.log' included_patterns = ['*.txt'] excluded_patterns = ['*ignore_me.log'] filtered = filter_paths(all_paths, included_patterns, excluded_patterns) print(list(filtered)) # Clean up os.remove("temp_dir/file1.txt") os.remove("temp_dir/image.png") os.remove("temp_dir/document.pdf") os.rmdir("temp_dir")
Debug
Known issues
breakingThe `pathtools` library is incompatible with Python 3.12 and newer versions due to its reliance on the removed `imp` module in its `setup.py`.
fix
There is no official fix from the maintainer. Consider replacing `pathtools` with `pathlib` for modern Python development or using a vendored/patched version if absolutely necessary.
affects: 0.1.2 (Python 3.12+)
deprecatedThe `pathtools` project appears to be unmaintained, with the last commit over 10 years ago and no new releases since 2011. For new projects, the built-in `pathlib` module (available since Python 3.4) offers a more modern, object-oriented, and actively maintained alternative for path manipulation.
fix
Migrate to `pathlib` for robust and future-proof path handling. Projects like `watchdog` have already replaced `pathtools` with `pathlib`.
affects: All versions
gotchaThe library's functionality is limited compared to modern alternatives like `pathlib`. It lacks features such as direct path object manipulation, platform-independent path construction (beyond basic separators), and integration with asynchronous operations.
fix
Evaluate `pathlib` for more comprehensive and idiomatic Pythonic path operations. For specific advanced use cases, other specialized libraries might be more suitable.
affects: All versions
Upgrade
Version history
0.1.2latest on PyPI · released Aug 25, 2011
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
pathtools — pip install pathtools · libregistry