py3-wget


Namepy3-wget JSON
Version 1.0.13 PyPI version JSON
download
home_pageNone
SummaryA tool to download files. It supports progress bar, cksum, timeout, retry failed download.
upload_time2025-07-26 19:47:54
maintainerNone
docs_urlNone
authorGabriele Berton
requires_python>=3.0
licenseMIT License Copyright (c) 2024 Gabriele Berton Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords download wget http https progress-bar file-transfer retry checksum
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # py3-wget

A Python library for downloading files of any size, especially optimized for large file downloads, with support for progress bars, checksum verification, timeout handling, and automatic retry on failed downloads.

## Features

- 🚀 Optimized for large file downloads
- 📊 Progress bar visualization (optional)
- 🔄 Automatic retry on failed downloads
- 🔍 Optional integrity checks (cksum, MD5, SHA256)
- ⏱️ Configurable timeout and retry settings
- 🛡️ Safe file handling, optional overwrite
- 📦 Simple and intuitive API
- 💻 Cross-platform compatibility (works on any OS)

## Installation

```bash
pip install py3-wget
```

## Quick Start

### Basic Download
```python
from py3_wget import download_file

# Simple download with progress bar
download_file("https://raw.githubusercontent.com/python/cpython/3.11/LICENSE")
```

![Basic Download Demo](assets/e1.gif)

### Advanced Usage

#### Retry on Failure
The library automatically retries failed downloads with exponential backoff:
```python
download_file(
    "https://raw.githubusercontent.com/python/cpython/3.11/LICENSE",
    max_tries=5,  # Maximum number of retry attempts
    retry_seconds=2  # Initial retry delay in seconds
)
```

#### Checksum Verification
Verify downloaded files using checksums:
```python
download_file(
    "https://raw.githubusercontent.com/python/cpython/3.11/LICENSE",
    md5="fcf6b249c2641540219a727f35d8d2c2",  # MD5 checksum
    sha256="3aff1954277c4fc27603346901e4848b58fe3c8bed63affe6086003dd6c2b9fe"  # SHA256 checksum
)
```

![Checksum Verification Demo](assets/e4.gif)

#### File Overwrite Control
```python
download_file(
    "https://raw.githubusercontent.com/python/cpython/3.11/LICENSE",
    output_path="downloads/test.bin",
    overwrite=True  # Overwrite existing file
)
```

![Overwrite Demo](assets/e3.gif)

## API Reference

### `download_file`

```python
download_file(
    url: str,
    output_path: Optional[Union[str, Path]] = None,
    overwrite: bool = False,
    verbose: bool = True,
    cksum: Optional[int] = None,
    md5: Optional[str] = None,
    sha256: Optional[str] = None,
    max_tries: int = 5,
    block_size_bytes: int = 8192,
    retry_seconds: Union[int, float] = 2,
    timeout_seconds: Union[int, float] = 60,
) -> None
```

#### Parameters

- `url` (str): URL of the file to download
- `output_path` (str or Path, optional): Path to save the file. If None, derived from URL
- `overwrite` (bool): Overwrite existing file (default: False)
- `verbose` (bool): Show progress bar and messages (default: True)
- `cksum` (int, optional): Expected checksum value
- `md5` (str, optional): Expected MD5 hash
- `sha256` (str, optional): Expected SHA256 hash
- `max_tries` (int): Maximum retry attempts (default: 5)
- `block_size_bytes` (int): Download block size in bytes (default: 8192)
- `retry_seconds` (int/float): Initial retry delay in seconds (default: 2)
- `timeout_seconds` (int/float): Download timeout in seconds (default: 60)

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "py3-wget",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.0",
    "maintainer_email": null,
    "keywords": "download, wget, http, https, progress-bar, file-transfer, retry, checksum",
    "author": "Gabriele Berton",
    "author_email": "Gabriele Berton <bertongabri@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/eb/b1/33b716985b9e691737e9697849bbbb265df96bef2f247cafb95207cdb84c/py3_wget-1.0.13.tar.gz",
    "platform": null,
    "description": "# py3-wget\n\nA Python library for downloading files of any size, especially optimized for large file downloads, with support for progress bars, checksum verification, timeout handling, and automatic retry on failed downloads.\n\n## Features\n\n- \ud83d\ude80 Optimized for large file downloads\n- \ud83d\udcca Progress bar visualization (optional)\n- \ud83d\udd04 Automatic retry on failed downloads\n- \ud83d\udd0d Optional integrity checks (cksum, MD5, SHA256)\n- \u23f1\ufe0f Configurable timeout and retry settings\n- \ud83d\udee1\ufe0f Safe file handling, optional overwrite\n- \ud83d\udce6 Simple and intuitive API\n- \ud83d\udcbb Cross-platform compatibility (works on any OS)\n\n## Installation\n\n```bash\npip install py3-wget\n```\n\n## Quick Start\n\n### Basic Download\n```python\nfrom py3_wget import download_file\n\n# Simple download with progress bar\ndownload_file(\"https://raw.githubusercontent.com/python/cpython/3.11/LICENSE\")\n```\n\n![Basic Download Demo](assets/e1.gif)\n\n### Advanced Usage\n\n#### Retry on Failure\nThe library automatically retries failed downloads with exponential backoff:\n```python\ndownload_file(\n    \"https://raw.githubusercontent.com/python/cpython/3.11/LICENSE\",\n    max_tries=5,  # Maximum number of retry attempts\n    retry_seconds=2  # Initial retry delay in seconds\n)\n```\n\n#### Checksum Verification\nVerify downloaded files using checksums:\n```python\ndownload_file(\n    \"https://raw.githubusercontent.com/python/cpython/3.11/LICENSE\",\n    md5=\"fcf6b249c2641540219a727f35d8d2c2\",  # MD5 checksum\n    sha256=\"3aff1954277c4fc27603346901e4848b58fe3c8bed63affe6086003dd6c2b9fe\"  # SHA256 checksum\n)\n```\n\n![Checksum Verification Demo](assets/e4.gif)\n\n#### File Overwrite Control\n```python\ndownload_file(\n    \"https://raw.githubusercontent.com/python/cpython/3.11/LICENSE\",\n    output_path=\"downloads/test.bin\",\n    overwrite=True  # Overwrite existing file\n)\n```\n\n![Overwrite Demo](assets/e3.gif)\n\n## API Reference\n\n### `download_file`\n\n```python\ndownload_file(\n    url: str,\n    output_path: Optional[Union[str, Path]] = None,\n    overwrite: bool = False,\n    verbose: bool = True,\n    cksum: Optional[int] = None,\n    md5: Optional[str] = None,\n    sha256: Optional[str] = None,\n    max_tries: int = 5,\n    block_size_bytes: int = 8192,\n    retry_seconds: Union[int, float] = 2,\n    timeout_seconds: Union[int, float] = 60,\n) -> None\n```\n\n#### Parameters\n\n- `url` (str): URL of the file to download\n- `output_path` (str or Path, optional): Path to save the file. If None, derived from URL\n- `overwrite` (bool): Overwrite existing file (default: False)\n- `verbose` (bool): Show progress bar and messages (default: True)\n- `cksum` (int, optional): Expected checksum value\n- `md5` (str, optional): Expected MD5 hash\n- `sha256` (str, optional): Expected SHA256 hash\n- `max_tries` (int): Maximum retry attempts (default: 5)\n- `block_size_bytes` (int): Download block size in bytes (default: 8192)\n- `retry_seconds` (int/float): Initial retry delay in seconds (default: 2)\n- `timeout_seconds` (int/float): Download timeout in seconds (default: 60)\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024 Gabriele Berton\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "A tool to download files. It supports progress bar, cksum, timeout, retry failed download.",
    "version": "1.0.13",
    "project_urls": {
        "Repository": "https://github.com/gmberton/py3-wget"
    },
    "split_keywords": [
        "download",
        " wget",
        " http",
        " https",
        " progress-bar",
        " file-transfer",
        " retry",
        " checksum"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4722bd577aa6743cd14a8fedd0cea0f3847ba9526a14119425b273b02a77fd5c",
                "md5": "1c07aa389a15f249eac01b667de368cd",
                "sha256": "9393efef98d5ec3a5c8e1518b415f70c299f820d54121cf56955006f09a5db83"
            },
            "downloads": -1,
            "filename": "py3_wget-1.0.13-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1c07aa389a15f249eac01b667de368cd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.0",
            "size": 11600,
            "upload_time": "2025-07-26T19:47:53",
            "upload_time_iso_8601": "2025-07-26T19:47:53.642925Z",
            "url": "https://files.pythonhosted.org/packages/47/22/bd577aa6743cd14a8fedd0cea0f3847ba9526a14119425b273b02a77fd5c/py3_wget-1.0.13-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ebb133b716985b9e691737e9697849bbbb265df96bef2f247cafb95207cdb84c",
                "md5": "6329914adf365e0ccdf39798c34933d5",
                "sha256": "036e19e6dd5a766ca15c5400a6d2150227dd2a0090852e99ac58cb27977bd833"
            },
            "downloads": -1,
            "filename": "py3_wget-1.0.13.tar.gz",
            "has_sig": false,
            "md5_digest": "6329914adf365e0ccdf39798c34933d5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.0",
            "size": 13028,
            "upload_time": "2025-07-26T19:47:54",
            "upload_time_iso_8601": "2025-07-26T19:47:54.452546Z",
            "url": "https://files.pythonhosted.org/packages/eb/b1/33b716985b9e691737e9697849bbbb265df96bef2f247cafb95207cdb84c/py3_wget-1.0.13.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-26 19:47:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gmberton",
    "github_project": "py3-wget",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "py3-wget"
}
        
Elapsed time: 1.06280s