Skip to main content

Statically typed Python utilities for functional programming.

Project description

oa-utils

Statically typed Python utilities for functional programming.

Pipeline

This class is useful for programming in the collection pipeline style. It wraps a homogenous variadic tuple and exposes a fluent interface with common functional programming operations. Why a tuple and not a "lazy" iterator? Because a tuple is relatively immutable and because, in my opinion, reified collections are much easier to reason about than stateful iterators.

from oa_utils.pipeline import Pipeline

result = (Pipeline(range(10))
            .filter(lambda x: x % 2 == 0)
            .map(lambda x: x * x)
            .sum()) # 120

See pipeline.py for docstrings of every method.

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

oa_utils-0.1.11.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

oa_utils-0.1.11-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file oa_utils-0.1.11.tar.gz.

File metadata

  • Download URL: oa_utils-0.1.11.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.1 Windows/10

File hashes

Hashes for oa_utils-0.1.11.tar.gz
Algorithm Hash digest
SHA256 19876a06ce94baf16d9313465103e50dc10aa2cca19aa61d9393f9bb28037586
MD5 8899860b183a81ef8293c51018f5ea11
BLAKE2b-256 d2854ea5cf0bc164b1a72be8c83a9dc919e550b5a5bb37e085512c04a4719122

See more details on using hashes here.

File details

Details for the file oa_utils-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: oa_utils-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.1 Windows/10

File hashes

Hashes for oa_utils-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 5950e821a9b272d8d96df7c677001d10280b6f1f3aa396a7aefe397c73e6539a
MD5 0911518df3be6130cc30ddb32a29ce1c
BLAKE2b-256 0a4ded1924f0aed24b34752b5826db89a8212e22c5b04e8b46cb9f7cabb40248

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