diff --git a/.gitignore b/.gitignore index f3a9990..74b962b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store .idea/ .pytest_cache/ -__pycache__/ \ No newline at end of file +__pycache__/ +dist/ \ No newline at end of file diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..07d88e7 --- /dev/null +++ b/MANIFEST @@ -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 diff --git a/README.md b/README.md index e18dc0c..4a66306 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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: diff --git a/python_streams/__init__.py b/python_streams/__init__.py deleted file mode 100644 index e23ac2e..0000000 --- a/python_streams/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from python_streams.commodities import * -from python_streams.partials import compose, compose3, compose4 -from python_streams.streams import Stream diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..224a779 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[metadata] +description-file = README.md \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..3f24e75 --- /dev/null +++ b/setup.py @@ -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', + ], +) diff --git a/streams/__init__.py b/streams/__init__.py new file mode 100644 index 0000000..add85c4 --- /dev/null +++ b/streams/__init__.py @@ -0,0 +1,3 @@ +from streams.commodities import * +from streams.partials import compose, compose3, compose4 +from streams.streams import Stream diff --git a/python_streams/commodities.py b/streams/commodities.py similarity index 100% rename from python_streams/commodities.py rename to streams/commodities.py diff --git a/python_streams/partials.py b/streams/partials.py similarity index 98% rename from python_streams/partials.py rename to streams/partials.py index 31d179a..b3ded5b 100644 --- a/python_streams/partials.py +++ b/streams/partials.py @@ -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] diff --git a/python_streams/streams.py b/streams/streams.py similarity index 100% rename from python_streams/streams.py rename to streams/streams.py diff --git a/tests/benchmark.py b/tests/benchmark.py index 4c3995b..cde6269 100644 --- a/tests/benchmark.py +++ b/tests/benchmark.py @@ -4,7 +4,7 @@ from functional import seq -from python_streams import Stream +from streams import Stream def sieve_eratosthenes() -> Stream[int]: diff --git a/tests/unit/caesar_cypher_test.py b/tests/unit/caesar_cypher_test.py index 21e5c69..a3e5927 100644 --- a/tests/unit/caesar_cypher_test.py +++ b/tests/unit/caesar_cypher_test.py @@ -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: diff --git a/tests/unit/streams_test.py b/tests/unit/streams_test.py index 937ed71..a6cb911 100644 --- a/tests/unit/streams_test.py +++ b/tests/unit/streams_test.py @@ -1,6 +1,6 @@ from itertools import count, cycle -from python_streams import Stream +from streams import Stream def test_iter():