Skip to main content

Pypey

Library for composing lazily-evaluated data-processing pipelines:

>>> from urllib.request import urlopen
>>> import re
>>> from pypey import pype, px
>>> # prints plain text message from example.com
>>> (pype(urlopen('http://example.com'))
...  .map(bytes.decode, str.split)
...  .flat()
...  .slice(90, 114)
...  .map(px(re.sub, r'\<\/?p\>', ''))
...  .to(' '.join))
'This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.'

Supports argument unpacking:

>>> import os
>>> from pypey import pype
>>>  # reads environment variables with "PYTHON" in them and prints their name
>>> pype.dict(os.environ).select(lambda key, val: 'PYTHON' in key).pick(0).print()
PYTHONPATH
IPYTHONENABLE
PYTHONIOENCODING
PYTHONUNBUFFERED
<pypey.pype.Pype object at 0x7ffa54006a30>

Supports parallelism:

>>> from timeit import timeit
>>> timeit("from math import log10; from pypey import pype; pype(range(1, 10_000_000)).map(log10).to(sum, print)", number=5)
65657052.08005966
65657052.08005966
65657052.08005966
65657052.08005966
65657052.08005966
10.055954356997972
>>> timeit("from math import log10; from pypey import pype; pype(range(1, 10_000_000)).map(log10, workers=8).to(sum, print)", number=5)
65657052.08005966
65657052.08005966
65657052.08005966
65657052.08005966
65657052.08005966
5.446932412014576

Installing

Install with pip:

pip install pypey

Testing

Unit tests are written with pytest. Run with:

pip install pytest

pytest

Pypey has been tested with python 3.7, 3.8 and 3.9. A few tests containing positional-only arguments will fail if they are run with 3.7 as it's a feature only available from 3.8 onwards.

Documentation

Extensive documentation at https://pypey.readthedocs.io/en/stable/index.html. Unit tests document through behaviour specification.

Changelog

Check the Changelog for fixes and enhancements of each version.

License

Copyright Jose Llarena 2021.

Distributed under the terms of the MIT license, Pypey is free and open source software.

Metadata

Release files for pypey 3.0.2

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

Source distribution (sdist)

Source distribution for pypey 3.0.2
File Size Uploaded Provenance
pypey-3.0.2.tar.gz 23.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pypey 3.0.2
File Interpreter ABI Platform
pypey-3.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 63.4 kB

Release files / pypey-3.0.2.tar.gz

Download URL pypey-3.0.2.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
77caf2144c89b40538b49dccd8c09b8a56283cc45bbf98dcb4f3bde8a146ba6d
BLAKE2b-256 checksum
How to use checksums
256d56ab81f5fa93fdf1782b5f70a5bf1da86f08cf270facefa8a0eb2b9f6d14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.10

Release files / pypey-3.0.2-py3-none-any.whl

Download URL pypey-3.0.2-py3-none-any.whl
Size 40.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c041d4c1ddae1add3527e2ea5bfc5b8ca1ae5b1d83d53ffbbf350d3fd61b5b59
BLAKE2b-256 checksum
How to use checksums
9e6c06a0ad9135eb33b4a0de28ab150f3cb71540a5927364e1afb77820441e36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.10

Security for pypey 3.0.2

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.

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