Skip to content

Commit

Permalink
Updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaCappelletti94 committed Nov 3, 2019
1 parent f9f4dc3 commit d53de7e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Binary file added dist/encodeproject-1.0.6.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion encodeproject.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: encodeproject
Version: 1.0.5
Version: 1.0.6
Summary: Python package wrapping some of the encode project APIs.
Home-page: https://github.com/LucaCappelletti94/encodeproject
Author: Luca Cappelletti
Expand Down
2 changes: 1 addition & 1 deletion encodeproject/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Current version of package encodeproject"""
__version__ = "1.0.5"
__version__ = "1.0.6"
4 changes: 3 additions & 1 deletion encodeproject/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from tqdm.auto import tqdm
import requests
import humanize
import os
from typing import List, Dict
import pandas as pd

Expand All @@ -26,13 +27,14 @@ def download(url: str, path: str = None, block_size: int = 32768):
r = requests.get(url, stream=True)
total_size = int(r.headers.get('content-length', 0))
t = tqdm(total=total_size, unit='iB',
unit_scale=True, desc="Download in progress")
unit_scale=True, desc="Downloading to {path}".format(path=path), dynamic_ncols=True)
with open(path, 'wb') as f:
for data in r.iter_content(block_size):
t.update(len(data))
f.write(data)
t.close()
if total_size != 0 and t.n != total_size:
os.remove(path)
raise ValueError(
"The downloaded size does not match the header total size.")

Expand Down

0 comments on commit d53de7e

Please sign in to comment.