Skip to main content

WITH utils

Project description

With Utils

Utils that we've used a lot at WITH.

iter

Iteration-related utils

n_grams

Provides a way to create n_grams from an iterator

from with_utils.iter import n_grams
assert list(n_grams([1, 2, 3, 4], 2)) == [(1, 2), (2, 3), (3, 4)]

return_list

Transforms an iterator into a function that returns a list.

from with_utils.iter import return_list

@return_list
def foo():
    yield 1
    yield 2
    yield 3

assert foo() == [1, 2, 3]

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

with-utils-0.2.1.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

with_utils-0.2.1-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file with-utils-0.2.1.tar.gz.

File metadata

  • Download URL: with-utils-0.2.1.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/4.19.0-8-amd64

File hashes

Hashes for with-utils-0.2.1.tar.gz
Algorithm Hash digest
SHA256 83eb3c618287935e2001c681da0a081851c95c72ae8718f3f78b7e83c4af2c28
MD5 240d7b8c374288eeec18c52e5391a5b6
BLAKE2b-256 41e5c4780e46832eb6f13b4b99f5f61bcb0119506fd65f0ef8dab4faffda9ea4

See more details on using hashes here.

File details

Details for the file with_utils-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: with_utils-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 2.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/4.19.0-8-amd64

File hashes

Hashes for with_utils-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6bc14a9372549bda997178cf2ac7dc3879189b562281e0498cdd428cc7966db0
MD5 f19a531129c771cf99074009e34c1958
BLAKE2b-256 3096fc98f757fa22e8076e5f92e2554ffb8a5b0f19ab8cfeaa46ad0aabef541d

See more details on using hashes here.

Supported by

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