Tipe - typed pipe
Tipe allows you to create constructions similar to pipe operator, where result of a function used as an input of next function
Instalation
pip install tipe
Examples
>>> from tipe import Pipe
>>>
>>> Pipe(2).pipe(lambda x: x + 1).pipe(float).unwrap()
3.0
>>> Pipe([2, 3, 4]) \
... .pipe(len) \
... .pipe(lambda x: x + 1) \
... .pipe(float) \
... .unwrap()
4.0
>>> Pipe(2).pipe(range, 4).pipe(len).unwrap()
2
Equivalent for examples above would be
>>> float(2+1)
3.0
>>> float(len([2, 3, 4]) + 1)
4.0
>>> len(range(2, 4))
2
API
Pipe()
To use .pipe() on a value wrap it with Pipe class
>>> Pipe(2)
Pipe(2)
Pipe.pipe()
Pass function to execute on Pipe value and additional params for it. Wraps function result in Pipe and returns it
Pipe.check()
Like Pipe.pipe() but does not change the value inside Pipe. May be useful for debugging purposes
>>> Pipe(2).pipe(lambda x: x ** x).check(print).pipe(float).unwrap()
4
4.0
Pipe.unwrap()
Returns value from Pipe
Short forms
For convenience you can use P as short version of Pipe and short versions of the methods:
p:pipec:checku:unwrap
Types
tipe tries its best to stay typesafe, so every function knows what exactly what it returns as long as it is inferable from arguments
Metadata
Release files for tipe 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tipe-1.1.0.tar.gz | 2.7 kB | Without provenance | Details for tipe-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tipe-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for tipe-1.1.0-py3-none-any.whl |
Total release size: 6.2 kB
Release files / tipe-1.1.0.tar.gz
| Download URL | tipe-1.1.0.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
040277478f9c953dd77709f6b7b99effb1b456e5594ba9651f42442bc4d05a4d
|
|
BLAKE2b-256 checksum How to use checksums |
6ca3df3f34a38532afb8fc40e5a17a5c3104b2676a9bae7de1e8679d9b1c6246
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1019-azure
|
Release files / tipe-1.1.0-py3-none-any.whl
| Download URL | tipe-1.1.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40763195c7864abbbb47209e122ccb4c8c175f9934fbebadf26b1f516c7823e5
|
|
BLAKE2b-256 checksum How to use checksums |
9b770b3a12f960c2fd40935a7be1abfd13f43ef4faa600a4b2a31b9360abc137
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1019-azure
|
Security for tipe 1.1.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.