#599 added support for file objects in the C API. We want to also support this in the Python API.
Semantics should follow what we've done in kastore, where the Python C interface is adapted to use a fileno. This would mean that we should be able to work with any kind of fileobj other than a BytesIO.
There's a choice to be made in whether we rename the parameter from path to file (we could keep path as a deprecated alias keyword only arg).