cyqstats 0.1.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.
cyqstats-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 toto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include LICENSE
2
+ include readme.md
3
+ include pyproject.toml
4
+ recursive-include src/cyqstats *.pyx *.pxd *.pyi
@@ -0,0 +1,73 @@
1
+ Metadata-Version: 2.4
2
+ Name: cyqstats
3
+ Version: 0.1.0
4
+ Summary: Streaming statistics and grouped aggregations for large event streams
5
+ Author: Cyquant Contributors
6
+ License: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: numpy>=1.23
11
+ Provides-Extra: dev
12
+ Requires-Dist: pytest>=7.4; extra == "dev"
13
+ Requires-Dist: Cython>=3.0; extra == "dev"
14
+ Dynamic: license-file
15
+
16
+ # Cyqstats
17
+
18
+ **Cyqstats** es una librería para cálculo de métricas en streaming orientada a datasets grandes.
19
+
20
+ ## Estado actual (MVP)
21
+
22
+ Este repositorio ya incluye la base funcional para avanzar:
23
+
24
+ - `StreamStats` para agregaciones incrementales globales:
25
+ - `count`, `sum`, `mean`, `min`, `max`, `var`, `std`.
26
+ - `GroupedStreamStats` para agregaciones por grupo (`int32` recomendado en tu pipeline):
27
+ - `add(group_ids, values)`, `merge(...)`, `to_dict()`, `result_arrays()`.
28
+ - Merge estable por fórmula de momentos (Welford combinable), ideal para procesar por chunks.
29
+
30
+ ## Quickstart
31
+
32
+ ```python
33
+ from random import Random
34
+ from cyqstats import StreamStats, GroupedStreamStats
35
+
36
+ rng = Random(42)
37
+ values = [rng.gauss(0, 1) for _ in range(100_000)]
38
+
39
+ # Global
40
+ s = StreamStats()
41
+ s.add_values(values)
42
+ print(s.result())
43
+
44
+ # Grouped
45
+ gids = [i % 50 for i in range(len(values))]
46
+ g = GroupedStreamStats(n_groups=50)
47
+ g.add(gids, values)
48
+ print(g.result_arrays()["mean"][:5])
49
+ ```
50
+
51
+ ## Instalación local
52
+
53
+ ```bash
54
+ pip install -U pip
55
+ pip install -e ".[dev]"
56
+ ```
57
+
58
+ ## Tests
59
+
60
+ ```bash
61
+ PYTHONPATH=src pytest -q
62
+ ```
63
+
64
+ ## Próximos pasos recomendados
65
+
66
+ 1. **Cythonizar el hot path** (`add_values` y `add`) manteniendo esta API.
67
+ 2. Agregar percentiles streaming (P² como primera implementación).
68
+ 3. Añadir benchmark CLI comparando contra `pandas.groupby`.
69
+ 4. Publicar wheels (`manylinux`, `macOS`, `Windows`).
70
+
71
+ ## Licencia
72
+
73
+ MIT.
@@ -0,0 +1,25 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61", "wheel", "Cython>=3.0", "numpy>=1.23"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "cyqstats"
7
+ version = "0.1.0"
8
+ description = "Streaming statistics and grouped aggregations for large event streams"
9
+ readme = "readme.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "Cyquant Contributors" }]
13
+ dependencies = ["numpy>=1.23"]
14
+
15
+ [project.optional-dependencies]
16
+ dev = ["pytest>=7.4", "Cython>=3.0"]
17
+
18
+ [tool.setuptools]
19
+ package-dir = {"" = "src"}
20
+
21
+ [tool.setuptools.packages.find]
22
+ where = ["src"]
23
+
24
+ [tool.pytest.ini_options]
25
+ testpaths = ["tests"]
@@ -0,0 +1,58 @@
1
+ # Cyqstats
2
+
3
+ **Cyqstats** es una librería para cálculo de métricas en streaming orientada a datasets grandes.
4
+
5
+ ## Estado actual (MVP)
6
+
7
+ Este repositorio ya incluye la base funcional para avanzar:
8
+
9
+ - `StreamStats` para agregaciones incrementales globales:
10
+ - `count`, `sum`, `mean`, `min`, `max`, `var`, `std`.
11
+ - `GroupedStreamStats` para agregaciones por grupo (`int32` recomendado en tu pipeline):
12
+ - `add(group_ids, values)`, `merge(...)`, `to_dict()`, `result_arrays()`.
13
+ - Merge estable por fórmula de momentos (Welford combinable), ideal para procesar por chunks.
14
+
15
+ ## Quickstart
16
+
17
+ ```python
18
+ from random import Random
19
+ from cyqstats import StreamStats, GroupedStreamStats
20
+
21
+ rng = Random(42)
22
+ values = [rng.gauss(0, 1) for _ in range(100_000)]
23
+
24
+ # Global
25
+ s = StreamStats()
26
+ s.add_values(values)
27
+ print(s.result())
28
+
29
+ # Grouped
30
+ gids = [i % 50 for i in range(len(values))]
31
+ g = GroupedStreamStats(n_groups=50)
32
+ g.add(gids, values)
33
+ print(g.result_arrays()["mean"][:5])
34
+ ```
35
+
36
+ ## Instalación local
37
+
38
+ ```bash
39
+ pip install -U pip
40
+ pip install -e ".[dev]"
41
+ ```
42
+
43
+ ## Tests
44
+
45
+ ```bash
46
+ PYTHONPATH=src pytest -q
47
+ ```
48
+
49
+ ## Próximos pasos recomendados
50
+
51
+ 1. **Cythonizar el hot path** (`add_values` y `add`) manteniendo esta API.
52
+ 2. Agregar percentiles streaming (P² como primera implementación).
53
+ 3. Añadir benchmark CLI comparando contra `pandas.groupby`.
54
+ 4. Publicar wheels (`manylinux`, `macOS`, `Windows`).
55
+
56
+ ## Licencia
57
+
58
+ MIT.
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,25 @@
1
+ from setuptools import setup, Extension
2
+ from Cython.Build import cythonize
3
+ import numpy as np
4
+
5
+ extensions = [
6
+ Extension(
7
+ "cyqstats._cycore",
8
+ ["src/cyqstats/_cycore.pyx"],
9
+ include_dirs=[np.get_include()],
10
+ )
11
+ ]
12
+
13
+ setup(
14
+ ext_modules=cythonize(
15
+ extensions,
16
+ compiler_directives={
17
+ "language_level": "3",
18
+ "boundscheck": False,
19
+ "wraparound": False,
20
+ "cdivision": True,
21
+ "nonecheck": False,
22
+ "initializedcheck": False,
23
+ },
24
+ )
25
+ )
@@ -0,0 +1,6 @@
1
+ """Cyquant public API."""
2
+
3
+ from .core import StreamStats
4
+ from .grouped import GroupedStreamStats
5
+
6
+ __all__ = ["StreamStats", "GroupedStreamStats"]