Metadata-Version: 2.4
Name: file-downloader-easy
Version: 0.0.2
Summary: File downloader, but made easy
License-File: LICENSE
Author: danialcala94
Author-email: danielalcalavalera@gmail.com
Requires-Python: >=3.8,<3.14
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: file_easy (>=0.0.1,<1.0.0)
Requires-Dist: httpx_easy (>=0.0.1,<1.0.0)
Project-URL: Homepage, https://github.com/Implosiv3/file-downloader-easy
Project-URL: Issues, https://github.com/Implosiv3/file-downloader-easy/issues
Description-Content-Type: text/markdown

# 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'
```

2. 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)
```
