Skip to content

Commit 3436199

Browse files
authored
Merge pull request #92 from PickwickSoft/release/v1.3.0
Release v1.3.0
2 parents 471b6ea + 1093956 commit 3436199

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Now you might be wondering why another library when there are already a few impl
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, JSON and XML files.
29+
* It provides loaders for various data sources such as CSV, JSON, XML and YAML files.
3030

3131
Let's take a look at a small example:
3232

@@ -213,15 +213,15 @@ Stream.concat(Stream.of([1, 2]), Stream.of([3, 4]))
213213

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

216-
## Use loaders: Load data from CSV, JSON and XML files in just one line
216+
## Use loaders: Load data from CSV, JSON, XML and YAML files in just one line
217217

218-
PyStreamAPI offers a convenient way to load data from CSV, JSON and XML files. Like that you can start processing your
218+
PyStreamAPI offers a convenient way to load data from CSV, JSON, XML and YAML files. Like that you can start processing your
219219
files right away without having to worry about reading and parsing the files.
220220

221221
You can import the loaders with:
222222

223223
```python
224-
from pystreamapi.loaders import csv, json, xml
224+
from pystreamapi.loaders import csv, json, xml, yaml
225225
```
226226
Now you can use the loaders directly when creating your Stream:
227227

@@ -253,14 +253,30 @@ pip install streams.py[xml_loader]
253253
Afterward, you can use the XML loader like this:
254254

255255
```python
256-
Stream.of(xml("data.xml"))
257-
.map(lambda x: x.attr1)
256+
Stream.of(xml("data.xml")) \
257+
.map(lambda x: x.attr1) \
258258
.for_each(print)
259259
```
260260

261261
The access to the attributes is using a node path syntax. For more details on how to use the node path syntax, please
262262
refer to the [documentation](https://pystreamapi.pickwicksoft.org/reference/data-loaders).
263263

264+
For YAML:
265+
266+
In order to use the YAML loader, you need to install the optional yaml dependency:
267+
268+
```bash
269+
pip install streams.py[yaml_loader]
270+
```
271+
272+
Afterward, you can use the YAML loader like this:
273+
274+
```python
275+
Stream.of(yaml("data.yaml")) \
276+
.map(lambda x: x.attr1) \
277+
.for_each(print)
278+
```
279+
264280
## API Reference
265281
For a more detailed documentation view the docs on GitBook: [PyStreamAPI Docs](https://pystreamapi.pickwicksoft.org/)
266282

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "streams.py"
3-
version = "1.2.1"
3+
version = "1.3.0"
44
authors = ["Stefan Garlonta <stefan@pickwicksoft.org>"]
55
description = "A stream library for Python inspired by Java Stream API"
66
keywords = ["streams", "parallel", "data"]

pystreamapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pystreamapi.__stream import Stream
22
from pystreamapi._streams.error.__levels import ErrorLevel
33

4-
__version__ = "1.2.1"
4+
__version__ = "1.3.0"
55
__all__ = ["Stream", "ErrorLevel"]

0 commit comments

Comments
 (0)