fptk (Functional Programming Toolkit) — Pragmatic functional programming helpers for Python (pipe/compose/curry, Option/Result, lazy iterators, applicative validation).
Project description
Pragmatic functional programming for Python 3.13+
Install
pip install fptk
Quick Example
from fptk.core.func import pipe
from fptk.adt.option import Some, NOTHING
from fptk.adt.result import Ok, Err
# Compose transformations
result = pipe(5, lambda x: x + 1, lambda x: x * 2) # 12
# Handle absence explicitly
name = Some("alice").map(str.upper).unwrap_or("anonymous") # "ALICE"
# Type-safe error handling
def parse(s: str) -> Result[int, str]:
try:
return Ok(int(s))
except ValueError:
return Err(f"invalid: {s}")
parse("42").map(lambda x: x * 2) # Ok(84)
Documentation
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fptk-1.0.0rc1.tar.gz.
File metadata
- Download URL: fptk-1.0.0rc1.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07633cca5edcd63ee0c1a14bd5bfdad623a6f4aa071c168e5c3c2153f5782428
|
|
| MD5 |
613bd0522e2b0691cfdb4462d3626903
|
|
| BLAKE2b-256 |
8bc9fd04e8c5c8bed9051a4f2430e1828b61cd848f7fcb06268be9bd7ddc9410
|
Provenance
The following attestation bundles were made for fptk-1.0.0rc1.tar.gz:
Publisher:
release.yml on mhbxyz/fptk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fptk-1.0.0rc1.tar.gz -
Subject digest:
07633cca5edcd63ee0c1a14bd5bfdad623a6f4aa071c168e5c3c2153f5782428 - Sigstore transparency entry: 834710213
- Sigstore integration time:
-
Permalink:
mhbxyz/fptk@db6e768cd3d3f30752fafbdf650a2b7f4954d9e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mhbxyz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@db6e768cd3d3f30752fafbdf650a2b7f4954d9e8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fptk-1.0.0rc1-py3-none-any.whl.
File metadata
- Download URL: fptk-1.0.0rc1-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e89f2add5d96451c1b2bf3f408834a9586bd60066338ecb0005472277bc0848a
|
|
| MD5 |
6384b03129401f23ca9172002417e783
|
|
| BLAKE2b-256 |
871e3517f0d43210a58becc2da02e0fb9c6387153de2678a9f98561ccd00e905
|
Provenance
The following attestation bundles were made for fptk-1.0.0rc1-py3-none-any.whl:
Publisher:
release.yml on mhbxyz/fptk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fptk-1.0.0rc1-py3-none-any.whl -
Subject digest:
e89f2add5d96451c1b2bf3f408834a9586bd60066338ecb0005472277bc0848a - Sigstore transparency entry: 834710217
- Sigstore integration time:
-
Permalink:
mhbxyz/fptk@db6e768cd3d3f30752fafbdf650a2b7f4954d9e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mhbxyz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@db6e768cd3d3f30752fafbdf650a2b7f4954d9e8 -
Trigger Event:
workflow_dispatch
-
Statement type: