smart_open icon indicating copy to clipboard operation
smart_open copied to clipboard

Allow accept_key function to use content metadata.

Open matt2000 opened this issue 4 years ago • 0 comments

Title

Allow accept_key function to use content metadata.

Motivation

The goal here is to allow users to provide a more intelligent filtering function to iter_bucket that can consider the content metadata, and not just the key. For example, one could implement a function to include all files under a certain size, or updated since some date.

This is an alternative implementation to PR #324, which is likely more compatible (it should pass your test suite!) and may be better all-around; it's certainly more pythonic, IMO.

Checklist

Before you create the PR, please make sure you have:

  • [x] Picked a concise, informative and complete title
  • [x] Clearly explained the motivation behind the PR
  • [n/a] Linked to any existing issues that your PR will be solving
  • [x] Included tests for any new functionality
  • [x] Checked that all unit tests pass

matt2000 avatar Mar 29 '20 20:03 matt2000