Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update export.py #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update export.py #78

wants to merge 2 commits into from

Conversation

puddleoasis
Copy link

Modifying fieldnames to become a parameter.

changing `fieldnames` to save as an parameter.
Overhaul of this file. Since this repo is inactive, I am making many changes to my branch at once as it best suits my needs. 

1.  Error Handling:
        Suppresses unnecessary logging of failed downloads within download_single.
        Handles 404 errors gracefully by returning False and potentially logging the error elsewhere (as specified in your requirement).
        Logs errors from the download process using a placeholder comment # Logging is assumed to be handled elsewhere. You'll need to integrate your preferred logging mechanism with this code.

2. Progress Bar:
        Uses tqdm_asyncio for an optional progress bar during download.
        Disables the progress bar if the loglevel is set to ERROR or CRITICAL.

3. Code Clarity:
        Improved comments to explain function arguments and behavior.
        Removed unnecessary imports.

4. Functionality:
        Maintains the core functionality of downloading items from a generator (either synchronous or asynchronous).
        Added support for random subsets using the random_subsets argument.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant