refresh-engine 1.0.1__tar.gz → 2.0.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.
Files changed (36) hide show
  1. refresh_engine-2.0.0/PKG-INFO +247 -0
  2. refresh_engine-2.0.0/README.md +215 -0
  3. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/pyproject.toml +13 -13
  4. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/pyproject.toml.orig +167 -167
  5. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/__init__.py +6 -1
  6. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/_internal/context.py +35 -5
  7. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/_internal/execution.py +7 -2
  8. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/_internal/pipeline.py +15 -4
  9. refresh_engine-2.0.0/src/refresh_engine/_internal/redaction.py +116 -0
  10. refresh_engine-2.0.0/src/refresh_engine/_internal/states.py +31 -0
  11. refresh_engine-2.0.0/src/refresh_engine/_internal/values.py +200 -0
  12. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/engine.py +82 -141
  13. refresh_engine-2.0.0/src/refresh_engine/events.py +693 -0
  14. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/fingerprints.py +20 -7
  15. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/models.py +36 -7
  16. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/observability.py +83 -38
  17. refresh_engine-2.0.0/src/refresh_engine/otel.py +313 -0
  18. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/scheduling.py +14 -5
  19. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/selectors.py +123 -123
  20. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/stores.py +67 -62
  21. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/testing.py +15 -3
  22. refresh_engine-1.0.1/PKG-INFO +0 -207
  23. refresh_engine-1.0.1/README.md +0 -174
  24. refresh_engine-1.0.1/src/refresh_engine/_internal/values.py +0 -97
  25. refresh_engine-1.0.1/src/refresh_engine/events.py +0 -333
  26. refresh_engine-1.0.1/src/refresh_engine/otel.py +0 -193
  27. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/LICENSE +0 -0
  28. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/_internal/__init__.py +0 -0
  29. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/_internal/concurrency.py +0 -0
  30. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/_internal/coordinator.py +0 -0
  31. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/_internal/observation.py +0 -0
  32. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/_internal/planning.py +0 -0
  33. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/_internal/reentrancy.py +0 -0
  34. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/contracts.py +0 -0
  35. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/errors.py +0 -0
  36. {refresh_engine-1.0.1 → refresh_engine-2.0.0}/src/refresh_engine/py.typed +0 -0
@@ -0,0 +1,247 @@
1
+ Metadata-Version: 2.4
2
+ Name: refresh-engine
3
+ Version: 2.0.0
4
+ Summary: Asyncio-first, domain-neutral change detection and dependency-aware refresh orchestration for Python.
5
+ Keywords: asyncio,change-detection,dependency-graph,fingerprint,incremental,orchestration,refresh,scheduler,synchronization
6
+ Author: S. Muni Harish
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Framework :: AsyncIO
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: 3.15
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Typing :: Typed
21
+ Requires-Dist: structlog>=26.1.0
22
+ Requires-Dist: tenacity>=9.2.1
23
+ Requires-Dist: opentelemetry-api>=1.45.2,<2 ; extra == 'otel'
24
+ Requires-Python: >=3.12
25
+ Project-URL: Homepage, https://github.com/smuniharish/refresh-engine
26
+ Project-URL: Documentation, https://refresh-engine.readthedocs.io
27
+ Project-URL: Repository, https://github.com/smuniharish/refresh-engine
28
+ Project-URL: Issues, https://github.com/smuniharish/refresh-engine/issues
29
+ Project-URL: Changelog, https://refresh-engine.readthedocs.io/en/latest/changelog/
30
+ Provides-Extra: otel
31
+ Description-Content-Type: text/markdown
32
+
33
+ # refresh-engine
34
+
35
+ [![PyPI](https://img.shields.io/pypi/v/refresh-engine)](https://pypi.org/project/refresh-engine/)
36
+ [![Python](https://img.shields.io/pypi/pyversions/refresh-engine)](https://pypi.org/project/refresh-engine/)
37
+ [![CI](https://github.com/smuniharish/refresh-engine/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/smuniharish/refresh-engine/actions/workflows/ci.yml)
38
+ [![Documentation](https://readthedocs.org/projects/refresh-engine/badge/?version=latest)](https://refresh-engine.readthedocs.io/en/latest/)
39
+ [![License](https://img.shields.io/pypi/l/refresh-engine)](https://github.com/smuniharish/refresh-engine/blob/HEAD/LICENSE)
40
+
41
+ **Keep anything in sync with its source by refreshing only what changed.**
42
+
43
+ refresh-engine is an asyncio-first, domain-neutral Python library for keeping
44
+ derived data current: search indexes, caches, embeddings, configuration,
45
+ registries, or anything else built from a source. You describe how to list and
46
+ read resources and how to apply a change; the engine detects what changed,
47
+ plans the work in dependency order, runs it safely, and remembers the outcome.
48
+
49
+ <picture>
50
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/smuniharish/refresh-engine/HEAD/docs/assets/diagrams/pipeline-dark.png">
51
+ <img alt="Discover, observe, detect changes, plan, execute, and persist" src="https://raw.githubusercontent.com/smuniharish/refresh-engine/HEAD/docs/assets/diagrams/pipeline-light.png">
52
+ </picture>
53
+
54
+ ## Features
55
+
56
+ - **Precise change detection.** Deterministic fingerprints detect added,
57
+ modified, and deleted resources. Reliable cheap indicators, such as ETags or
58
+ version tokens, skip reading unchanged resources entirely.
59
+ - **Four refresh modes.** Incremental, full, dependency-aware, and targeted
60
+ refreshes, with targets chosen by ID or by composable selectors.
61
+ - **Dependency ordering.** Dependencies are refreshed before their dependents,
62
+ changes propagate to everything that depends on them, and cycles are isolated.
63
+ - **Safe by default.** Bounded concurrency, retries with jittered exponential
64
+ backoff, timeouts, and fail-fast or best-effort policies. A partial discovery
65
+ never deletes anything, and failed work is retried by the next refresh.
66
+ - **Durable state.** State advances only for successful resources, in one atomic
67
+ commit per refresh. Use the in-memory store or plug in your own database.
68
+ - **Scheduling and overlap control.** A drift-free interval scheduler and
69
+ policies that coalesce, queue, skip, or supersede overlapping requests.
70
+ - **Observability.** Typed lifecycle events with correlation IDs, structured
71
+ logging through [structlog](https://www.structlog.org) with secret redaction,
72
+ metrics, and optional OpenTelemetry spans and metrics using application-owned
73
+ providers.
74
+ - **Lightweight and typed.** Fully type-annotated, with two runtime
75
+ dependencies: structlog and [tenacity](https://tenacity.readthedocs.io).
76
+
77
+ ## Installation
78
+
79
+ refresh-engine requires Python 3.12 or newer.
80
+
81
+ ```bash
82
+ pip install refresh-engine
83
+ ```
84
+
85
+ For the optional OpenTelemetry integration, install
86
+ `refresh-engine[otel]`. The extra adds the OpenTelemetry API; your application
87
+ provides the SDK and exporters.
88
+
89
+ ## Quick start
90
+
91
+ Implement a source that lists and reads resources, and an operation that applies
92
+ each change. The engine does the rest:
93
+
94
+ <!-- test -->
95
+ ```python
96
+ import asyncio
97
+
98
+ from refresh_engine import (
99
+ DiscoveryResult,
100
+ PlanAction,
101
+ RefreshEngine,
102
+ RefreshEngineConfig,
103
+ RefreshRequest,
104
+ Resource,
105
+ ResourceSnapshot,
106
+ ResourceSource,
107
+ )
108
+
109
+ CATALOG = {"apples": 120, "pears": 80}
110
+ SEARCH_INDEX: dict[str, int] = {}
111
+
112
+
113
+ class InventorySource(ResourceSource):
114
+ async def discover(self) -> DiscoveryResult:
115
+ return DiscoveryResult(Resource(item) for item in sorted(CATALOG))
116
+
117
+ async def snapshot(self, resource: Resource, /) -> ResourceSnapshot:
118
+ return ResourceSnapshot(
119
+ resource.resource_id, content=CATALOG[resource.resource_id]
120
+ )
121
+
122
+
123
+ async def update_index(
124
+ resource: Resource,
125
+ snapshot: ResourceSnapshot | None,
126
+ action: PlanAction,
127
+ request: RefreshRequest,
128
+ /,
129
+ ) -> None:
130
+ if action is PlanAction.DELETE:
131
+ SEARCH_INDEX.pop(resource.resource_id, None)
132
+ elif snapshot is not None:
133
+ SEARCH_INDEX[resource.resource_id] = snapshot.content
134
+
135
+
136
+ async def main() -> None:
137
+ async with RefreshEngine(
138
+ RefreshEngineConfig(source=InventorySource(), operation=update_index)
139
+ ) as engine:
140
+ first = await engine.refresh(RefreshRequest())
141
+ print(f"{first.status}: refreshed {first.refreshed_count}", SEARCH_INDEX)
142
+
143
+ CATALOG["pears"] = 75
144
+ del CATALOG["apples"]
145
+ second = await engine.refresh(RefreshRequest())
146
+ print(
147
+ f"{second.status}: modified {second.modified_count},"
148
+ f" deleted {second.deleted_count}",
149
+ SEARCH_INDEX,
150
+ )
151
+
152
+
153
+ asyncio.run(main())
154
+ ```
155
+
156
+ ```text
157
+ success: refreshed 2 {'apples': 120, 'pears': 80}
158
+ success: modified 1, deleted 1 {'pears': 75}
159
+ ```
160
+
161
+ The second refresh touches only the modified and the deleted resource. Continue
162
+ with the [getting started guide](https://refresh-engine.readthedocs.io/en/latest/getting-started/)
163
+ to add durable state, dependencies, scheduling, and logging.
164
+
165
+ ## Performance
166
+
167
+ The engine's overhead is small next to real I/O: with in-memory sources, a full
168
+ refresh of 100,000 resources takes about 3 seconds, and an incremental refresh
169
+ that finds nothing changed takes about half a second. See the
170
+ [benchmarks](https://github.com/smuniharish/refresh-engine/blob/HEAD/benchmarks/README.md)
171
+ for the method and details.
172
+
173
+ ## Downloads
174
+
175
+ <p>
176
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520sum%2528count%2529%2520v%2520FROM%2520pypi.pypi_downloads_per_day%2520WHERE%2520project%253D%2527refresh-engine%2527%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=downloads&amp;color=blue&amp;cacheSeconds=3600" alt="Total downloads"></a>
177
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520sum%2528count%2529%2520v%2520FROM%2520pypi.pypi_downloads_per_day%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520date%2520%253E%253D%2520toStartOfWeek%2528today%2528%2529%252C%25201%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=this%20week&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads this week"></a>
178
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520sum%2528count%2529%2520v%2520FROM%2520pypi.pypi_downloads_per_day%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520date%2520%253E%253D%2520toStartOfMonth%2528today%2528%2529%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=this%20month&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads this month"></a>
179
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520sum%2528count%2529%2520v%2520FROM%2520pypi.pypi_downloads_per_day%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520date%2520%253E%253D%2520toStartOfYear%2528today%2528%2529%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=this%20year&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads this year"></a>
180
+ </p>
181
+ <p>
182
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528toString%2528y%2529%252C%2520%2527%253A%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520toYear%2528date%2529%2520y%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day%2520WHERE%2520project%253D%2527refresh-engine%2527%2520GROUP%2520BY%2520y%2520ORDER%2520BY%2520y%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=by%20year&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by year"></a>
183
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527A%2527%2520AND%2520%2527A%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20A&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: A"></a>
184
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527B%2527%2520AND%2520%2527B%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20B&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: B"></a>
185
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527C%2527%2520AND%2520%2527C%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20C&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: C"></a>
186
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527D%2527%2520AND%2520%2527D%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20D&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: D"></a>
187
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527E%2527%2520AND%2520%2527E%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20E&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: E"></a>
188
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527F%2527%2520AND%2520%2527F%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20F&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: F"></a>
189
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527G%2527%2520AND%2520%2527G%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20G&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: G"></a>
190
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527H%2527%2520AND%2520%2527H%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20H&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: H"></a>
191
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527I%2527%2520AND%2520%2527I%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20I&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: I"></a>
192
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527J%2527%2520AND%2520%2527J%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20J&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: J"></a>
193
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527K%2527%2520AND%2520%2527K%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20K&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: K"></a>
194
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527L%2527%2520AND%2520%2527L%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20L&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: L"></a>
195
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527M%2527%2520AND%2520%2527M%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20M&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: M"></a>
196
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527N%2527%2520AND%2520%2527O%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20N-O&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: N-O"></a>
197
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527P%2527%2520AND%2520%2527P%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20P&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: P"></a>
198
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527R%2527%2520AND%2520%2527R%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20R&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: R"></a>
199
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527S%2527%2520AND%2520%2527S%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20S&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: S"></a>
200
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527T%2527%2520AND%2520%2527T%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20T&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: T"></a>
201
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527U%2527%2520AND%2520%2527Y%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20U-Y&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: U-Y"></a>
202
+ </p>
203
+
204
+ Counts come from the [ClickHouse public PyPI dataset](https://clickpy.clickhouse.com/dashboard/refresh-engine),
205
+ which refreshes daily, so they may be about a day behind. Shields caches badge
206
+ images for up to an hour, and GitHub may cache them longer. Weeks start on Monday
207
+ in UTC. Explore interactive charts on the
208
+ [ClickPy dashboard](https://clickpy.clickhouse.com/dashboard/refresh-engine).
209
+
210
+ ## Documentation
211
+
212
+ The [documentation](https://refresh-engine.readthedocs.io/en/latest/) covers:
213
+
214
+ - [Getting started](https://refresh-engine.readthedocs.io/en/latest/getting-started/)
215
+ and [concepts](https://refresh-engine.readthedocs.io/en/latest/concepts/)
216
+ - [Guides](https://refresh-engine.readthedocs.io/en/latest/guides/) for every
217
+ feature, including a
218
+ [production checklist](https://refresh-engine.readthedocs.io/en/latest/guides/production/)
219
+ - [Runnable examples](https://refresh-engine.readthedocs.io/en/latest/examples/),
220
+ including SQLite and PostgreSQL state stores
221
+ - The [API reference](https://refresh-engine.readthedocs.io/en/latest/api/)
222
+ - The [architecture](https://refresh-engine.readthedocs.io/en/latest/architecture/overview/)
223
+ and its guarantees
224
+
225
+ ## Agent Skills
226
+
227
+ Coding agents such as Claude Code, Codex, Cursor, and GitHub Copilot can use the
228
+ refresh-engine [Agent Skill](https://refresh-engine.readthedocs.io/en/latest/agent-skills/)
229
+ to integrate the library correctly:
230
+
231
+ ```bash
232
+ npx skills add https://github.com/smuniharish/refresh-engine/tree/master/refresh-engine-skills/skills/refresh-engine
233
+ ```
234
+
235
+ ## Contributing
236
+
237
+ Contributions are welcome. Read the
238
+ [contributing guide](https://github.com/smuniharish/refresh-engine/blob/HEAD/CONTRIBUTING.md),
239
+ and report vulnerabilities as described in the
240
+ [security policy](https://github.com/smuniharish/refresh-engine/blob/HEAD/SECURITY.md).
241
+ Notable changes are listed in the
242
+ [changelog](https://github.com/smuniharish/refresh-engine/blob/HEAD/CHANGELOG.md).
243
+
244
+ ## License
245
+
246
+ refresh-engine is licensed under the
247
+ [Apache License 2.0](https://github.com/smuniharish/refresh-engine/blob/HEAD/LICENSE).
@@ -0,0 +1,215 @@
1
+ # refresh-engine
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/refresh-engine)](https://pypi.org/project/refresh-engine/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/refresh-engine)](https://pypi.org/project/refresh-engine/)
5
+ [![CI](https://github.com/smuniharish/refresh-engine/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/smuniharish/refresh-engine/actions/workflows/ci.yml)
6
+ [![Documentation](https://readthedocs.org/projects/refresh-engine/badge/?version=latest)](https://refresh-engine.readthedocs.io/en/latest/)
7
+ [![License](https://img.shields.io/pypi/l/refresh-engine)](https://github.com/smuniharish/refresh-engine/blob/HEAD/LICENSE)
8
+
9
+ **Keep anything in sync with its source by refreshing only what changed.**
10
+
11
+ refresh-engine is an asyncio-first, domain-neutral Python library for keeping
12
+ derived data current: search indexes, caches, embeddings, configuration,
13
+ registries, or anything else built from a source. You describe how to list and
14
+ read resources and how to apply a change; the engine detects what changed,
15
+ plans the work in dependency order, runs it safely, and remembers the outcome.
16
+
17
+ <picture>
18
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/smuniharish/refresh-engine/HEAD/docs/assets/diagrams/pipeline-dark.png">
19
+ <img alt="Discover, observe, detect changes, plan, execute, and persist" src="https://raw.githubusercontent.com/smuniharish/refresh-engine/HEAD/docs/assets/diagrams/pipeline-light.png">
20
+ </picture>
21
+
22
+ ## Features
23
+
24
+ - **Precise change detection.** Deterministic fingerprints detect added,
25
+ modified, and deleted resources. Reliable cheap indicators, such as ETags or
26
+ version tokens, skip reading unchanged resources entirely.
27
+ - **Four refresh modes.** Incremental, full, dependency-aware, and targeted
28
+ refreshes, with targets chosen by ID or by composable selectors.
29
+ - **Dependency ordering.** Dependencies are refreshed before their dependents,
30
+ changes propagate to everything that depends on them, and cycles are isolated.
31
+ - **Safe by default.** Bounded concurrency, retries with jittered exponential
32
+ backoff, timeouts, and fail-fast or best-effort policies. A partial discovery
33
+ never deletes anything, and failed work is retried by the next refresh.
34
+ - **Durable state.** State advances only for successful resources, in one atomic
35
+ commit per refresh. Use the in-memory store or plug in your own database.
36
+ - **Scheduling and overlap control.** A drift-free interval scheduler and
37
+ policies that coalesce, queue, skip, or supersede overlapping requests.
38
+ - **Observability.** Typed lifecycle events with correlation IDs, structured
39
+ logging through [structlog](https://www.structlog.org) with secret redaction,
40
+ metrics, and optional OpenTelemetry spans and metrics using application-owned
41
+ providers.
42
+ - **Lightweight and typed.** Fully type-annotated, with two runtime
43
+ dependencies: structlog and [tenacity](https://tenacity.readthedocs.io).
44
+
45
+ ## Installation
46
+
47
+ refresh-engine requires Python 3.12 or newer.
48
+
49
+ ```bash
50
+ pip install refresh-engine
51
+ ```
52
+
53
+ For the optional OpenTelemetry integration, install
54
+ `refresh-engine[otel]`. The extra adds the OpenTelemetry API; your application
55
+ provides the SDK and exporters.
56
+
57
+ ## Quick start
58
+
59
+ Implement a source that lists and reads resources, and an operation that applies
60
+ each change. The engine does the rest:
61
+
62
+ <!-- test -->
63
+ ```python
64
+ import asyncio
65
+
66
+ from refresh_engine import (
67
+ DiscoveryResult,
68
+ PlanAction,
69
+ RefreshEngine,
70
+ RefreshEngineConfig,
71
+ RefreshRequest,
72
+ Resource,
73
+ ResourceSnapshot,
74
+ ResourceSource,
75
+ )
76
+
77
+ CATALOG = {"apples": 120, "pears": 80}
78
+ SEARCH_INDEX: dict[str, int] = {}
79
+
80
+
81
+ class InventorySource(ResourceSource):
82
+ async def discover(self) -> DiscoveryResult:
83
+ return DiscoveryResult(Resource(item) for item in sorted(CATALOG))
84
+
85
+ async def snapshot(self, resource: Resource, /) -> ResourceSnapshot:
86
+ return ResourceSnapshot(
87
+ resource.resource_id, content=CATALOG[resource.resource_id]
88
+ )
89
+
90
+
91
+ async def update_index(
92
+ resource: Resource,
93
+ snapshot: ResourceSnapshot | None,
94
+ action: PlanAction,
95
+ request: RefreshRequest,
96
+ /,
97
+ ) -> None:
98
+ if action is PlanAction.DELETE:
99
+ SEARCH_INDEX.pop(resource.resource_id, None)
100
+ elif snapshot is not None:
101
+ SEARCH_INDEX[resource.resource_id] = snapshot.content
102
+
103
+
104
+ async def main() -> None:
105
+ async with RefreshEngine(
106
+ RefreshEngineConfig(source=InventorySource(), operation=update_index)
107
+ ) as engine:
108
+ first = await engine.refresh(RefreshRequest())
109
+ print(f"{first.status}: refreshed {first.refreshed_count}", SEARCH_INDEX)
110
+
111
+ CATALOG["pears"] = 75
112
+ del CATALOG["apples"]
113
+ second = await engine.refresh(RefreshRequest())
114
+ print(
115
+ f"{second.status}: modified {second.modified_count},"
116
+ f" deleted {second.deleted_count}",
117
+ SEARCH_INDEX,
118
+ )
119
+
120
+
121
+ asyncio.run(main())
122
+ ```
123
+
124
+ ```text
125
+ success: refreshed 2 {'apples': 120, 'pears': 80}
126
+ success: modified 1, deleted 1 {'pears': 75}
127
+ ```
128
+
129
+ The second refresh touches only the modified and the deleted resource. Continue
130
+ with the [getting started guide](https://refresh-engine.readthedocs.io/en/latest/getting-started/)
131
+ to add durable state, dependencies, scheduling, and logging.
132
+
133
+ ## Performance
134
+
135
+ The engine's overhead is small next to real I/O: with in-memory sources, a full
136
+ refresh of 100,000 resources takes about 3 seconds, and an incremental refresh
137
+ that finds nothing changed takes about half a second. See the
138
+ [benchmarks](https://github.com/smuniharish/refresh-engine/blob/HEAD/benchmarks/README.md)
139
+ for the method and details.
140
+
141
+ ## Downloads
142
+
143
+ <p>
144
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520sum%2528count%2529%2520v%2520FROM%2520pypi.pypi_downloads_per_day%2520WHERE%2520project%253D%2527refresh-engine%2527%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=downloads&amp;color=blue&amp;cacheSeconds=3600" alt="Total downloads"></a>
145
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520sum%2528count%2529%2520v%2520FROM%2520pypi.pypi_downloads_per_day%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520date%2520%253E%253D%2520toStartOfWeek%2528today%2528%2529%252C%25201%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=this%20week&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads this week"></a>
146
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520sum%2528count%2529%2520v%2520FROM%2520pypi.pypi_downloads_per_day%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520date%2520%253E%253D%2520toStartOfMonth%2528today%2528%2529%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=this%20month&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads this month"></a>
147
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520sum%2528count%2529%2520v%2520FROM%2520pypi.pypi_downloads_per_day%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520date%2520%253E%253D%2520toStartOfYear%2528today%2528%2529%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=this%20year&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads this year"></a>
148
+ </p>
149
+ <p>
150
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528toString%2528y%2529%252C%2520%2527%253A%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520toYear%2528date%2529%2520y%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day%2520WHERE%2520project%253D%2527refresh-engine%2527%2520GROUP%2520BY%2520y%2520ORDER%2520BY%2520y%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=by%20year&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by year"></a>
151
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527A%2527%2520AND%2520%2527A%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20A&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: A"></a>
152
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527B%2527%2520AND%2520%2527B%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20B&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: B"></a>
153
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527C%2527%2520AND%2520%2527C%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20C&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: C"></a>
154
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527D%2527%2520AND%2520%2527D%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20D&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: D"></a>
155
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527E%2527%2520AND%2520%2527E%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20E&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: E"></a>
156
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527F%2527%2520AND%2520%2527F%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20F&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: F"></a>
157
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527G%2527%2520AND%2520%2527G%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20G&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: G"></a>
158
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527H%2527%2520AND%2520%2527H%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20H&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: H"></a>
159
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527I%2527%2520AND%2520%2527I%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20I&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: I"></a>
160
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527J%2527%2520AND%2520%2527J%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20J&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: J"></a>
161
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527K%2527%2520AND%2520%2527K%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20K&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: K"></a>
162
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527L%2527%2520AND%2520%2527L%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20L&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: L"></a>
163
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527M%2527%2520AND%2520%2527M%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20M&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: M"></a>
164
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527N%2527%2520AND%2520%2527O%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20N-O&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: N-O"></a>
165
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527P%2527%2520AND%2520%2527P%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20P&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: P"></a>
166
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527R%2527%2520AND%2520%2527R%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20R&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: R"></a>
167
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527S%2527%2520AND%2520%2527S%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20S&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: S"></a>
168
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527T%2527%2520AND%2520%2527T%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20T&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: T"></a>
169
+ <a href="https://clickpy.clickhouse.com/dashboard/refresh-engine"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsql-clickhouse.clickhouse.com%2F%3Fuser%3Ddemo%26query%3DSELECT%2520arrayStringConcat%2528groupArray%2528concat%2528country_code%252C%2520%2527%2520%2527%252C%2520toString%2528c%2529%2529%2529%252C%2520%2527%2520%257C%2520%2527%2529%2520v%2520FROM%2520%2528SELECT%2520country_code%252C%2520sum%2528count%2529%2520c%2520FROM%2520pypi.pypi_downloads_per_day_by_version_by_country%2520WHERE%2520project%253D%2527refresh-engine%2527%2520AND%2520substring%2528country_code%252C%25201%252C%25201%2529%2520BETWEEN%2520%2527U%2527%2520AND%2520%2527Y%2527%2520GROUP%2520BY%2520country_code%2520HAVING%2520sum%2528count%2529%2520%253E%25200%2520ORDER%2520BY%2520c%2520DESC%252C%2520country_code%2529%2520FORMAT%2520JSON&amp;query=%24.data%5B0%5D.v&amp;label=countries%20U-Y&amp;color=blue&amp;cacheSeconds=3600" alt="Downloads by country: U-Y"></a>
170
+ </p>
171
+
172
+ Counts come from the [ClickHouse public PyPI dataset](https://clickpy.clickhouse.com/dashboard/refresh-engine),
173
+ which refreshes daily, so they may be about a day behind. Shields caches badge
174
+ images for up to an hour, and GitHub may cache them longer. Weeks start on Monday
175
+ in UTC. Explore interactive charts on the
176
+ [ClickPy dashboard](https://clickpy.clickhouse.com/dashboard/refresh-engine).
177
+
178
+ ## Documentation
179
+
180
+ The [documentation](https://refresh-engine.readthedocs.io/en/latest/) covers:
181
+
182
+ - [Getting started](https://refresh-engine.readthedocs.io/en/latest/getting-started/)
183
+ and [concepts](https://refresh-engine.readthedocs.io/en/latest/concepts/)
184
+ - [Guides](https://refresh-engine.readthedocs.io/en/latest/guides/) for every
185
+ feature, including a
186
+ [production checklist](https://refresh-engine.readthedocs.io/en/latest/guides/production/)
187
+ - [Runnable examples](https://refresh-engine.readthedocs.io/en/latest/examples/),
188
+ including SQLite and PostgreSQL state stores
189
+ - The [API reference](https://refresh-engine.readthedocs.io/en/latest/api/)
190
+ - The [architecture](https://refresh-engine.readthedocs.io/en/latest/architecture/overview/)
191
+ and its guarantees
192
+
193
+ ## Agent Skills
194
+
195
+ Coding agents such as Claude Code, Codex, Cursor, and GitHub Copilot can use the
196
+ refresh-engine [Agent Skill](https://refresh-engine.readthedocs.io/en/latest/agent-skills/)
197
+ to integrate the library correctly:
198
+
199
+ ```bash
200
+ npx skills add https://github.com/smuniharish/refresh-engine/tree/master/refresh-engine-skills/skills/refresh-engine
201
+ ```
202
+
203
+ ## Contributing
204
+
205
+ Contributions are welcome. Read the
206
+ [contributing guide](https://github.com/smuniharish/refresh-engine/blob/HEAD/CONTRIBUTING.md),
207
+ and report vulnerabilities as described in the
208
+ [security policy](https://github.com/smuniharish/refresh-engine/blob/HEAD/SECURITY.md).
209
+ Notable changes are listed in the
210
+ [changelog](https://github.com/smuniharish/refresh-engine/blob/HEAD/CHANGELOG.md).
211
+
212
+ ## License
213
+
214
+ refresh-engine is licensed under the
215
+ [Apache License 2.0](https://github.com/smuniharish/refresh-engine/blob/HEAD/LICENSE).
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["uv_build>=0.13.9,<0.14"]
2
+ requires = ["uv_build>=0.13.10,<0.14"]
3
3
  build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "refresh-engine"
7
- version = "1.0.1"
7
+ version = "2.0.0"
8
8
  description = "Asyncio-first, domain-neutral change detection and dependency-aware refresh orchestration for Python."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -44,10 +44,7 @@ dependencies = [
44
44
  name = "S. Muni Harish"
45
45
 
46
46
  [project.optional-dependencies]
47
- otel = [
48
- "opentelemetry-api>=1.45.2,<2",
49
- "opentelemetry-sdk>=1.45.2,<2",
50
- ]
47
+ otel = ["opentelemetry-api>=1.45.2,<2"]
51
48
 
52
49
  [project.urls]
53
50
  Homepage = "https://github.com/smuniharish/refresh-engine"
@@ -58,20 +55,20 @@ Changelog = "https://refresh-engine.readthedocs.io/en/latest/changelog/"
58
55
 
59
56
  [dependency-groups]
60
57
  test = [
61
- "coverage[toml]>=7.17.3",
62
- "hypothesis>=6.170.15",
58
+ "coverage[toml]>=7.18.0",
59
+ "hypothesis>=6.170.26",
63
60
  "pytest>=9.2.0",
64
61
  "pytest-asyncio>=1.5.0",
65
62
  "pytest-cov>=7.1.0",
66
63
  "pytest-timeout>=2.4.0",
67
64
  "skills-ref>=0.1.1,<1",
68
65
  ]
69
- lint = ["ruff>=0.17.5"]
70
- types = ["pyrefly>=1.4.1"]
66
+ lint = ["ruff>=0.17.6"]
67
+ types = ["pyrefly>=1.5.0"]
71
68
  docs = [
72
- "griffe-pydantic>=1.3.2,<2",
73
- "mkdocstrings-python>=2.0.11,<3",
74
- "zensical>=0.1.2,<0.2",
69
+ { include-group = "lint" },
70
+ "griffelib>=2.4.1,<3",
71
+ "zensical>=0.1.4,<0.2",
75
72
  ]
76
73
  examples = ["psycopg[binary,pool]>=3.3.9,<4"]
77
74
  package = ["twine>=7.0.0"]
@@ -86,6 +83,9 @@ include-group = "lint"
86
83
  [[dependency-groups.dev]]
87
84
  include-group = "types"
88
85
 
86
+ [[dependency-groups.dev]]
87
+ include-group = "docs"
88
+
89
89
  [tool.uv]
90
90
  default-groups = ["dev"]
91
91