Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/p1c2u/pathable
Object-oriented paths
https://github.com/p1c2u/pathable
Last synced: 3 months ago
JSON representation
Object-oriented paths
- Host: GitHub
- URL: https://github.com/p1c2u/pathable
- Owner: p1c2u
- License: apache-2.0
- Created: 2021-04-13T10:53:54.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-13T09:32:52.000Z (over 1 year ago)
- Last Synced: 2024-10-03T07:58:42.094Z (4 months ago)
- Language: Python
- Homepage:
- Size: 90.8 KB
- Stars: 5
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
********
pathable
********About
#####Object-oriented paths
Key features
************* Traverse resources like paths
* Access resources on demand with separate accessor layerUsage
#####.. 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)