https://github.com/boppreh/dictfs
Wraps the file system in a dictionary like access structure
https://github.com/boppreh/dictfs
Last synced: 2 months ago
JSON representation
Wraps the file system in a dictionary like access structure
- Host: GitHub
- URL: https://github.com/boppreh/dictfs
- Owner: boppreh
- License: mit
- Created: 2014-06-13T17:40:54.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-02-03T05:50:38.000Z (over 9 years ago)
- Last Synced: 2025-01-26T00:09:37.601Z (4 months ago)
- Language: Python
- Size: 7.81 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
dictfs
======Wraps the file system in a dictionary-like access structure.
```python
from dictfs import curdircurdir
# DictFs'/home/boppreh/git/dictfs'for i in curdir:
print(i)
# .git
# .gitignore
# LICENSE
# README.md
# dictfs.pycurdir.files()
# ['.gitignore', 'LICENSE', 'README.md', 'dictfs.py']curdir['.git']
# DictFs'/home/boppreh/git/dictfs/.git''LICENSE' in curdir
# Truecurdir[0]
# DictFs'/home/boppreh/git/dictfs/.git'curdir[0:2]
# [DictFs'/home/boppreh/git/dictfs/.git',
# '# Byte-compiled / optim ...']curdir['LICENSE']
# 'The MIT License (MIT)\n\nCopyright (c) 2014 BoppreH...'curdir['LICENSE', 'README.md']
# ['The MIT License...', 'dictfs\n======\n\nWraps the ...'])curdir['test.txt'] = 'Hello!'
del curdir['test.txt']curdir[curdir.files()]
# ['# Byte-compiled / optimized ...',
# 'The MIT License (MIT) ...',
# 'dictfs\n======\n\nWraps ...',
# 'from os import path, listdir, ...']curdir / '.git'
# '/home/boppreh/git/dictfs/.git'curdir['~/']
# DictFs'/home/boppreh'
```