Using smart_open for reading gzip file with sftp #827
Answered
by
ddelange
dineshbvadhia
asked this question in
Q&A
Replies: 1 comment 16 replies
-
if your filename ends on https://github.com/piskvorky/smart_open?tab=readme-ov-file#compression-handling >>> from smart_open import open
>>> with open('sftp://smart_open/tests/test_data/1984.txt.gzip', compression='.gz') as fin:
... print(fin.read(32))
It was a bright cold day in Apri |
Beta Was this translation helpful? Give feedback.
16 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to read a remote gzip file line by line using sftp. I have a working solution using an sftp package but want to make it work with smart_open but the conversion is not working :(
The sftp code to convert is:
My attempt is:
Which generates the Traceback:
What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions