{ "info": { "author": "Andreas Strikos", "author_email": "andreas@wetransfer.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# WeTransfer Python SDK\nA Python SDK for the WeTransfer's Public API\n## Installation\nUse PYPI to install latest stable version:\n```\npip install wetransfer\n```\n\nCheckout the repository and inside the repo's root directory use pip to install latest version to your environment with:\n```\npip install .\n```\n\n## Usage\n**Before starting make sure you have an API key acquired from [Developers Portal](https://developers.wetransfer.com/).**\n\nAs a first step you need to create a client and fill in your board name:\n```python\nfrom wetransfer.client import WTApiClient\n\nkwargs = {\"key\": \"\"}\nwt_client = WTApiClient(**kwargs)\n```\n\nAfter you have the client instance you need to authorize using this client:\n```python\nwt_client.authorize()\n```\n\nIf authorization is successful you should be able to create an new empty transfer\n```python\ntransfer = wt_client.create_transfer(transfer_name=\"My very first Transfer\")\n```\n\nAfterwards you should be able to add items to it\n\n```python\nfrom wetransfer.items import File\n\nf1 = File(\"~/test.txt\")\nf2 = File(\"~/test2.txt\")\ntransfer.add_items([f1, f2])\n\nprint(transfer)\n\n```\n\nAfter calling `add_items` method the upload process should start. As soon as it returns you should be\nable to see details for this transfer and access the url that your transfer is available for download.\n\nThe full code snippet is as follows:\n```python\nimport sys\nfrom wetransfer.items import File, Link\nfrom wetransfer.client import WTApiClient\n\nkwargs = {\"key\": \"\"}\nwt_client = WTApiClient(**kwargs)\n\nif not wt_client.authorize():\n sys.exit(0)\n\ntransfer = wt_client.create_transfer(transfer_name=\"My very first Transfer\")\n\nf1 = File(\"./test.txt\")\nl1 = Link(\"https://wetransfer.com/\", \"WeTransfer Website\")\n\ntransfer.add_items([f1, l1])\n\nprint(transfer)\n```\n\nwhich if you run it you should see something like:\n```\nTransfer with id: , can be found in short url: , with following items: ['Transfer item, file type, with size 10, name test.txt, and local path /Users/bla/test.txt, has 1 multi parts']\n```\n\n### Helper methods\nIf you need to upload only file you can skip the `File` objects creation and use a helper function that allows you to specify a list of paths as strings and will add these for you a given `Transfer`\n```python\ntransfer.add_files([\"file1.txt\", \"file2.txt\"])\n```\n\nSimilar method exist for URLs:\n```python\ntransfer.add_links([\"https://wetransfer.com/\", \"http://www.visitgreece.gr/\"])\n```\n\n## Debugging\nIf you need to debug or investigate weird behaviours you can enable logs for this SDK by enabling the dedicated python logger\n```python\nimport logging\n\nlogging.basicConfig()\nlogging.getLogger(\"wetransfer-python-sdk\").setLevel(logging.DEBUG)\n\nkwargs = {\"key\": \"\"}\nwt = WTApiClient(**kwargs)\n...\n``` \n\nYou can set the severity level accordingly depending on the verbosity you desire.\n\n## Contributing\nSee [dedicated](./CONTRIBUTING.md) section.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/astrikos/wetransfer-python-sdk", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/astrikos/wetransfer-python-sdk", "keywords": "", "license": "", "maintainer": "Andreas Strikos", "maintainer_email": "andreas@wetransfer.com", "name": "wetransfer", "package_url": "https://pypi.org/project/wetransfer/", "platform": "", "project_url": "https://pypi.org/project/wetransfer/", "project_urls": { "Download": "https://github.com/astrikos/wetransfer-python-sdk", "Homepage": "https://github.com/astrikos/wetransfer-python-sdk" }, "release_url": "https://pypi.org/project/wetransfer/0.2.0/", "requires_dist": [ "requests (>=2.7.0)", "six" ], "requires_python": "", "summary": "A Python SDK for WeTransfer's Public API", "version": "0.2.0" }, "last_serial": 4684981, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "759b8ea43e9ff88ab8355d1610b96450", "sha256": "5b32230e0889ddae5fd80ffe50e2c0e4a90cdcd516308cd1f1072bc72a4a6fbf" }, "downloads": -1, "filename": "wetransfer-0.0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "759b8ea43e9ff88ab8355d1610b96450", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 21209, "upload_time": "2018-09-07T12:37:35", "url": "https://files.pythonhosted.org/packages/90/ee/57a1d5e62aa18747d4fbd60f341ff73e82e472ca280b4664dec0f03ce374/wetransfer-0.0.1-py2.py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "5db7b155d25884864526e52789e2d4cc", "sha256": "751d27f7f1b2312bb3d86e2206797ddfe99295f9687331a6de7ec1ca7d0de35f" }, "downloads": -1, "filename": "wetransfer-0.2.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "5db7b155d25884864526e52789e2d4cc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 21553, "upload_time": "2019-01-11T11:05:59", "url": "https://files.pythonhosted.org/packages/1b/92/6b4c63a4136a8b48b8221d1b3ae6d60ac82ddd6485907aac78d0620a45ef/wetransfer-0.2.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5db7b155d25884864526e52789e2d4cc", "sha256": "751d27f7f1b2312bb3d86e2206797ddfe99295f9687331a6de7ec1ca7d0de35f" }, "downloads": -1, "filename": "wetransfer-0.2.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "5db7b155d25884864526e52789e2d4cc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 21553, "upload_time": "2019-01-11T11:05:59", "url": "https://files.pythonhosted.org/packages/1b/92/6b4c63a4136a8b48b8221d1b3ae6d60ac82ddd6485907aac78d0620a45ef/wetransfer-0.2.0-py2.py3-none-any.whl" } ] }