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.14.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.14-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oa_utils-0.1.14.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.14.tar.gz
Algorithm Hash digest
SHA256 803593411d48f7462fe9d9bec3f7ec8ae1bd47bf1630aae02438ce39c471d159
MD5 5a8888df31bda41180755161d5f319db
BLAKE2b-256 4a08d38213a4b5eae657873f81f926f255f88135379e9e76819b573abe630a17

See more details on using hashes here.

File details

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

File metadata

  • Download URL: oa_utils-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 8.2 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.14-py3-none-any.whl
Algorithm Hash digest
SHA256 df58450dbd76298fd7c2327bbecdc7d5e399b5f24ab41d7afa7948f19fd0d791
MD5 977eb53b9afe2afa4b72b90722200e34
BLAKE2b-256 b71a95013733f0debfe80cc7500e9f35c88b4291d4ae5833f54d185e35a0916d

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