# GitHub Content Downloader
A powerful command-line tool to download files and folders from GitHub repositories. Download any file or entire directory from GitHub repositories without cloning - perfect for selectively downloading specific content.
## Features
- Download single files from GitHub repositories
- Download entire folders recursively
- Download complete repositories
- Simple command-line interface (`ghcd`)
- Support for both file URLs (blob) and folder URLs (tree)
- Customizable download location
- No authentication required for public repositories
## Installation
### Option 1: Install from PyPI
```bash
pip install github-content-downloader
```
### Option 2: Install from source
```bash
# Clone the repository
git clone https://github.com/soykot2910/github-content-downloader.git
# Navigate to the project directory
cd github-content-downloader
# Install the package
pip install .
```
## Usage
### Command Line Interface
1. Download a complete repository:
```bash
ghcd https://github.com/username/repository
```
Example:
```bash
ghcd https://github.com/tensorflow/tensorflow
```
2. Download a specific folder:
```bash
ghcd https://github.com/username/repository/tree/branch/folder
```
Example:
```bash
ghcd https://github.com/tensorflow/tensorflow/tree/master/tensorflow/python
```
3. Download a single file:
```bash
ghcd https://github.com/username/repository/blob/branch/path/to/file
```
Example:
```bash
ghcd https://github.com/tensorflow/tensorflow/blob/master/README.md
```
4. Specify custom output directory:
```bash
ghcd -o ./my-downloads <github-url>
```
5. Interactive mode (if no URL provided):
```bash
ghcd
```
### Command Line Options
```bash
ghcd --help
```
Available options:
- `-o, --output`: Specify output directory (default: ./downloaded_files)
- `-h, --help`: Show help message
### Python Package Usage
You can also use it as a Python package in your code:
```python
from github_downloader import download_from_github
# Download complete repository
download_from_github("https://github.com/username/repository")
# Download specific folder
download_from_github(
"https://github.com/username/repository/tree/master/docs",
dest_folder="./my-downloads"
)
# Download single file
download_from_github(
"https://github.com/username/repository/blob/master/README.md"
)
```
## URL Format Examples
### 1. Complete Repository
```
https://github.com/username/repository
```
Downloads the entire repository from the default branch (usually 'master' or 'main').
### 2. Specific Folder
```
https://github.com/username/repository/tree/branch/path/to/folder
```
Downloads only the specified folder and its contents.
### 3. Single File
```
https://github.com/username/repository/blob/branch/path/to/file
```
Downloads only the specified file.
## Common Issues and Solutions
1. **Permission Error**: If you get a permission error while downloading, make sure you have write permissions in the output directory.
2. **Invalid URL Format**: Make sure your GitHub URL follows one of these patterns:
- Repository: `https://github.com/username/repo`
- Folder: `https://github.com/username/repo/tree/branch/path`
- File: `https://github.com/username/repo/blob/branch/path`
3. **Download Failed**: If downloads fail, check:
- Your internet connection
- The repository is public and accessible
- The URL is correct and the resource exists
## Requirements
- Python 3.6 or higher
- `requests` library (automatically installed with the package)
## Development
Want to contribute? Great! Here's how:
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Install development dependencies:
```bash
pip install -e .
```
4. Make your changes
5. Commit your changes (`git commit -m 'Add some amazing feature'`)
6. Push to the branch (`git push origin feature/amazing-feature`)
7. Open a Pull Request
## License
This project is licensed under the MIT License - see the LICENSE file for details.
## Author
- Md.Soykot
- Email: md.soykot2910@gmail.com
- GitHub: [@soykot2910](https://github.com/soykot2910)
## Support
If you encounter any issues or have questions, please:
1. Check the [Common Issues](#common-issues-and-solutions) section
2. Open an issue on GitHub
3. Contact the author via email
## Acknowledgments
- Thanks to GitHub for providing their API
- Inspired by the need to download specific parts of repositories without cloning
Raw data
{
"_id": null,
"home_page": "https://github.com/soykot2910/github-content-downloader",
"name": "github-content-downloader",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Md.Soykot",
"author_email": "md.soykot2910@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8c/cd/8301eadbfd912f715c6ed07538c4cd6609227a1702edf93f70d050c7b5b4/github_content_downloader-0.1.3.tar.gz",
"platform": null,
"description": "# GitHub Content Downloader\n\nA powerful command-line tool to download files and folders from GitHub repositories. Download any file or entire directory from GitHub repositories without cloning - perfect for selectively downloading specific content.\n\n## Features\n\n- Download single files from GitHub repositories\n- Download entire folders recursively\n- Download complete repositories\n- Simple command-line interface (`ghcd`)\n- Support for both file URLs (blob) and folder URLs (tree)\n- Customizable download location\n- No authentication required for public repositories\n\n## Installation\n\n### Option 1: Install from PyPI\n\n```bash\npip install github-content-downloader\n```\n\n### Option 2: Install from source\n\n```bash\n# Clone the repository\ngit clone https://github.com/soykot2910/github-content-downloader.git\n\n# Navigate to the project directory\ncd github-content-downloader\n\n# Install the package\npip install .\n```\n\n## Usage\n\n### Command Line Interface\n\n1. Download a complete repository:\n```bash\nghcd https://github.com/username/repository\n```\nExample:\n```bash\nghcd https://github.com/tensorflow/tensorflow\n```\n\n2. Download a specific folder:\n```bash\nghcd https://github.com/username/repository/tree/branch/folder\n```\nExample:\n```bash\nghcd https://github.com/tensorflow/tensorflow/tree/master/tensorflow/python\n```\n\n3. Download a single file:\n```bash\nghcd https://github.com/username/repository/blob/branch/path/to/file\n```\nExample:\n```bash\nghcd https://github.com/tensorflow/tensorflow/blob/master/README.md\n```\n\n4. Specify custom output directory:\n```bash\nghcd -o ./my-downloads <github-url>\n```\n\n5. Interactive mode (if no URL provided):\n```bash\nghcd\n```\n\n### Command Line Options\n\n```bash\nghcd --help\n```\n\nAvailable options:\n- `-o, --output`: Specify output directory (default: ./downloaded_files)\n- `-h, --help`: Show help message\n\n### Python Package Usage\n\nYou can also use it as a Python package in your code:\n\n```python\nfrom github_downloader import download_from_github\n\n# Download complete repository\ndownload_from_github(\"https://github.com/username/repository\")\n\n# Download specific folder\ndownload_from_github(\n \"https://github.com/username/repository/tree/master/docs\",\n dest_folder=\"./my-downloads\"\n)\n\n# Download single file\ndownload_from_github(\n \"https://github.com/username/repository/blob/master/README.md\"\n)\n```\n\n## URL Format Examples\n\n### 1. Complete Repository\n```\nhttps://github.com/username/repository\n```\nDownloads the entire repository from the default branch (usually 'master' or 'main').\n\n### 2. Specific Folder\n```\nhttps://github.com/username/repository/tree/branch/path/to/folder\n```\nDownloads only the specified folder and its contents.\n\n### 3. Single File\n```\nhttps://github.com/username/repository/blob/branch/path/to/file\n```\nDownloads only the specified file.\n\n## Common Issues and Solutions\n\n1. **Permission Error**: If you get a permission error while downloading, make sure you have write permissions in the output directory.\n\n2. **Invalid URL Format**: Make sure your GitHub URL follows one of these patterns:\n - Repository: `https://github.com/username/repo`\n - Folder: `https://github.com/username/repo/tree/branch/path`\n - File: `https://github.com/username/repo/blob/branch/path`\n\n3. **Download Failed**: If downloads fail, check:\n - Your internet connection\n - The repository is public and accessible\n - The URL is correct and the resource exists\n\n## Requirements\n\n- Python 3.6 or higher\n- `requests` library (automatically installed with the package)\n\n## Development\n\nWant to contribute? Great! Here's how:\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Install development dependencies:\n```bash\npip install -e .\n```\n4. Make your changes\n5. Commit your changes (`git commit -m 'Add some amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Author\n\n- Md.Soykot\n- Email: md.soykot2910@gmail.com\n- GitHub: [@soykot2910](https://github.com/soykot2910)\n\n## Support\n\nIf you encounter any issues or have questions, please:\n1. Check the [Common Issues](#common-issues-and-solutions) section\n2. Open an issue on GitHub\n3. Contact the author via email\n\n## Acknowledgments\n\n- Thanks to GitHub for providing their API\n- Inspired by the need to download specific parts of repositories without cloning\n",
"bugtrack_url": null,
"license": null,
"summary": "Download any file or folder from GitHub repositories without cloning",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://github.com/soykot2910/github-content-downloader"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b48f10c1c23a5049981fb9cc3c6167cee5a70e2cf07e7f3bd4996a11cd871be9",
"md5": "1a2c4327d598cb796cad484d8885c461",
"sha256": "39dbdf2d10bc0adc7f74c8e7eafd2ed64dc036b9fcac78ff2d9f1789f3a9c7fb"
},
"downloads": -1,
"filename": "github_content_downloader-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1a2c4327d598cb796cad484d8885c461",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 5577,
"upload_time": "2024-11-29T09:15:51",
"upload_time_iso_8601": "2024-11-29T09:15:51.739435Z",
"url": "https://files.pythonhosted.org/packages/b4/8f/10c1c23a5049981fb9cc3c6167cee5a70e2cf07e7f3bd4996a11cd871be9/github_content_downloader-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8ccd8301eadbfd912f715c6ed07538c4cd6609227a1702edf93f70d050c7b5b4",
"md5": "990af5f793513c88ad58d8b9487e3ee5",
"sha256": "d8db3d5684ae69bb356a9c0d2fcb365d4e0101f301c2eeed69ad9f61663d6f8b"
},
"downloads": -1,
"filename": "github_content_downloader-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "990af5f793513c88ad58d8b9487e3ee5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4653,
"upload_time": "2024-11-29T09:16:08",
"upload_time_iso_8601": "2024-11-29T09:16:08.877338Z",
"url": "https://files.pythonhosted.org/packages/8c/cd/8301eadbfd912f715c6ed07538c4cd6609227a1702edf93f70d050c7b5b4/github_content_downloader-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-29 09:16:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "soykot2910",
"github_project": "github-content-downloader",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "requests",
"specs": [
[
">=",
"2.25.0"
]
]
}
],
"lcname": "github-content-downloader"
}