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.12.tar.gz (6.7 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.12-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oa_utils-0.1.12.tar.gz
  • Upload date:
  • Size: 6.7 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.12.tar.gz
Algorithm Hash digest
SHA256 0cef6759d61ef8fd18924fec1a53d5721b196cd0c2b0451c90a1404daaeaefbe
MD5 5bd6418884022dab504b6d4e32ae2b35
BLAKE2b-256 5d6bd0310b251930c4da2c465790eb1136ee4a9cd9af1c55c99025529694a8a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: oa_utils-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 7.6 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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 23e86b0cbf3414d3e1d1e65050f382a3230cddada42f27ab72a5d57ac3cf1386
MD5 48bffdb19e68008ac2739c05729756b3
BLAKE2b-256 5901372699d6fcd3b7b2ec62d936347ab447bb59058c92f6247e879a209e99a6

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