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)

Metadata

Release files for file-downloader-easy 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for file-downloader-easy 0.0.3
File Size Uploaded
file_downloader_easy-0.0.3.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for file-downloader-easy 0.0.3
File Interpreter ABI Platform
file_downloader_easy-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / file_downloader_easy-0.0.3.tar.gz

Download URL file_downloader_easy-0.0.3.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
06f8d11ebc8acf6a04cb286cf293742a7c516843e45be57ddd7d03de4dea211d
BLAKE2b-256 checksum
How to use checksums
bcee8fbe0e2f480d4d3658add67d79b9321252b8f27c8e28816129e3a261cca9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.0 CPython/3.9.0 Windows/10

Release files / file_downloader_easy-0.0.3-py3-none-any.whl

Download URL file_downloader_easy-0.0.3-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2dab0b7b26639fd08de78965824784d0b4c8b686df2bedc09d3585c1c5840e2d
BLAKE2b-256 checksum
How to use checksums
dc542319efa51afd480a5f3dca19a2931e384761963668bfa61c442b97e1b6ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.0 CPython/3.9.0 Windows/10

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page