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