Skip to content

ChristianWeymannTNG/pathable

 
 

Repository files navigation

pathable

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)

About

Object-oriented paths

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%