Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kralverde committed Oct 19, 2023
1 parent 62bf885 commit d54d006
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ Given a block store and a root cid, decode the underlying data.
...
>>> asyncio.run(test())
b'some data'

Recursively iterate through a directory.

>>> from unix_fs_exporter import recursive_export, UnixFSFile
>>> # Creation of the blockstore is an exercise left to the reader
>>> async def test():
... entries = recursive_export('bafybeifpaez32hlrz5tmr7scndxtjgw3auuloyuyxblynqmjw5saapewmu', block_store)
... async for entry in entries:
... assert isinstance(entry, UnixFSFile)
... async for chunk in entry.content:
... assert isinstance(chunk, bytes)
>>> asyncio.run(test())

0 comments on commit d54d006

Please sign in to comment.