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:
- 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'
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2ef737da02a221c65840afa2412c8d278621d3a00a19f39b8991c72c4f80327
|
|
| MD5 |
2f52c4f580aa186322d38a7d4b09adf6
|
|
| BLAKE2b-256 |
e14c782d0ecb7658fdfbe0c563d258fba9a57ba113eb84b1b27bd135fe0a5f17
|
File details
Details for the file file_downloader_easy-0.0.2-py3-none-any.whl.
File metadata
- Download URL: file_downloader_easy-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.0 CPython/3.9.0 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c02f75c428f1a5d9fd168f2e6950f4bd8b953978f21531a7fd3f61ba59eee26
|
|
| MD5 |
a2f44135f71d4b9b46994c8ebc368afd
|
|
| BLAKE2b-256 |
282a3d9dc3d01e23fcb75108b62d983e424ade55da7089fafcfeb9c932e30d04
|