Skip to content

Commit 584f6e2

Browse files
committed
📝 Add CSV loader to README
1 parent 5472a1a commit 584f6e2

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ PyStreamAPI offers both sequential and parallel streams and utilizes lazy execut
2020

2121
Now you might be wondering why another library when there are already a few implementations? Well, here are a few advantages of this particular implementation:
2222

23-
* It provides both sequential and parallel versions.
23+
* It provides both sequential and parallel streams.
2424
* Lazy execution is supported, enhancing performance.
2525
* It boasts high speed and efficiency.
2626
* The implementation achieves 100% test coverage.
2727
* It follows Pythonic principles, resulting in clean and readable code.
2828
* It adds some cool innovative features such as conditions or error handling and an even more declarative look.
29+
* It provides loaders for various data sources such as CSV
2930

3031
Let's take a look at a small example:
3132

@@ -212,6 +213,23 @@ Stream.concat(Stream.of([1, 2]), Stream.of([3, 4]))
212213

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

216+
## Use loaders: Load data from CSV files in just one line
217+
218+
PyStreamAPI offers a convenient way to load data from CSV files. Like that you can start processing your CSV right away without having to worry about reading and parsing the file.
219+
220+
You can import the loader with:
221+
222+
```python
223+
from pystreamapi.loaders import csv
224+
```
225+
Now you can use the loader directly when creating your Stream:
226+
227+
```python
228+
Stream.of(csv("data.csv", delimiter=";")) \
229+
.map(lambda x: x["name"]) \
230+
.for_each(print)
231+
```
232+
215233
## API Reference
216234
For a more detailed documentation view the docs on GitBook: [PyStreamAPI Docs](https://pystreamapi.pickwicksoft.org/)
217235

0 commit comments

Comments
 (0)