pipe21 1.7.2__tar.gz → 1.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,18 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pipe21
3
- Version: 1.7.2
3
+ Version: 1.8.0
4
4
  Summary: simple functional pipes
5
5
  Author-email: Alexander Rodionov <tandav@tandav.me>
6
6
  Project-URL: source, https://github.com/tandav/pipe21
7
+ Project-URL: docs, https://tandav.github.io/pipe21/
8
+ Project-URL: issues, https://github.com/tandav/pipe21/issues
9
+ Project-URL: release notes, https://github.com/tandav/pipe21/releases
7
10
  Requires-Python: >=3.8
8
11
  Description-Content-Type: text/markdown
9
12
  Provides-Extra: dev
10
13
 
11
14
  [![PyPI version](https://img.shields.io/pypi/v/pipe21.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/pipe21/)
15
+ [![Coverage Status](https://coveralls.io/repos/github/tandav/pipe21/badge.svg?branch=coveralls-bage)](https://coveralls.io/github/tandav/pipe21?branch=coveralls-bage)
12
16
 
13
17
  # pipe21 - simple functional pipes [[docs]](https://tandav.github.io/pipe21)
14
18
 
@@ -128,5 +132,5 @@ import pipe21 as P
128
132
 
129
133
  ---
130
134
 
131
- - [all available methods reference](docs/reference.md)
132
- - [review of similar tools / alternatives](docs/alternatives.md)
135
+ - [all available methods reference](reference.md)
136
+ - [review of similar tools / alternatives](similar-tools.md)
@@ -1,4 +1,5 @@
1
1
  [![PyPI version](https://img.shields.io/pypi/v/pipe21.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/pipe21/)
2
+ [![Coverage Status](https://coveralls.io/repos/github/tandav/pipe21/badge.svg?branch=coveralls-bage)](https://coveralls.io/github/tandav/pipe21?branch=coveralls-bage)
2
3
 
3
4
  # pipe21 - simple functional pipes [[docs]](https://tandav.github.io/pipe21)
4
5
 
@@ -118,5 +119,5 @@ import pipe21 as P
118
119
 
119
120
  ---
120
121
 
121
- - [all available methods reference](docs/reference.md)
122
- - [review of similar tools / alternatives](docs/alternatives.md)
122
+ - [all available methods reference](reference.md)
123
+ - [review of similar tools / alternatives](similar-tools.md)
@@ -1,14 +1,18 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pipe21
3
- Version: 1.7.2
3
+ Version: 1.8.0
4
4
  Summary: simple functional pipes
5
5
  Author-email: Alexander Rodionov <tandav@tandav.me>
6
6
  Project-URL: source, https://github.com/tandav/pipe21
7
+ Project-URL: docs, https://tandav.github.io/pipe21/
8
+ Project-URL: issues, https://github.com/tandav/pipe21/issues
9
+ Project-URL: release notes, https://github.com/tandav/pipe21/releases
7
10
  Requires-Python: >=3.8
8
11
  Description-Content-Type: text/markdown
9
12
  Provides-Extra: dev
10
13
 
11
14
  [![PyPI version](https://img.shields.io/pypi/v/pipe21.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/pipe21/)
15
+ [![Coverage Status](https://coveralls.io/repos/github/tandav/pipe21/badge.svg?branch=coveralls-bage)](https://coveralls.io/github/tandav/pipe21?branch=coveralls-bage)
12
16
 
13
17
  # pipe21 - simple functional pipes [[docs]](https://tandav.github.io/pipe21)
14
18
 
@@ -128,5 +132,5 @@ import pipe21 as P
128
132
 
129
133
  ---
130
134
 
131
- - [all available methods reference](docs/reference.md)
132
- - [review of similar tools / alternatives](docs/alternatives.md)
135
+ - [all available methods reference](reference.md)
136
+ - [review of similar tools / alternatives](similar-tools.md)
@@ -1,10 +1,12 @@
1
1
 
2
2
  [dev]
3
3
  bumpver
4
+ black
5
+ autopep8
4
6
  pre-commit
5
7
  hypothesis
6
- mypy
7
8
  pytest
8
9
  pytest-cov
10
+ coveralls
9
11
  mkdocs
10
12
  mkdocs-material
@@ -2,17 +2,18 @@ import functools
2
2
  import itertools
3
3
  import re
4
4
 
5
- __version__ = '1.7.2'
5
+ __version__ = '1.8.0'
6
6
 
7
7
 
8
8
  class B:
9
- def __init__(self, f=None, **kw): self.f = f; self.kw = kw
9
+ def __init__(self, f=None, *args, **kw):
10
+ self.f = f; self.args = args; self.kw = kw
10
11
  class Pipe (B): __ror__ = lambda self, x: self.f(x)
11
12
  class Map (B): __ror__ = lambda self, x: map (self.f, x)
12
13
  class Filter(B): __ror__ = lambda self, x: filter(self.f, x)
13
14
 
14
15
 
15
- class Reduce (B): __ror__ = lambda self, x: functools.reduce(self.f, x)
16
+ class Reduce (B): __ror__ = lambda self, x: functools.reduce(self.f, x, *self.args)
16
17
  class MapValues (B): __ror__ = lambda self, it: it | Map(lambda kv: (kv[0], self.f(kv[1])))
17
18
  class MapKeys (B): __ror__ = lambda self, it: it | Map(lambda kv: (self.f(kv[0]), kv[1]))
18
19
  class FilterFalse (B): __ror__ = lambda self, it: it | Filter(lambda x: not self.f(x))
@@ -28,7 +29,8 @@ class Values (B): __ror__ = lambda self, it: it | Map(lambda x: x[1])
28
29
  class Grep (B): __ror__ = lambda self, it: it | Filter(lambda x: re.search(self.f, x))
29
30
  class GrepV (B): __ror__ = lambda self, it: it | Filter(lambda x: not re.search(self.f, x))
30
31
  class Count (B): __ror__ = lambda self, it: sum(1 for _ in it)
31
- class Take (B): __ror__ = lambda self, it: itertools.islice(it, self.f) | Pipe(tuple)
32
+ class Slice (B): __ror__ = lambda self, it: itertools.islice(it, self.f, *self.args)
33
+ class Take (B): __ror__ = lambda self, it: it | Slice(self.f) | Pipe(tuple)
32
34
  class Chunked (B): __ror__ = lambda self, it: iter(functools.partial(lambda n, i: i | Take(n), self.f, iter(it)), ())
33
35
  class GroupBy (B): __ror__ = lambda self, it: itertools.groupby(it, key=self.f)
34
36
  class PipeArgs (B): __ror__ = lambda self, x: self.f(*x)
@@ -36,6 +38,7 @@ class StarMap (B): __ror__ = lambda self, x: x | Map(lambda y: y | PipeArgs
36
38
  class IsUnique (B): __ror__ = lambda self, seq: len(seq) == len(set(seq if self.f is None else map(self.f, seq)))
37
39
  class Sorted (B): __ror__ = lambda self, it: sorted(it, **self.kw)
38
40
  class MapApply (B): __ror__ = lambda self, it: it | Map(lambda x: x | Apply(self.f))
41
+ class ReduceByKey (B): __ror__ = lambda self, it: it | Sorted(lambda kv: kv[0]) | GroupBy(lambda kv: kv[0]) | MapValues(lambda kv: kv | Values() | Reduce(self.f)) | Pipe(list)
39
42
 
40
43
 
41
44
  class Unique(B):
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pipe21"
3
- version = "1.7.2"
3
+ version = "1.8.0"
4
4
  authors = [
5
5
  {name = "Alexander Rodionov", email = "tandav@tandav.me"},
6
6
  ]
@@ -12,17 +12,23 @@ dependencies = []
12
12
  [project.optional-dependencies]
13
13
  dev = [
14
14
  "bumpver",
15
+ "black",
16
+ "autopep8",
15
17
  "pre-commit",
16
18
  "hypothesis",
17
- "mypy",
18
19
  "pytest",
19
20
  "pytest-cov",
21
+ "coveralls",
20
22
  "mkdocs",
21
23
  "mkdocs-material",
22
24
  ]
23
25
 
24
26
  [project.urls]
25
27
  source = "https://github.com/tandav/pipe21"
28
+ docs = "https://tandav.github.io/pipe21/"
29
+ issues = "https://github.com/tandav/pipe21/issues"
30
+ "release notes" = "https://github.com/tandav/pipe21/releases"
31
+
26
32
 
27
33
  [project.scripts]
28
34
  chans-cli = "chans.__main__:main"
@@ -37,7 +43,7 @@ build-backend = "setuptools.build_meta"
37
43
  # ==============================================================================
38
44
 
39
45
  [tool.bumpver]
40
- current_version = "v1.7.2"
46
+ current_version = "v1.8.0"
41
47
  version_pattern = "vMAJOR.MINOR.PATCH"
42
48
  commit_message = "bump version {old_version} -> {new_version}"
43
49
  commit = true
@@ -129,6 +135,7 @@ disable = [
129
135
  "W1514",
130
136
  "W0401", # wildcard import
131
137
  "W0614",
138
+ "W1113",
132
139
  "R0903",
133
140
  "E0401",
134
141
  ]
File without changes