Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
bunny committed Oct 20, 2023
1 parent a8bc40a commit 094c2ba
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
dist/WeTransferTool-0.3.tar.gz
dist/WeTransferTool-0.4.tar.gz
WeTransferTool.egg-info/dependency_links.txt
WeTransferTool.egg-info/PKG-INFO
WeTransferTool.egg-info/requires.txt
WeTransferTool.egg-info/SOURCES.txt
WeTransferTool.egg-info/top_level.txt
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ pip install WeTransferTool
Terminal use:
```
$> wetransfertool -h
usage: wetransfertool [-h] [-dl DL] [-ul UL]
usage: wetransfertool [-h] [-dl DL] [-ul UL] [-mw MW]
options:
-h, --help show this help message and exit
-dl DL Wetransfer file URL
-ul UL File/Folder path
-mw MW Maximum number of workers (parallel uploads)
```

API use:
Expand Down
24 changes: 24 additions & 0 deletions WeTransferTool/main_module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import argparse
from WeTransferTool import We
import json

def main_func():
parser = argparse.ArgumentParser()
wet = We()

parser.add_argument('-dl', help="Wetransfer file URL", type=str)
parser.add_argument('-ul', help="File/Folder path", type=str)
parser.add_argument('-mw', help="Maximum number of workers (parallel downloads)", type=int, default=10)
args = parser.parse_args()
dl = args.dl
ul = args.ul
mw = args.mw
if not dl and not ul:
print("Need atleast one argument. Try wetransfertool -h")
if ul:
print(json.dumps(wet.upload(path=ul, max_workers=mw), indent=4))
if dl:
wet.download(dl)

# if __name__=="__main__":
# main_func()
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
setup(
name = 'WeTransferTool', # How you named your package folder (MyLib)
packages = ['WeTransferTool'], # Chose the same as "name"
version = '0.5', # Start with a small number and increase it with every change you make
version = '0.7', # Start with a small number and increase it with every change you make
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
description = 'WeTransfer unofficial API wrapper written in python facilitating features like uploading and downloading files and folders', # Give a short description about your library
long_description=long_description,
Expand All @@ -17,5 +17,8 @@
keywords = ['api', 'wetransfer', 'wrapper', 'upload', 'download'], # Keywords that define your package best
install_requires=[ # I get to this in a second
'requests',
]
],
entry_points = {
'console_scripts': ['wetransfertool=WeTransferTool.main_module:main_func'],
}
)

0 comments on commit 094c2ba

Please sign in to comment.