Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.idea/
.pytest_cache/
__pycache__/
__pycache__/
dist/
7 changes: 7 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# file GENERATED by distutils, do NOT edit
setup.cfg
setup.py
streams/__init__.py
streams/commodities.py
streams/partials.py
streams/streams.py
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# Python Streams

## Getting started

```bash
pip install python-streams
```

```python
from streams import Stream
Stream(('hello', 'world')).for_each(print)
```

## Example

```python
from python_streams import Stream, compose4
from python_streams import partials as _
from streams import Stream, compose4
from streams import partials as _


def caesar_cypher(message: str, shift: int) -> str:
Expand All @@ -26,8 +37,8 @@ Let's attempt an alternate implementation to show some more features:
```python
from itertools import cycle

from python_streams import Stream, compose
from python_streams import partials as _
from streams import Stream, compose
from streams import partials as _


def caesar_cypher(message: str, shift: int) -> str:
Expand Down
3 changes: 0 additions & 3 deletions python_streams/__init__.py

This file was deleted.

2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
16 changes: 16 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from distutils.core import setup

setup(
name='python-streams', # How you named your package folder (MyLib)
packages=['streams'], # Chose the same as "name"
version='0.2.0', # Start with a small number and increase it with every change you make
description='', # Give a short description about your library
url='https://github.com/JaviOverflow/python-streams',
keywords=['python', 'streams', 'lambda'],
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
)
3 changes: 3 additions & 0 deletions streams/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from streams.commodities import *
from streams.partials import compose, compose3, compose4
from streams.streams import Stream
File renamed without changes.
2 changes: 1 addition & 1 deletion python_streams/partials.py → streams/partials.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Callable, TypeVar, Union, Iterable

from python_streams import commodities
from streams import commodities

N = TypeVar('N', int, float)
NumberToNumber = Callable[[N], N]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from functional import seq

from python_streams import Stream
from streams import Stream


def sieve_eratosthenes() -> Stream[int]:
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/caesar_cypher_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from python_streams import Stream, partials, compose4
from python_streams import partials as _
from streams import Stream, partials, compose4
from streams import partials as _


def caesar_cypher(message: str, shift: int) -> str:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/streams_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from itertools import count, cycle

from python_streams import Stream
from streams import Stream


def test_iter():
Expand Down