Fluent data processing in Python - a chainable stream processing library for expressive data manipulation using method chaining
Project description
flupy
Documentation: https://flupy.readthedocs.io/en/latest/
Source Code: https://github.com/olirice/flupy
Overview
Flupy implements a fluent interface for operating on python iterables. All flupy methods return generators and are evaluated lazily. This allows expressions to transform arbitrary size data in extremely limited memory.
You can think of flupy as a light weight, 0 dependency, pure python alternative to the excellent Apache Spark project.
Setup
Requirements
- Python 3.6+
Installation
Install flupy with pip:
$ pip install flupy
Library
from itertools import count
from flupy import flu
# Processing an infinite sequence in constant memory
pipeline = (
flu(count())
.map(lambda x: x**2)
.filter(lambda x: x % 517 == 0)
.chunk(5)
.take(3)
)
for item in pipeline:
print(item)
# Returns:
# [0, 267289, 1069156, 2405601, 4276624]
# [6682225, 9622404, 13097161, 17106496, 21650409]
# [26728900, 32341969, 38489616, 45171841, 52388644]
CLI
The flupy command line interface brings the same syntax for lazy piplines to your shell. Inputs to the flu command are auto-populated into a Fluent context named _.
$ flu -h
usage: flu [-h] [-f FILE] [-i [IMPORT [IMPORT ...]]] command
flupy: a fluent interface for python
positional arguments:
command flupy command to execute on input
optional arguments:
-h, --help show this help message and exit
-f FILE, --file FILE path to input file
-i [IMPORT [IMPORT ...]], --import [IMPORT [IMPORT ...]]
modules to import
Syntax: <module>:<object>:<alias>
Examples:
'import os' = '-i os'
'import os as op_sys' = '-i os::op_sys'
'from os import environ' = '-i os:environ'
'from os import environ as env' = '-i os:environ:env'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flupy-1.2.3.tar.gz.
File metadata
- Download URL: flupy-1.2.3.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
220b6d40dea238cd2d66784c0d4d2a5483447a48acd343385768e0c740af9609
|
|
| MD5 |
3f6f0d4516458b1738393cb09b0f4e1e
|
|
| BLAKE2b-256 |
fda515fe839297d761e04c4578b11013ed46353e63b44b5e42b59c2078602fa1
|
File details
Details for the file flupy-1.2.3-py3-none-any.whl.
File metadata
- Download URL: flupy-1.2.3-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be0f5a393bad2b3534697fbab17081993cd3f5817169dd3a61e8b2e0887612e6
|
|
| MD5 |
2639fa30c484ef08f927237714c09aa9
|
|
| BLAKE2b-256 |
7c26d4d1629f846ae2913e88f74955a3c3f41f3863e74c5fbc1cb79af9550717
|