Registry / data / pyfunctional

pyfunctional

JSON →
library1.5.0pypypi✓ verified 35d ago

PyFunctional is a Python package designed for creating data pipelines using a functional programming paradigm, inspired by Scala and Spark. It provides tools for chaining operations on sequences, supporting lazy evaluation, parallel processing, and various data transformations. The current version is 1.5.0, and the project generally focuses on API stability since its 1.0.0 release.

dataworkflow
Install & Compatibility
Where this runs
tested against v1.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.292s · 19.4MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.7s · import 0.273s · 20MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Use `seq` for standard, lazy functional pipelines.

from functional import seq

Use `pseq` for pipelines that automatically leverage parallel processing for performance.

from functional import pseq

This example demonstrates creating a sequence, applying common functional transformations like `map` and `filter`, and finally aggregating results with `reduce`.

from functional import seq # Create a sequence from a range of numbers result = seq(range(10)) .map(lambda x: x * x) # Square each number .filter(lambda x: x > 10) # Keep numbers greater than 10 .reduce(lambda x, y: x + y, 0) # Sum the remaining numbers, starting with 0 print(result) # Expected output: 285
Debug
Known footguns
breakingThe library was renamed from `ScalaFunctional` to `PyFunctional` in version 0.6.0. Projects using the old package name will need to update their `install_requires` and import paths.
breakingThe behavior of `Sequence.zip_with_index` was modified in version 0.5.0. It no longer behaves as expected in previous versions and should be replaced.
gotchaStarting from version 0.3.0, all operations in PyFunctional are lazy by default. This means transformations are not executed until an action (like `reduce`, `to_list`, `to_dict`, or iteration) consumes the sequence. This can lead to unexpected behavior if intermediate results are expected to be immediately available or if debugging relies on immediate evaluation.
gotchaFor automatic parallelization of pipeline operations (e.g., `map`, `filter`), you must explicitly import and use `pseq` instead of `seq`. `seq` does not use parallel processing.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
15 hits · last 30 days
gptbot
4
ahrefsbot
3
dotbot
1
script
1
bingbot
1
bytedance
1
Resources