{"id":27503,"library":"Unipath","title":"Unipath","description":"Unipath provides an object-oriented alternative to os/os.path/shutil for Python file system path manipulation, wrapping common operations in a Path class. Current version is 1.1, stable but in maintenance mode with infrequent releases.","status":"maintenance","version":"1.1","language":"python","source_language":"en","source_url":"https://github.com/mikeorr/Unipath","tags":["filesystem","path","object-oriented","os-path"],"install":[{"cmd":"pip install Unipath","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Direct import from unipath is the correct pattern.","wrong":"from unipath.path import Path","symbol":"Path","correct":"from unipath import Path"},{"note":"","wrong":null,"symbol":"FSPath","correct":"from unipath import FSPath"}],"quickstart":{"code":"from unipath import Path\n\n# Create a Path object\np = Path('/tmp/example.txt')\n# Check existence\nprint(p.exists())  # True if file exists\n# Read content\nif p.exists():\n    print(p.read_file())","lang":"python","description":"Basic usage: create a Path and check existence/read content."},"warnings":[{"fix":"Migrate to pathlib.Path for Python 3.12+ compatibility. Unipath may not receive updates.","message":"Unipath does not work with Python 3.12+ if using any import of 'os.path' functions that have been removed (e.g., os.path.walk). The library itself is compatible with Python up to 3.11. For Python 3.12+, consider using pathlib which is available in the standard library.","severity":"breaking","affected_versions":">=1.1, Python >=3.12"},{"fix":"Use pathlib.Path instead: from pathlib import Path.","message":"Unipath is no longer actively developed. The author recommends using pathlib from the standard library for new projects.","severity":"deprecated","affected_versions":"all"},{"fix":"Use p.child('subdir') instead of p + '/subdir'.","message":"Unipath's Path inherits from str, so string concatenation with '+' may not work as expected. Use .child() method for joining paths.","severity":"gotcha","affected_versions":"all"},{"fix":"Call p.exists(refresh=True) to bypass cache.","message":"The .exists() method caches results; if the file system changes, use .exists(refresh=True) to get current status.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use: from unipath import Path","cause":"Incorrect import: 'from unipath import Path' is correct; 'import unipath' does not expose Path directly.","error":"AttributeError: module 'unipath' has no attribute 'Path'"},{"fix":"Use str(p) when passing to functions that expect str or os.PathLike.","cause":"Unipath Path is a subclass of str, but some functions in Python standard library may not accept it directly. Convert to str explicitly.","error":"TypeError: expected str, bytes or os.PathLike object, not Path"},{"fix":"Migrate to pathlib.Path: from pathlib import Path.","cause":"Unipath is deprecated; this warning may be issued in some environments.","error":"DeprecationWarning: unipath.Path is deprecated, use pathlib instead"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}