{ "info": { "author": "Willem van Ketwich", "author_email": "willvk@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "[![PyPI version](https://badge.fury.io/py/githubdl.svg)](https://badge.fury.io/py/githubdl) [![Downloads](http://pepy.tech/badge/githubdl)](http://pepy.tech/project/githubdl) [![Run Status](https://api.shippable.com/projects/5b2b5de16104a90700924b85/badge?branch=master)](https://app.shippable.com/github/wilvk/githubdl)\n\n# Github Path Downloader\n\nA tool for downloading individual files/directories from Github or Github Enterprise.\n\nThis circumvents the requirement to clone a complete repository.\n\n# Requirements:\n\n- Python 3.4+\n- A Github or Github Enterprise Account\n\n# Installation:\n\npip:\n\n```bash\n$ pip install githubdl\n```\n\nhttp:\n\n```bash\n$ pip install git+https://github.com/wilvk/githubdl.git\n```\n\nssh:\n\n```bash\n$ pip install git+ssh://git@github.com:wilvk/githubdl.git\n```\n\nfrom clone:\n\n```bash\n$ git clone git@github.com:wilvk/githubdl.git\n$ cd githubdl\n$ pip install -e .\n```\n\n# Usage:\n\n## Obtaining a Github token:\n\nYou will need a token from either Github Enterprise or Github as this package works with the Github v3 API.\n\nTo do this:\n\n- Log into your Github account\n- Click the Avatar Menu in the top-right corner, and select `Settings`\n- On the Settings page, from the menu on the left-hand side, select `Developer Settings`\n- From the Developer Settings page, from the menu, select `Personal access tokens`\n- Click the `Generate new token` button\n- Enter a name for the token. The token should only require the `read:org` permission specified.\n\nThere are also instructions on how to do this [here](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/).\n\n# Usage (from the commandline):\n\nWith your new Github token, export it as the environment variable `GIT_TOKEN`.\n\n## On Unix/Linux:\n\n```bash\n$ export GIT_TOKEN=1234567890123456789012345678901234567890123\n```\n\n## On Windows:\n\n```cmd\nC:\\> set GIT_TOKEN=1234567890123456789012345678901234567890123\n```\n\n## Single file:\n\nThen, for example, to download a file called `README.md` from the repository `http://github.com/wilvk/pbec`:\n\n```bash\n$ githubdl -u \"http://github.com/wilvk/pbec\" -f \"README.md\"\n2018-05-12 07:19:16,934 - root - INFO - Requesting file: README.md at url: https://api.github.com/repos/wilvk/pbec/contents/README.md\n2018-05-12 07:19:18,165 - root - INFO - Writing to file: README.md\n```\n\n## Entire directory:\n\n```bash\n$ githubdl -u \"http://github.com/wilvk/pbec\" -d \"support\"\n2018-05-12 07:19:41,667 - root - INFO - Retrieving a list of files for directory: support\n2018-05-12 07:19:41,668 - root - INFO - Requesting file: support at url: https://api.github.com/repos/wilvk/pbec/contents/support\n2018-05-12 07:19:42,978 - root - INFO - Requesting file: support/Screen Shot 2017-12-10 at 9.27.56 pm.png at url: https://api.github.com/repos/wilvk/pbec/contents/support/Screen Shot 2017-12-10 at 9.27.56 pm.png\n2018-05-12 07:19:46,274 - root - INFO - Writing to file: support/Screen Shot 2017-12-10 at 9.27.56 pm.png\n2018-05-12 07:19:46,286 - root - INFO - Retrieving a list of files for directory: support/docker\n...\n```\n\n## Entire repository:\n\n```bash\n$ githubdl -u \"http://github.com/wilvk/pbec\" -d \"/\" -t \".\"\n\n...\n```\n\nNote: if `-t` is not set, output will go to your `/` directory.\n\n## By commit hash:\n\n## Single file from a specific commit:\n\n```bash\n$ githubdl -u \"http://github.com/wilvk/pbec\" -f \"README.md\" -r \"c29eb5a5d364870a55c0c22f203f8c4e2ce1c638\"\n\n...\n```\n\n## Entire directory from a specific commit:\n\n```bash\n$ githubdl -u \"http://github.com/wilvk/pbec\" -d \"support\" -r \"c29eb5a5d364870a55c0c22f203f8c4e2ce1c638\"\n\n...\n\n```\n## Entire repository from a specific commit:\n\n```bash\n$ githubdl -u \"http://github.com/wilvk/pbec\" -d \"/\" -r \"c29eb5a5d364870a55c0c22f203f8c4e2ce1c638\" -t \".\"\n\n...\n```\n\nNote: if `-t` is not set, output will go to your `/` directory.\n\n## Entire repository from a specific commit, with submodules (as specified in .gitmodules):\n\n```bash\n$ githubdl -u \"http://github.com/wilvk/pbec\" -d \"/\" -r \"c29eb5a5d364870a55c0c22f203f8c4e2ce1c638\" -t \".\" -s\n\n...\n```\n\n# List all tags for a repository in JSON:\n\n```bash\n$ githubdl -u \"http://github.com/wilvk/pbec\" -a\n```\n\n# List all branches for a repository in JSON:\n\n```bash\n$ githubdl -u \"http://github.com/wilvk/pbec\" -b\n```\n\n## Options:\n\nCurrent options are:\n\n```bash\n$ githubdl --help or -h\n --file -f\n --dir -d\n --url (required) -u\n --target -t\n --git_token -g\n --log_level -l\n --reference -r\n --tags -a\n --branches -b\n --submodules -s\n```\n\n## Logging:\n\nValid log levels are: `DEBUG`, `INFO`, `WARN`, `ERROR`, `CRITICAL`\n\n## References:\n\nReferences can be applied to file and directory download only and consist of valid:\n\n - repository tags\n - commit SHAs\n - branch names.\n\n# Usage (as a package):\n\n## Loading the package (in a REPL):\n\n```\n$ python\nPython 3.4.8 (default, Feb 7 2018, 02:31:08)\n[GCC 5.3.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import githubdl\n```\n\n## Downloading a directory:\n\n### Passing in a token:\n\n```python3\n>>> githubdl.dl_dir(\"https://github.com/wilvk/pbec\", \"support\", github_token=\"1234567890123456789012345678901234567890123\")\n```\n\n### Token as an environment variable:\n\nIn bash:\n\n```bash\n$ export GIT_TOKEN=1234567890123456789012345678901234567890123\n```\n\nIn Python:\n\n```python3\n>>> githubdl.dl_dir(\"https://github.com/wilvk/pbec\", \"support\")\n```\n\n### Saving to a different path:\n\n```python3\n>>> githubdl.dl_dir(\"https://github.com/wilvk/pbec\", \"support\", \"support_new\")\n```\n\n### Saving to a different path with submodules:\n\n```python3\n>>> githubdl.dl_dir(\"https://github.com/wilvk/pbec\", \"support\", \"support_new\", submodules=True)\n```\n\n## Downloading a file:\n\n### Passing in a token:\n\n```python3\n>>> githubdl.dl_file(\"https://github.com/wilvk/pbec\", \"README.md\", github_token=\"1234567890123456789012345678901234567890123\")\n```\n\n### Token as an environment variable:\n\nIn bash:\n\n```bash\n$ export GIT_TOKEN=1234567890123456789012345678901234567890123\n```\n\nIn Python:\n\n```python3\n>>> githubdl.dl_file(\"https://github.com/wilvk/pbec\", \"README.md\")\n```\n\n### Saving with a different filename:\n\n```python3\n>>> githubdl.dl_file(\"https://github.com/wilvk/pbec\", \"README.md\", \"NEW_README.md\")\n```\n\n# Extended options:\n\n## File download options:\n\nOnly `repo_url` and `file_name` are required.\n\n```python3\n def dl_file(repo_url, file_name, target_filename='', github_token='', log_level='', reference=''):\n```\n\n## Directory download options:\n\nOnly `repo_url` and `base_path` are required.\n\n```python3\n def dl_dir(repo_url, base_path, target_path='', github_token='', log_level='', reference='', submodules=''):\n```\n\n## Tags download options:\n\nOnly `repo_url` is required.\n\n```python3\n def dl_tags(repo_url, github_token='', log_level=''):\n```\n\n## Branches download options:\n\nOnly `repo_url` is required.\n\n```python3\n def dl_branches(repo_url, github_token='', log_level=''):\n```\n\n### A note on logging:\n\nLog level is passed in as `logging` variable. e.g.\n\n```python3\n>>> import logging\n>>> import githubdl\n>>> githubdl.dl_file(\"http://github.com/wilvk/pbec\", \"README.md\", log_level=logging.DEBUG)\n```\n\n# Tests:\n\n```bash\n$ auto/run-tests\n```\n\nNote: You will have to have a Github token exported as `GIT_TOKEN` to run the tests.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/wilvk/githubdl/archive/0.1.5.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://githubdl.seso.io", "keywords": "github,github enterprise,download,file,path,git,version control,deployment,submodules,modules", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "githubdl", "package_url": "https://pypi.org/project/githubdl/", "platform": "", "project_url": "https://pypi.org/project/githubdl/", "project_urls": { "Download": "https://github.com/wilvk/githubdl/archive/0.1.5.tar.gz", "Homepage": "http://githubdl.seso.io" }, "release_url": "https://pypi.org/project/githubdl/0.1.5/", "requires_dist": [ "requests", "nose; extra == 'test'" ], "requires_python": ">=3.4", "summary": "A tool for downloading individual files/directories from Github or Github Enterprise. This circumvents the requirement to clone an entire repository.", "version": "0.1.5" }, "last_serial": 5196511, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "0d855b5d850b3b141cefb46a5cd951a7", "sha256": "8bb13464a6fd7a0554c00960a68b9985588a8544ae9985e08b0225987123b5c6" }, "downloads": -1, "filename": "githubdl-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "0d855b5d850b3b141cefb46a5cd951a7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 8745, "upload_time": "2018-06-19T09:55:18", "url": "https://files.pythonhosted.org/packages/3c/c7/cbf59f158888fdd1852585e2f788f88b2a2c52b3ee986d14710180b6d2ea/githubdl-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "96325def77c36303c68f0a9092e68bfa", "sha256": "d17189092793c0c0610249efb2e392d2c2597abaccbe8d2b1798eab573118a88" }, "downloads": -1, "filename": "githubdl-0.1.2.tar.gz", "has_sig": false, "md5_digest": "96325def77c36303c68f0a9092e68bfa", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 7501, "upload_time": "2018-06-19T09:55:20", "url": "https://files.pythonhosted.org/packages/9f/e7/325231a7dc6c551970e90f3e934f1d06a85ff977e7e3215ae71e437930b5/githubdl-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "2460ad42123afdbe944ebba23d00c241", "sha256": "7e41b6faebe1b4e2ff671d2cd7fc209aaefc158cfcde72241fb89cb772544995" }, "downloads": -1, "filename": "githubdl-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "2460ad42123afdbe944ebba23d00c241", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 9133, "upload_time": "2018-06-24T11:34:33", "url": "https://files.pythonhosted.org/packages/39/a2/5f119f772e32e0e371697224b08887b04df023c653deeea0126a0356d06d/githubdl-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d285f37a309402eac9328c39950707a8", "sha256": "d2e87b7a3f735d5742a5af97bdcc3c55c0155b0134460a0380ecb023d037412b" }, "downloads": -1, "filename": "githubdl-0.1.3.tar.gz", "has_sig": false, "md5_digest": "d285f37a309402eac9328c39950707a8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 9041, "upload_time": "2018-06-24T11:34:34", "url": "https://files.pythonhosted.org/packages/58/0c/bd80e0939c8a17effed6be34ddda81841879fb5691afa252d014691f2576/githubdl-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "12ac3f74b3973f61ffe918674a88ea9e", "sha256": "824ff069ea21dd9369a1f79fa8a1899e8e40b57badd3c4ab1612a008ab751301" }, "downloads": -1, "filename": "githubdl-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "12ac3f74b3973f61ffe918674a88ea9e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 9359, "upload_time": "2018-11-25T05:18:17", "url": "https://files.pythonhosted.org/packages/f3/0b/b6d35d451812960e1d9732081d0900804bb03f83f3eaf0627546b269a843/githubdl-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "accac460b93e0f23a263ba2bd22ece20", "sha256": "1b6ec32205680c38d06b741a21833eadac43aabb299708c1e5b9de674ef13824" }, "downloads": -1, "filename": "githubdl-0.1.4.tar.gz", "has_sig": false, "md5_digest": "accac460b93e0f23a263ba2bd22ece20", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 9653, "upload_time": "2018-11-25T05:18:19", "url": "https://files.pythonhosted.org/packages/08/60/f6a4ad6968838778ea5356d2bb673d19e302c5aa73ee94eb64532985b48f/githubdl-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "6218df18752c1c57c7f833e4659b0f78", "sha256": "eaaed43f437f42f67cf2dc0f1ca3fd9167222d105c307fb93d9452ffc6ce40c0" }, "downloads": -1, "filename": "githubdl-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "6218df18752c1c57c7f833e4659b0f78", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 9809, "upload_time": "2019-04-27T11:47:10", "url": "https://files.pythonhosted.org/packages/82/7f/f5a4391dd2cf39a1505763f7575eb2c88ca18e67ec25dc763fd329074252/githubdl-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f977543fffab53b8a7cd3f3e4af51771", "sha256": "ca3355dd8a682b073b1f1f8325f73bb53e4f66da846b51290bd17dcd18644f68" }, "downloads": -1, "filename": "githubdl-0.1.5.tar.gz", "has_sig": false, "md5_digest": "f977543fffab53b8a7cd3f3e4af51771", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 10062, "upload_time": "2019-04-27T11:47:13", "url": "https://files.pythonhosted.org/packages/13/5e/73143d0724d023552919828eb80dd68e420edcd950c0d42aa1f4e772d254/githubdl-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6218df18752c1c57c7f833e4659b0f78", "sha256": "eaaed43f437f42f67cf2dc0f1ca3fd9167222d105c307fb93d9452ffc6ce40c0" }, "downloads": -1, "filename": "githubdl-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "6218df18752c1c57c7f833e4659b0f78", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 9809, "upload_time": "2019-04-27T11:47:10", "url": "https://files.pythonhosted.org/packages/82/7f/f5a4391dd2cf39a1505763f7575eb2c88ca18e67ec25dc763fd329074252/githubdl-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f977543fffab53b8a7cd3f3e4af51771", "sha256": "ca3355dd8a682b073b1f1f8325f73bb53e4f66da846b51290bd17dcd18644f68" }, "downloads": -1, "filename": "githubdl-0.1.5.tar.gz", "has_sig": false, "md5_digest": "f977543fffab53b8a7cd3f3e4af51771", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 10062, "upload_time": "2019-04-27T11:47:13", "url": "https://files.pythonhosted.org/packages/13/5e/73143d0724d023552919828eb80dd68e420edcd950c0d42aa1f4e772d254/githubdl-0.1.5.tar.gz" } ] }