Skip to main content

Small utility helpers for images, parallelism, and list logic.

Project description

derptools

Small utility helpers for images, parallelism, and list logic.

Functions

  • img_download(url, save_path, retries=3) — download an image with retries
  • img_resize(fn, size=1200) — resize an image to a target width, preserving aspect
  • img_resize_over_background(address, out_size) — pad to square on white, then resize
  • images_dl(urls, save_folder) — download a batch of image URLs to a folder
  • parallel_map(func, *iterables, max_workers=8, **kwargs) — threaded map over zipped iterables, order preserved
  • or_list(*args) — first truthy value (callables are called)
  • and_list(*args) — last value if all truthy, else first falsy
  • ifdo(x, y) — call y() if x() is truthy
  • tryreturn(func, *args, **kwargs) — call func, return 0 on exception
  • ordered_set(lis) — dedupe a list, preserving order

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

derptools-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

derptools-0.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file derptools-0.1.0.tar.gz.

File metadata

  • Download URL: derptools-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for derptools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 48e3715003fbfbf96cfda7fe3a94e353b4a2ca8559accee8d148ce345d03b67e
MD5 b30c176fd9c1952daded6612c862c7e8
BLAKE2b-256 6b374c250507685ed42478823ab92b66aea5de9b522c9251ddde919312344f7c

See more details on using hashes here.

File details

Details for the file derptools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: derptools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for derptools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0194374eb4ad315237694f90da16e396095834fbe2499c7c422ae7d6070fa9a0
MD5 bcf6c4fb2ef9babaccebe4a3c42df53e
BLAKE2b-256 54496c9f9f3897e8e2ec35236efc0d6dca1d6f42570b2168272c34dd6fe01ab6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page