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 and doctests 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.13.tar.gz (7.2 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.13-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oa_utils-0.1.13.tar.gz
  • Upload date:
  • Size: 7.2 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.13.tar.gz
Algorithm Hash digest
SHA256 111aefca74f56a59e38ef4787c68283869dc046dfdb72e61989774f257817d09
MD5 ff75cea05a6483ee28960a6eaff019ff
BLAKE2b-256 4187fabed89bca8d16d34a9f6354ca7a344ef619781e4ba176dffeebf3d44566

See more details on using hashes here.

File details

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

File metadata

  • Download URL: oa_utils-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 8.1 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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 1867eeff8096be8f619da8f841fa7d4fa641c5fe4bc550275b3eb5f8498987d9
MD5 df8a3c94dbd47e5d46c152f1495d3818
BLAKE2b-256 5fc73b4e5c7c447c782d1fa1c2e3f7183b20454f0f77d42492c30c0f3a818b70

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