flpit 0.1.1.dev2__tar.gz → 0.1.1.dev3__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,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: flpit
3
- Version: 0.1.1.dev2
3
+ Version: 0.1.1.dev3
4
4
  Summary: Fluent LINQ for Python — flip your iterables
5
5
  License: MIT
6
6
  Classifier: Development Status :: 3 - Alpha
@@ -30,16 +30,17 @@ Description-Content-Type: text/markdown
30
30
  ## ⚙️ Installation
31
31
 
32
32
  ```bash
33
- uv add flp
33
+ uv add flpit
34
34
  ```
35
35
 
36
36
  ## 💡 Quick Start
37
37
 
38
38
  ```python
39
- from flp import FlpList, FlpIt
39
+ import flp
40
+ from flp import FlpIt, FlpList
40
41
 
41
- # Eager collection
42
- data = FlpList([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
42
+ # Deferred iterable via shorthand
43
+ data: FlpIt[int] = flp.it([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
43
44
 
44
45
  # Deferred / lazy pipeline
45
46
  query: FlpIt[int] = (
@@ -48,8 +49,11 @@ query: FlpIt[int] = (
48
49
  .select(lambda x: x * 10)
49
50
  )
50
51
 
51
- # Materialization happens explicitly
52
+ # Materialize query results explicitly
52
53
  result: FlpList[int] = query.to_list() # [20, 40, 60, 80, 100]
54
+
55
+ # Or start directly with an eager container
56
+ eager_list: FlpList[int] = flp.lst([1, 2, 3, 4])
53
57
  ```
54
58
 
55
59
  ## 📜 License
@@ -14,16 +14,17 @@
14
14
  ## ⚙️ Installation
15
15
 
16
16
  ```bash
17
- uv add flp
17
+ uv add flpit
18
18
  ```
19
19
 
20
20
  ## 💡 Quick Start
21
21
 
22
22
  ```python
23
- from flp import FlpList, FlpIt
23
+ import flp
24
+ from flp import FlpIt, FlpList
24
25
 
25
- # Eager collection
26
- data = FlpList([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
26
+ # Deferred iterable via shorthand
27
+ data: FlpIt[int] = flp.it([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
27
28
 
28
29
  # Deferred / lazy pipeline
29
30
  query: FlpIt[int] = (
@@ -32,8 +33,11 @@ query: FlpIt[int] = (
32
33
  .select(lambda x: x * 10)
33
34
  )
34
35
 
35
- # Materialization happens explicitly
36
+ # Materialize query results explicitly
36
37
  result: FlpList[int] = query.to_list() # [20, 40, 60, 80, 100]
38
+
39
+ # Or start directly with an eager container
40
+ eager_list: FlpList[int] = flp.lst([1, 2, 3, 4])
37
41
  ```
38
42
 
39
43
  ## 📜 License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "flpit"
3
- version = "0.1.1.dev2"
3
+ version = "0.1.1.dev3"
4
4
  description = "Fluent LINQ for Python — flip your iterables"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "flpit"
3
- version = "0.1.1.dev2"
3
+ version = "0.1.1.dev3"
4
4
  description = "Fluent LINQ for Python — flip your iterables"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -2,6 +2,8 @@
2
2
  Fluent LINQ for Python — flip your iterables.
3
3
  """
4
4
  from __future__ import annotations
5
+ from importlib.metadata import version
6
+ __version__ = version("flpit")
5
7
 
6
8
  import builtins
7
9
  from typing import Iterable as _Iterable, TypeVar
@@ -27,9 +29,6 @@ def repeat(element: TItem, count: int) -> FlpIt[TItem]:
27
29
  """Generates a lazy sequence that contains one repeated value."""
28
30
  return FlpIt(element for _ in builtins.range(count))
29
31
 
30
- Iterable = it
31
- List = lst
32
-
33
32
  __all__ = [
34
33
  "FlpIt",
35
34
  "OrderedIt",
@@ -37,8 +36,6 @@ __all__ = [
37
36
  "FlpList",
38
37
  "it",
39
38
  "lst",
40
- "Iterable",
41
- "List",
42
39
  "range",
43
40
  "repeat",
44
41
  ]
@@ -275,29 +275,7 @@ class FlpIt(Iterable[TItem], Generic[TItem]):
275
275
 
276
276
  return FlpIt(_FactoryIterable(_generator))
277
277
 
278
- # def join(
279
- # self,
280
- # inner: Iterable[TOther],
281
- # outer_key_selector: Callable[[TItem], TKey],
282
- # inner_key_selector: Callable[[TOther], TKey],
283
- # result_selector: Callable[[TItem, TOther], TResult],
284
- # ) -> FlpIt[TResult]:
285
- # """Correlates elements of two sequences based on matching keys (Hash Join)."""
286
- # def _generator() -> Iterator[TResult]:
287
- # lookup: dict[TKey, List[TOther]] = {}
288
- # for inner_item in inner:
289
- # key = inner_key_selector(inner_item)
290
- # lookup.setdefault(key, []).append(inner_item)
291
- #
292
- # for outer_item in self:
293
- # key = outer_key_selector(outer_item)
294
- # if key in lookup:
295
- # for inner_item in lookup[key]:
296
- # yield result_selector(outer_item, inner_item)
297
- #
298
- # return FlpIt(_FactoryIterable(_generator))
299
-
300
- # --- Immediate Execution (Materialization & Aggregation) ---
278
+ # --- Immediate Execution (Materialization & Aggregation) ---
301
279
 
302
280
  @overload
303
281
  def aggregate(self, func: Callable[[TItem, TItem], TItem]) -> TItem: ...
@@ -719,17 +697,6 @@ class FlpList(UserList[TItem], Sequence[TItem], Generic[TItem]):
719
697
  ) -> FlpIt[Grouping[TKey, TItem]]:
720
698
  return FlpIt(self.data).group_by(key_selector)
721
699
 
722
- # def join(
723
- # self,
724
- # inner: Iterable[TOther],
725
- # outer_key_selector: Callable[[TItem], TKey],
726
- # inner_key_selector: Callable[[TOther], TKey],
727
- # result_selector: Callable[[TItem, TOther], TResult],
728
- # ) -> FlpIt[TResult]:
729
- # return FlpIt(self.data).join(
730
- # inner, outer_key_selector, inner_key_selector, result_selector
731
- # )
732
-
733
700
  @overload
734
701
  def aggregate(self, func: Callable[[TItem, TItem], TItem]) -> TItem: ...
735
702
 
File without changes