Skip to main content

Python but it's Z

Project description

pythonz

pythonz is a package to make your python coding experience more powerful.

example

from functools import partial
from pythonz import pipe, symbol, Maybe

__empty__ = symbol("empty")

def find(fn, itr, default=__empty__):
    try:
        return (
                pipe(itr)
                / partial(filter, fn)
                / next
                // Maybe.Just
        )
    except StopIteration:
        if default is __empty__:
            return Maybe.Nothing() 
        return Maybe.Just(default)
        

# a = pipe(5).and_then(range).then_finally(list) 
a = pipe(5) / range // list  # [0, 1, 2, 3, 4] 
b = find(lambda x: x % 2 == 1, a).unwrap()  # 1
c = find(lambda x: x > 4, a)  # Maybe.None()

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

pythonz-0.1.2.tar.gz (1.3 kB view details)

Uploaded Source

Built Distribution

pythonz-0.1.2-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file pythonz-0.1.2.tar.gz.

File metadata

  • Download URL: pythonz-0.1.2.tar.gz
  • Upload date:
  • Size: 1.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.1 CPython/3.12.5 Darwin/23.6.0

File hashes

Hashes for pythonz-0.1.2.tar.gz
Algorithm Hash digest
SHA256 83697dbeef15d9c01e937bf3ba05fa3dc69e5b1e85c44a9d73ffe2551fcb84e7
MD5 d80e58f03fd7371775a134b0bd11ebea
BLAKE2b-256 c3e5890a23f54159f538672e325fc3d9bcb45725e646df34c02871c16676deb5

See more details on using hashes here.

File details

Details for the file pythonz-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pythonz-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.1 CPython/3.12.5 Darwin/23.6.0

File hashes

Hashes for pythonz-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c3ff2dbe47bbf38d54c8833a882c798f3b7e5abf6cf2af25464dda5773c3ee69
MD5 649a82e5ca7f336d31a7be1286d74556
BLAKE2b-256 063e921301fcdf45411fd49c67ca86dd1ea581a61a87556f4c6b9939dae2f4fb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page