Skip to main content

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 (at the expense of performance).

from oa_utils import Pipeline

hamming_distance = (
    Pipeline("karolin") # ('k', 'a', 'r', 'o', 'l', 'i', 'n')
    .zip_with(lambda a, b: int(a != b), "kathrin") # (0, 0, 1, 1, 1, 0, 0)
    .sum() # 3
)

See pipeline.py for docstrings and doctests of every method.

Metadata

Release files for oa-utils 0.1.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oa-utils 0.1.21
File Size Uploaded
oa_utils-0.1.21.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oa-utils 0.1.21
File Interpreter ABI Platform
oa_utils-0.1.21-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / oa_utils-0.1.21.tar.gz

Download URL oa_utils-0.1.21.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6146c77127cb22ef8d8b082c321ac1a47719d84e6062787ff11947d4d0005332
BLAKE2b-256 checksum
How to use checksums
ed0f5f923898ed0b6d345cc7fed7f1c780bed6326ec0db47eaecdde52165baef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.1 Windows/10

Release files / oa_utils-0.1.21-py3-none-any.whl

Download URL oa_utils-0.1.21-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa9a0cf257ae2ba5953d7a654c5c75a433568373760c591b518e04454620390c
BLAKE2b-256 checksum
How to use checksums
ca1dcb4b5d7b5d9568401866032879dc3a83e03c2e04d76929d999c62b3a23be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.1 Windows/10

Release history Release notifications | RSS feed

This release

0.1.21 This release

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page