-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Update README #211
Update README #211
Conversation
README.rst
Outdated
>>> key = boto.connect_s3().get_bucket("my_bucket").get_key("my_key") | ||
>>> with smart_open(key) as fin: | ||
... for line in fin: | ||
... print line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use print(line)
instead of print line
? The former works under both Py2 and Py3, the latter doesn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Let me fix that.
README.rst
Outdated
>>> bucket = boto.connect_s3().get_bucket('mybucket') | ||
>>> for key, content in s3_iter_bucket(bucket, prefix='foo/', accept_key=lambda key: key.endswith('.json')): | ||
... print key, len(content) | ||
Working with large S3 files using Amazon's default Python library, `boto <http://docs.pythonboto.org/en/latest/>`_, is a pain. Its ``key.set_contents_from_string()`` and ``key.get_contents_as_string()`` methods only work for small files (loaded in RAM, no streaming). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using boto3 these days, not boto.
boto3 is a bit easier to use than boto, and the API is completely different, but the sentiment of the above statement is still true.
9bbcbc5
to
55fc0d1
Compare
@mpenkov @menshikh-iv we also have project logos (both light and dark background), but I'm not sure where to put it: |
55fc0d1
to
8467df2
Compare
:: | ||
|
||
pip install smart_open | ||
>>> smart_open('s3://', s3_upload={ 'ServerSideEncryption': 'AES256' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP8 (whitespaces before/after {
and }
)
>>> bucket = boto.connect_s3().get_bucket('mybucket') | ||
>>> for key, content in s3_iter_bucket(bucket, prefix='foo/', accept_key=lambda key: key.endswith('.json')): | ||
... print key, len(content) | ||
Working with large S3 files using Amazon's default Python library, `boto <http://docs.pythonboto.org/en/latest/>`_ and `boto3 <https://boto3.readthedocs.io/en/latest/>`_, is a pain. Its ``key.set_contents_from_string()`` and ``key.get_contents_as_string()`` methods only work for small files (loaded in RAM, no streaming). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check, how this rendered on PyPI (as I remember, PyPI have really "strict" parser and readme render can be easily broken)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I made any changes here (just moved the sections around).
But yes, checking on PyPI is a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked, rendering works https://test.pypi.org/project/smart-open/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. I didn't know about test.pypi.org, nice find!
@piskvorky about logo - maybe instead of the header (but I'm not sure that this is a good idea, by PyPI uploading reason) |
Reorganize README + update the README examples to be py3k-compatible.