pathable 0.4.4


pip install pathable

  Latest version

Released: Jan 10, 2025


Meta
Author: Artur Maciag
Requires Python: >=3.7.0,<4.0.0

Classifiers

Development Status
  • 4 - Beta

Intended Audience
  • Developers

License
  • OSI Approved :: Apache Software License

Operating System
  • OS Independent

Programming Language
  • Python :: 3
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13

Topic
  • Software Development :: Libraries
  • Software Development :: Libraries :: Python Modules

About

Object-oriented paths

Key features

  • Traverse resources like paths

  • Access resources on demand with separate accessor layer

Usage

from pathable import DictPath

d = {
    "parts": {
        "part1": {
            "name": "Part One",
        },
        "part2": {
            "name": "Part Two",
        },
    },
}

dp = DictPath(d)

# Concatenate paths with /
parts = dp / "parts"

# Stat path keys
"part2" in parts

# Open path dict
with parts.open() as parts_dict:
    print(parts_dict)

Wheel compatibility matrix

Platform Python 3
any

Files in release

No dependencies