Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support For File-Like Object #289

Open
SwordSam opened this issue Aug 13, 2020 · 3 comments
Open

Add Support For File-Like Object #289

SwordSam opened this issue Aug 13, 2020 · 3 comments

Comments

@SwordSam
Copy link

When I read from S3 bucket which is actually a .dlis file:

s3_client = boto3.client('s3') s3_response_object = s3_client.get_object(Bucket=x['bucket'], Key=x['s3_key']) object_content = s3_response_object['Body'].read()

I am not able to pass it to dlisio.load() as it only accepts a path to a file while my object_content is a BytesIO object.
Is there any workaround or fix for it?
Thanks,

@achaikou
Copy link
Contributor

Hi,

Thank you for reporting this issue.

Unfortunately as of now dlisio does not have cloud support [ #163 ]
We consider supporting it in the future and will take it into consideration that we have users who would appreciate the feature.

I am not familiar with File-Like Objects, so the only workaround I can think of is to convert BytesIO into a temporary file first (which seems to be possible) and then read it as normal.

@SwordSam
Copy link
Author

Hi,

Thanks for the prompt reply.
Correct temporary files are what I am using as workaround for now.

@jokva
Copy link

jokva commented Oct 14, 2020

I am not familiar with File-Like Objects, so the only workaround I can think of is to convert BytesIO into a temporary file first (which seems to be possible) and then read it as normal.

This is pretty much the use case we design lfp for, so "all" we need is a Python file-like backend for it. It's a reasonably easy thing to do, but of course takes a while with testing and whatnot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants