Skip to main content

File downloader, but made easy

The easiest way to download files from the Internet.

Functionality

Simplify the way you download files but also improve the amount of information we receive from the file that has been downloaded, as a FileResource instance.

Usage

Here you have some examples:

  1. Download an audio by giving the wrong file extension:
from file_downloader_easy import FileDownloader

# Create the context so its freed when done
async with FileDownloader(
    do_follow_redirects = True
) as file_downloader:
    # Download the audio file
    audio_downloaded = await file_downloader.download_file(
        url = 'https://download.samplelib.com/mp3/sample-3s.mp3',
        # Wrong file extension
        output_filename = 'test_files/test_audio.wav'
    )
    # The right extension has been preserved
    assert audio_downloaded.filename == 'test_files/test_audio.mp3'
  1. Handle the content of a file that is streamed:
from file_downloader_easy import FileDownloader

# Create the context so its freed when done
async with FileDownloader(
    do_follow_redirects = True
) as file_downloader:
    # Open file to write
    with open(VIDEO_FILENAME, 'wb') as f:
        async for chunk in file_downloader.stream_file('https://download.samplelib.com/mp4/sample-5s.mp4'):
            # Do whatever you need
            f.write(chunk)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

file_downloader_easy-0.0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

file_downloader_easy-0.0.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file file_downloader_easy-0.0.2.tar.gz.

File metadata

  • Download URL: file_downloader_easy-0.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.9.0 Windows/10

File hashes

Hashes for file_downloader_easy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e2ef737da02a221c65840afa2412c8d278621d3a00a19f39b8991c72c4f80327
MD5 2f52c4f580aa186322d38a7d4b09adf6
BLAKE2b-256 e14c782d0ecb7658fdfbe0c563d258fba9a57ba113eb84b1b27bd135fe0a5f17

See more details on using hashes here.

File details

Details for the file file_downloader_easy-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for file_downloader_easy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c02f75c428f1a5d9fd168f2e6950f4bd8b953978f21531a7fd3f61ba59eee26
MD5 a2f44135f71d4b9b46994c8ebc368afd
BLAKE2b-256 282a3d9dc3d01e23fcb75108b62d983e424ade55da7089fafcfeb9c932e30d04

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page