Is it possible to import gltf in python using file-like objects?

0

I have encrypted and zipped gltf files on a server. I need to import them in blender directly. I found the way to load, decrypt and unzip the files to end-up with something like this :

with zipfile.ZipFile(io.BytesIO(decrypted_object)) as zip_ref:
for name in zip_ref.namelist() :
    print(name)

It prints the file name as an example, but may also write the file to disk if needed.

I would like to import the gltf content directly to the scene using something like this:

        import_path = (...)zip_ref(...) 
        bpy.ops.import_scene.gltf(filepath=import_path)

Is there a way to do this?

The easiest way would be to just make your own GLTF importer using the one that ships with Blender as a base. All of the importers are just python scripts.