Skip to main content

Pragmatic functional programming library for Python.

Project description

fptk

Pragmatic functional programming for Python 3.13+

PyPI Python CI License


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

mhbxyz.github.io/fptk

License

MIT

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

fptk-1.2.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fptk-1.2.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file fptk-1.2.0.tar.gz.

File metadata

  • Download URL: fptk-1.2.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fptk-1.2.0.tar.gz
Algorithm Hash digest
SHA256 9ac0450c5f695ff3eb3698ae910f975d28782dcfe5eba9ca48982e1ed18573f1
MD5 a46813b728023651a8266357519c54e8
BLAKE2b-256 c0b818c3245830c4cc36a146a14edf68b3713f629b164f14735ee3f1dd36a789

See more details on using hashes here.

Provenance

The following attestation bundles were made for fptk-1.2.0.tar.gz:

Publisher: release.yml on mhbxyz/fptk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fptk-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: fptk-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fptk-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 860951fd8c57f2a0ac6141d3d93502d32b49f1e15d648c624d68a16ec913c283
MD5 7c26e05e77be43eee9dbaaf1dcaf69ca
BLAKE2b-256 cfccba1f313aa64ec276e3e3780897ea85837631afc4efc1bb1d7b9d7ea69977

See more details on using hashes here.

Provenance

The following attestation bundles were made for fptk-1.2.0-py3-none-any.whl:

Publisher: release.yml on mhbxyz/fptk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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