Quick Start

Get started in just a few seconds!

Installation

To start using PyStreamAPI just install the core module with this command:

pip install streams.py

If you want to install pystreamapi together with the optional extensions, use this command:

pip install 'streams.py[all]'

This will install pystreamapi together with all optional loaders. You can also install those extensions individually, as described on following page:

Data Loaders

Afterward, you can import it with:

from pystreamapi import Stream

🎉 PyStreamAPI is now ready to process your data

Build a new Stream

PyStreamAPI offers two types of Streams, both of which are available in either sequential or parallel versions:

  • (Normal) Stream: Offers operations that do not depend on the types. The same functionality as Streams in other programming languages.

  • NumericStream: This stream extends the capabilities of the default stream by introducing numerical operations. It is designed specifically for use with numerical data sources and can only be applied to such data.

There are a few factory methods that create new Streams:

Stream.of()

Using the of() method will let the implementation decide which Stream to use. If the source is numerical, a NumericStream is created.

Currently, it always returns a SequentialStream or a SequentialNumericStream

Stream.parallel_of()

Stream.sequential.of()

Stream.of_noneable()

If the source is None, you get an empty Stream

Stream.iterate()

Creates a Stream of an infinite Iterator created by iterative application of a function f to an initial element seed, producing a Stream consisting of seed, f(seed), f(f(seed)), etc.

Note Do not forget to limit the stream with .limit()

Stream.concat()

Creates a new Stream from multiple Streams. Order doesn't change.

Last updated

Was this helpful?