Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/p1c2u/pathable

Object-oriented paths
https://github.com/p1c2u/pathable

Last synced: 3 months ago
JSON representation

Object-oriented paths

Awesome Lists containing this project

README

        

********
pathable
********

About
#####

Object-oriented paths

Key features
************

* Traverse resources like paths
* Access resources on demand with separate accessor layer

Usage
#####

.. code-block:: python

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)