Beispiel #1
0
def walk(fs: MiniFS[T]) -> t.Iterable[T]:
    for row in flatten(fs._store, sep=fs.sep).items():
        yield row
Beispiel #2
0
from dictknife.transform import flatten, unflatten

iterable = [(1, 2, 3), (4, (5, 6))]

print(flatten(iterable))
print(unflatten(flatten(iterable)))

print("----------------------------------------")

d = {"paths": {"/foo/bar": "xxxx"}}
print(flatten(d))
print(unflatten(flatten(d)))
Beispiel #3
0
from dictknife.transform import flatten
from dictknife import loading

d = loading.loadfile("00person.json")
loading.dumpfile(d, format="json")
loading.dumpfile(flatten(d), format="json")

print("----------------------------------------")

d = loading.loadfile("02person.json")
loading.dumpfile(d, format="json")
loading.dumpfile(flatten(d), format="json")
Beispiel #4
0
 def call(d, *args, **kwargs):
     return dump_fn(flatten(d), *args, **kwargs)