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)
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)
| File | Size | Uploaded | |
|---|---|---|---|
| file_downloader_easy-0.0.3.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|