{"id":551,"library":"pathable","title":"Pathable: Object-Oriented Paths","description":"Pathable is a Python library that provides object-oriented paths for traversing hierarchical data structures like dictionaries and lists, as well as file systems. It offers an intuitive, chainable API for deep lookups, incremental path building, and safe probing of data. The library is actively maintained with frequent releases, with version 0.5.0 being the latest stable release.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/p1c2u/pathable","tags":["path","lookup","dictionary","list","filesystem","navigation","object-oriented","data-structures"],"install":[{"cmd":"pip install pathable","lang":"bash","label":"Install latest stable version"}],"dependencies":[],"imports":[{"symbol":"LookupPath","correct":"from pathable import LookupPath"},{"symbol":"FilesystemPath","correct":"from pathable import FilesystemPath"},{"note":"BaseAccessor was replaced by NodeAccessor in version 0.5.0a3.","wrong":"from pathable import BaseAccessor","symbol":"NodeAccessor","correct":"from pathable import NodeAccessor"}],"quickstart":{"code":"from pathable import LookupPath\n\ndata = {\n    \"parts\": {\n        \"part1\": {\"name\": \"Part One\"},\n        \"part2\": {\"name\": \"Part Two\"}\n    }\n}\n\nroot = LookupPath.from_lookup(data)\n\n# Navigate using slash operator\nname_path = root / \"parts\" / \"part2\" / \"name\"\nname = name_path.read_value()\n\nprint(f\"Value found: {name}\")\nassert name == \"Part Two\"\n\n# Check existence\nassert (root / \"parts\" / \"part1\").exists()\nassert not (root / \"non_existent\").exists()\n\n# Safe access with .get()\npart3_name = (root / \"parts\").get(\"part3\", default=None)\nprint(f\"Value with .get(): {part3_name}\")\nassert part3_name is None","lang":"python","description":"This example demonstrates how to use `LookupPath` to navigate and access values within nested dictionary structures using a pathlib-like syntax. It shows basic navigation, value reading, existence checks, and safe access with a default fallback."},"warnings":[{"fix":"Update all imports and references from `BaseAccessor` to `NodeAccessor`. Review your code for areas where custom accessors might need adaptation to the new `NodeAccessor` interface.","message":"`BaseAccessor` was replaced by `NodeAccessor`. Code directly using `BaseAccessor` will fail.","severity":"breaking","affected_versions":">=0.5.0a3"},{"fix":"Review type hints for `AccessorPath` instances. If you have custom subclasses or functions expecting specific types, you may need to add or adjust generic type parameters (e.g., `AccessorPath[SomeType]`).","message":"`AccessorPath` became generic. This change impacts type hints and potentially runtime behavior where type arguments for `AccessorPath` were not previously expected or provided.","severity":"breaking","affected_versions":">=0.5.0a3"},{"fix":"If your project still requires `pyrsistent`, you must explicitly add `pip install pyrsistent` to your project's dependencies.","message":"The `pyrsistent` dependency was removed in version 0.5.0b3. While an internal optimization for `pathable`, if your project implicitly relied on `pyrsistent` being installed as a transitive dependency of `pathable`, it will no longer be available automatically.","severity":"gotcha","affected_versions":">=0.5.0b3"},{"fix":"Update your code to use the current method for constructing `LookupPath` instances from lookup data. This may involve using the class constructor directly (e.g., `LookupPath(data)`) or a different factory method introduced in the new API.","message":"The static method `LookupPath.from_lookup` has been removed or renamed.","severity":"breaking","affected_versions":">=0.5.0"}],"env_vars":null,"last_verified":"2026-05-12T15:01:14.262Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Install the library using pip: `pip install pathable`","cause":"The 'pathable' library is not installed in your Python environment or is not accessible on the Python path.","error":"ModuleNotFoundError: No module named 'pathable'"},{"fix":"Use safe access methods like `.get('<key>', default=None)` to provide a default value if the key is missing, or check for existence with `.exists()` before strict access. For example, change `p // 'a' // 'c'` to `(p / 'a' / 'c').get(default=None)`.","cause":"You are attempting to access a path segment that does not exist in the underlying data structure using strict access (e.g., the `//` operator or `.read_value()` on a non-existent path).","error":"KeyError: '<missing_key>'"},{"fix":"Migrate to the newer, supported API. For example, instead of `p.get('key')`, use `(p / 'key').read_value()` or direct subscriptable access `p['key']` (if the path is already resolved to the appropriate level), or `p.read_value()` after building the path. For iteration, use standard Python iteration directly on the path object, e.g., `for child in p:`.","cause":"You are trying to use a method that has been deprecated or removed in `pathable` version 0.5.0 (e.g., `iter`, `iteritems`, `content`, `get`, `getkey`).","error":"AttributeError: 'LookupPath' object has no attribute '<deprecated_method>'"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":70,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.04,"mem_mb":2.2,"disk_size":"17.9M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.04,"mem_mb":2.2,"disk_size":"18M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.08,"mem_mb":2.5,"disk_size":"19.7M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":2.5,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.07,"mem_mb":2.3,"disk_size":"11.6M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.09,"mem_mb":2.5,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.06,"mem_mb":2.5,"disk_size":"11.2M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.09,"mem_mb":2.3,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.03,"mem_mb":1.5,"disk_size":"17.3M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.03,"mem_mb":1.5,"disk_size":"18M"}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}