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

Update README #211

Merged
merged 1 commit into from
Aug 4, 2018
Merged

Update README #211

merged 1 commit into from
Aug 4, 2018

Conversation

piskvorky
Copy link
Owner

@piskvorky piskvorky commented Aug 4, 2018

Reorganize README + update the README examples to be py3k-compatible.

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
Copy link
Collaborator

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.

Copy link
Owner Author

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).
Copy link
Collaborator

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.

@piskvorky piskvorky force-pushed the readme_update branch 3 times, most recently from 9bbcbc5 to 55fc0d1 Compare August 4, 2018 13:42
@piskvorky
Copy link
Owner Author

piskvorky commented Aug 4, 2018

@mpenkov @menshikh-iv we also have project logos (both light and dark background), but I'm not sure where to put it:

smart_open_logo_positive_short_tb

smart_open_logo_positive_complete_tb

smart_open_logo_negative_complete

@piskvorky piskvorky merged commit 8e3a58c into master Aug 4, 2018
@piskvorky piskvorky deleted the readme_update branch August 4, 2018 14:28
@piskvorky piskvorky mentioned this pull request Aug 5, 2018
::

pip install smart_open
>>> smart_open('s3://', s3_upload={ 'ServerSideEncryption': 'AES256' })
Copy link
Contributor

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).
Copy link
Contributor

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)

Copy link
Owner Author

@piskvorky piskvorky Aug 6, 2018

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

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!

@menshikh-iv
Copy link
Contributor

@piskvorky about logo - maybe instead of the header (but I'm not sure that this is a good idea, by PyPI uploading reason)

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

Successfully merging this pull request may close these issues.

3 participants