Registry / serialization / fspath

fspath

JSON →
library20230629pypypi✓ verified 86d ago

fspath (v20230629) provides semantic path names and file system path utilities for Python. It offers a lightweight, intuitive API for common path manipulations. The project is in maintenance mode with infrequent releases.

pip install fspath
INSTALL
IMPORT
SIG · FSPATH
F
fspath
serializationpythonv20230629
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

fspath
import fspath

Basic usage: create fspath objects and access semantic path components.

import fspath # Create a path object p = fspath.frompath('/tmp/example.txt') print(p) # /tmp/example.txt # Check properties print(p.exists()) print(p.is_file()) # Use semantic methods print(p.ext) # .txt print(p.stem) # example print(p.parent)
Debug
Known issues
gotchafspath is not compatible with pathlib.Path on all operations. Converting between types may lose semantic attributes.
fix
Always use fspath methods directly; avoid mixing with pathlib unless documented.
affects: all
deprecatedThe library is in maintenance mode with rare updates. New projects should consider using pathlib (Python 3.4+) or pathlib2 for older versions.
fix
Prefer pathlib for new projects; use fspath only for backward compatibility.
affects: all
Errors
Common errors & fixes
AttributeError: 'str' object has no attribute 'ext'
fspath methods and attributes (like .ext) are only available on fspath objects, not plain strings.
fix
Convert string paths to fspath: p = fspath.frompath('/path/to/file.txt') then use p.ext
ImportError: No module named 'fspath'
fspath is not installed or installed in a different environment.
fix
Run 'pip install fspath' in your virtual environment.
Upgrade
Version history
20230629latest on PyPI · released Jun 29, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
fspath — pip install fspath · libregistry