FAQ#
Can I disable the progress bars/displays?#
Yeup! Just set the argument quiet=True
when you call cached_path()
.
Does cached_path
have an async interface?#
No, not at the moment. But you can still benefit by calling cached_path()
concurrently
using asyncio.to_thread()
. For example:
>>> async def main():
... print("Downloading files...")
... with get_download_progress() as progress:
... await asyncio.gather(
... asyncio.to_thread(
... cached_path,
... "https://github.com/allenai/cached_path/blob/main/README.md",
... progress=progress,
... ),
... asyncio.to_thread(
... cached_path,
... "https://github.com/allenai/cached_path/blob/main/setup.py",
... progress=progress,
... ),
... asyncio.to_thread(
... cached_path,
... "https://github.com/allenai/cached_path/blob/main/requirements.txt",
... progress=progress,
... ),
... )
... print("Finished all downloads")
...
>>> asyncio.run(main())
Downloading files...
Finished all downloads
>>>