Skip to main content

Pipe Utils

Python with pipes, utils, and pipe utils.

Install

pip install pipe-utils

Docs

https://pipe-utils.rtfd.io

Example

from pipe_utils import *

words = "I just think pipes are neat!"

result = (
      Pipe(words)
      | obj.lower()
      | obj.replace("!", "")
      | obj.split()
      | group_by(len)
      | sorted_dict()
      | unwrap
)

print(result)
#  {1: ['i'], 3: ['are'], 4: ['just', 'neat'], 5: ['think', 'pipes']}

And, if you're feeling dangerous, override builtin functions like filter, map, and all by importing from pipe_utils.override:

from pipe_utils.override import *

data = [[1, -3, 4], [1, 2, 3], [2, 3, 4], [5, -1, 4]]

result = (
      Pipe(data)
      | filter(all(it >= 0))
      | map(sum_by(it * it))
      | unwrap(as_list)
)

print(result)  # [14, 29]

And, if you're feeling extra dangerous, you can use arrow syntax to clean up some of those brackets:

from pipe_utils.override import *

data = [[1, -3, 4], [1, 2, 3], [2, 3, 4], [5, -1, 4]]

result = (
      Pipe >> data
      | filter >> all(it >= 0)
      | map >> sum_by(it * it)
      | unwrap >> as_list
)

print(result)  # [14, 29]

Metadata

Release files for pipe-utils 0.5.0

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

Source distribution (sdist)

Source distribution for pipe-utils 0.5.0
File Size Uploaded Provenance Actions
pipe_utils-0.5.0.tar.gz 25.9 kB Without provenance Details for pipe_utils-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pipe-utils 0.5.0
File Interpreter ABI Platform Actions
pipe_utils-0.5.0-py3-none-any.whl Python 3 none any Details for pipe_utils-0.5.0-py3-none-any.whl

Total release size: 43.9 kB

Release files / pipe_utils-0.5.0.tar.gz

Download URL pipe_utils-0.5.0.tar.gz
Size 25.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9366a1d6691201b5312a74f279bf7f673e8fc5a2f1b12875f96d753b02c0a28a
BLAKE2b-256 checksum
How to use checksums
51f8ee8a3421b37c0c4cd252fc76c35989337ac115d6bc0f9c61e0aafd9f0e7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.2

Release files / pipe_utils-0.5.0-py3-none-any.whl

Download URL pipe_utils-0.5.0-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9486ea918aefb5689e3e9efaef26d321f02fa2028c4a6305c6f220965650194
BLAKE2b-256 checksum
How to use checksums
1eb40469c30badb0b7d62811a764216fbef6b43f64b6834d1ad978b35231cad5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.2

Security for pipe-utils 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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