Chainable functional API for list processing (map/filter/reduce). Great for data pipelines. Perfect for AI agents and LLM applications.
Project description
pystreams
Chainable functional API for list processing
Installation
pip install pystreams
💡 Usage Examples
Basic Operations
from pylib_streams import Stream, map, filter, reduce
# Using Stream class
result = Stream([1, 2, 3, 4, 5])\
.map(lambda x: x * 2)\
.filter(lambda x: x > 5)\
.to_list()
# [6, 8, 10]
# Using functional API
doubled = map(lambda x: x * 2, [1, 2, 3])
filtered = filter(lambda x: x > 2, [1, 2, 3, 4])
summed = reduce(lambda a, b: a + b, [1, 2, 3, 4])
# 10
AI/ML Use Cases
from pylib_streams import Stream, map, filter, reduce
# Process ML predictions
predictions = Stream([0.1, 0.5, 0.9, 0.3])\
.filter(lambda p: p > 0.5)\
.map(lambda p: "high" if p > 0.8 else "medium")\
.to_list()
# Transform training data
features = Stream(raw_data)\
.map(extract_features)\
.filter(is_valid)\
.to_list()
📚 API Reference
See package documentation for complete API reference.
🤖 AI Agent Friendly
This package is optimized for AI agents and code generation tools:
- Clear function names and signatures
- Comprehensive docstrings with examples
- Type hints for better IDE support
- Common use cases documented
- Zero dependencies for reliability
License
MIT
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 pylib_streams-0.1.0.tar.gz.
File metadata
- Download URL: pylib_streams-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11d49acded074d6001f1c24a82e7018b22af351ef586d886a5b89643ca4e2127
|
|
| MD5 |
e3bc58397bdc751ede5b970c9cd3ce9d
|
|
| BLAKE2b-256 |
d3214ca00048ca6e3dfb2971500343da684524fd625a48aac354a4aa5b4c21a0
|
File details
Details for the file pylib_streams-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pylib_streams-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea81750d4feae4e20c7cf6f4b05dfc9ccd1064c7cbd8665eee35cd8d854898c1
|
|
| MD5 |
543b073a0e384ffca179d197d86b5d38
|
|
| BLAKE2b-256 |
9781746f4eccc32a38110eb6fec84236a9361f703113371c4ab207e6d7219af8
|