-
Notifications
You must be signed in to change notification settings - Fork 222
Add zip functionality #539
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
Merged
+164
−1
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b80c952
wip
sujaygarlanka 85bfaf0
Merge branch 'master' into zip-functionality
sujaygarlanka ab5f763
Update HISTORY.rst
sujaygarlanka 724fe22
clean up code
sujaygarlanka a36dab8
Update zip.md
sujaygarlanka fa9979c
tests working and code clean up
sujaygarlanka b998a50
fix pylint
sujaygarlanka 36de438
fixes for pylint
sujaygarlanka a062009
pylint fixes
sujaygarlanka fcb69e6
Update boxsdk/client/client.py
sujaygarlanka d398daf
Update boxsdk/client/client.py
sujaygarlanka 75aed55
Apply suggestions from code review
sujaygarlanka fa63bc2
Merge branch 'master' into zip-functionality
sujaygarlanka bfd3ab0
make create a zip private
sujaygarlanka e689c3e
Merge branch 'master' into zip-functionality
sujaygarlanka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| Zip | ||
| ======== | ||
|
|
||
| Allows you to create a temporary zip file on Box, containing Box files and folders, and then download it. | ||
|
|
||
| <!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
| <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
|
||
| - [Download a Zip File](#download-a-zip-file) | ||
|
|
||
| <!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
|
||
| Download a Zip File | ||
| ----------------------------- | ||
|
|
||
| Calling [`client.download_zip(name, items, writable_stream)`][create_zip] will let you create a new zip file | ||
| with the specified name and with the specified items and download it to the stream that is passed in. The response is a status `dict` that contains information about the download, including whether it was successful. The created zip file does not show up in your Box account. | ||
|
|
||
| ```python | ||
| name = 'test' | ||
| file = mock_client.file('466239504569') | ||
| folder = mock_client.folder('466239504580') | ||
| items = [file, folder] | ||
| output_file = open('test.zip', 'wb') | ||
| status = client.download_zip(name, items, output_file) | ||
| print('The status of the zip download is {0}'.format(status['state'])) | ||
| ``` | ||
|
|
||
| [download_zip]: https://box-python-sdk.readthedocs.io/en/latest/boxsdk.client.html#boxsdk.client.client.Client.download_zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.