cash-lib 0.1.1__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 (105) hide show
  1. cash_lib-0.1.1/.gitignore +198 -0
  2. cash_lib-0.1.1/LICENSE +21 -0
  3. cash_lib-0.1.1/PKG-INFO +224 -0
  4. cash_lib-0.1.1/README.md +115 -0
  5. cash_lib-0.1.1/pyproject.toml +255 -0
  6. cash_lib-0.1.1/src/cash/__init__.py +424 -0
  7. cash_lib-0.1.1/src/cash/__main__.py +371 -0
  8. cash_lib-0.1.1/src/cash/_agent_guide.py +125 -0
  9. cash_lib-0.1.1/src/cash/analytics.py +317 -0
  10. cash_lib-0.1.1/src/cash/backends/__init__.py +36 -0
  11. cash_lib-0.1.1/src/cash/backends/_base.py +515 -0
  12. cash_lib-0.1.1/src/cash/backends/adaptive_caps.py +172 -0
  13. cash_lib-0.1.1/src/cash/backends/cascading_backend.py +144 -0
  14. cash_lib-0.1.1/src/cash/backends/factory.py +287 -0
  15. cash_lib-0.1.1/src/cash/backends/file_backend.py +773 -0
  16. cash_lib-0.1.1/src/cash/backends/lazy.py +80 -0
  17. cash_lib-0.1.1/src/cash/backends/memory_backend.py +280 -0
  18. cash_lib-0.1.1/src/cash/backends/redis_backend.py +209 -0
  19. cash_lib-0.1.1/src/cash/backends/s3_backend.py +192 -0
  20. cash_lib-0.1.1/src/cash/backends/serialization.py +90 -0
  21. cash_lib-0.1.1/src/cash/backends/sqlite_backend.py +314 -0
  22. cash_lib-0.1.1/src/cash/backends/tiered_backend.py +257 -0
  23. cash_lib-0.1.1/src/cash/config.py +696 -0
  24. cash_lib-0.1.1/src/cash/core.py +4529 -0
  25. cash_lib-0.1.1/src/cash/data_source.py +90 -0
  26. cash_lib-0.1.1/src/cash/dependency_state.py +194 -0
  27. cash_lib-0.1.1/src/cash/exceptions.py +179 -0
  28. cash_lib-0.1.1/src/cash/experimental/__init__.py +76 -0
  29. cash_lib-0.1.1/src/cash/graph.py +103 -0
  30. cash_lib-0.1.1/src/cash/logging.py +111 -0
  31. cash_lib-0.1.1/src/cash/nbconvert.py +109 -0
  32. cash_lib-0.1.1/src/cash/notebook/README.md +48 -0
  33. cash_lib-0.1.1/src/cash/notebook/__init__.py +31 -0
  34. cash_lib-0.1.1/src/cash/notebook/_protocols.py +263 -0
  35. cash_lib-0.1.1/src/cash/notebook/_trace.py +60 -0
  36. cash_lib-0.1.1/src/cash/notebook/analysis.py +763 -0
  37. cash_lib-0.1.1/src/cash/notebook/annotations.py +229 -0
  38. cash_lib-0.1.1/src/cash/notebook/audit.py +165 -0
  39. cash_lib-0.1.1/src/cash/notebook/badge_renderer/__init__.py +28 -0
  40. cash_lib-0.1.1/src/cash/notebook/badge_renderer/_badge.py +52 -0
  41. cash_lib-0.1.1/src/cash/notebook/badge_renderer/_reasons.py +75 -0
  42. cash_lib-0.1.1/src/cash/notebook/badge_renderer/_text.py +33 -0
  43. cash_lib-0.1.1/src/cash/notebook/badge_renderer/renderers/__init__.py +10 -0
  44. cash_lib-0.1.1/src/cash/notebook/badge_renderer/renderers/_pytoken.py +59 -0
  45. cash_lib-0.1.1/src/cash/notebook/badge_renderer/renderers/html.py +2123 -0
  46. cash_lib-0.1.1/src/cash/notebook/badge_renderer/renderers/text.py +305 -0
  47. cash_lib-0.1.1/src/cash/notebook/badge_renderer/theme.py +151 -0
  48. cash_lib-0.1.1/src/cash/notebook/badge_renderer/view.py +362 -0
  49. cash_lib-0.1.1/src/cash/notebook/badge_renderer/view_builder.py +1153 -0
  50. cash_lib-0.1.1/src/cash/notebook/cache_key.py +460 -0
  51. cash_lib-0.1.1/src/cash/notebook/cache_status.py +51 -0
  52. cash_lib-0.1.1/src/cash/notebook/cacheability.py +3522 -0
  53. cash_lib-0.1.1/src/cash/notebook/cacheability_decision.py +269 -0
  54. cash_lib-0.1.1/src/cash/notebook/compiled_source.py +48 -0
  55. cash_lib-0.1.1/src/cash/notebook/consumables.py +226 -0
  56. cash_lib-0.1.1/src/cash/notebook/control_structures/__init__.py +50 -0
  57. cash_lib-0.1.1/src/cash/notebook/control_structures/for_handler.py +634 -0
  58. cash_lib-0.1.1/src/cash/notebook/control_structures/helpers.py +425 -0
  59. cash_lib-0.1.1/src/cash/notebook/control_structures/if_handler.py +225 -0
  60. cash_lib-0.1.1/src/cash/notebook/control_structures/processor.py +456 -0
  61. cash_lib-0.1.1/src/cash/notebook/control_structures/try_handler.py +377 -0
  62. cash_lib-0.1.1/src/cash/notebook/cost_model.py +169 -0
  63. cash_lib-0.1.1/src/cash/notebook/file_dep_snapshot.py +198 -0
  64. cash_lib-0.1.1/src/cash/notebook/file_tracker.py +560 -0
  65. cash_lib-0.1.1/src/cash/notebook/function_tracker.py +1408 -0
  66. cash_lib-0.1.1/src/cash/notebook/ipython/__init__.py +21 -0
  67. cash_lib-0.1.1/src/cash/notebook/ipython/_args.py +80 -0
  68. cash_lib-0.1.1/src/cash/notebook/ipython/_types.py +49 -0
  69. cash_lib-0.1.1/src/cash/notebook/ipython/admin.py +1091 -0
  70. cash_lib-0.1.1/src/cash/notebook/ipython/cell_executor.py +1215 -0
  71. cash_lib-0.1.1/src/cash/notebook/ipython/error_display.py +120 -0
  72. cash_lib-0.1.1/src/cash/notebook/ipython/magics.py +1686 -0
  73. cash_lib-0.1.1/src/cash/notebook/lineage_store.py +116 -0
  74. cash_lib-0.1.1/src/cash/notebook/module_invalidator.py +378 -0
  75. cash_lib-0.1.1/src/cash/notebook/object_hashing.py +256 -0
  76. cash_lib-0.1.1/src/cash/notebook/provenance.py +317 -0
  77. cash_lib-0.1.1/src/cash/notebook/purity.py +321 -0
  78. cash_lib-0.1.1/src/cash/notebook/randomness.py +1907 -0
  79. cash_lib-0.1.1/src/cash/notebook/restore.py +250 -0
  80. cash_lib-0.1.1/src/cash/notebook/server_discovery.py +607 -0
  81. cash_lib-0.1.1/src/cash/notebook/statement/__init__.py +49 -0
  82. cash_lib-0.1.1/src/cash/notebook/statement/_metadata.py +65 -0
  83. cash_lib-0.1.1/src/cash/notebook/statement/derivation_edges.py +284 -0
  84. cash_lib-0.1.1/src/cash/notebook/statement/file_deps.py +209 -0
  85. cash_lib-0.1.1/src/cash/notebook/statement/freshness.py +204 -0
  86. cash_lib-0.1.1/src/cash/notebook/statement/lineage.py +379 -0
  87. cash_lib-0.1.1/src/cash/notebook/statement/miss_guard.py +285 -0
  88. cash_lib-0.1.1/src/cash/notebook/statement/processor.py +3289 -0
  89. cash_lib-0.1.1/src/cash/notebook/statement/restore.py +369 -0
  90. cash_lib-0.1.1/src/cash/notebook/upstream/__init__.py +33 -0
  91. cash_lib-0.1.1/src/cash/notebook/upstream/_types.py +253 -0
  92. cash_lib-0.1.1/src/cash/notebook/upstream/checker.py +1826 -0
  93. cash_lib-0.1.1/src/cash/notebook/upstream/mismatch_classifier.py +1012 -0
  94. cash_lib-0.1.1/src/cash/notebook/upstream/reexecution_planner.py +1072 -0
  95. cash_lib-0.1.1/src/cash/notebook/upstream/simulator.py +834 -0
  96. cash_lib-0.1.1/src/cash/notebook/upstream/stateful_carriers.py +107 -0
  97. cash_lib-0.1.1/src/cash/notebook/upstream/virtual_lineage.py +2560 -0
  98. cash_lib-0.1.1/src/cash/purity_analyzer.py +1150 -0
  99. cash_lib-0.1.1/src/cash/py.typed +0 -0
  100. cash_lib-0.1.1/src/cash/ui/__init__.py +27 -0
  101. cash_lib-0.1.1/src/cash/ui/dashboard.py +140 -0
  102. cash_lib-0.1.1/src/cash/ui/debugger.py +199 -0
  103. cash_lib-0.1.1/src/cash/ui/explorer.py +670 -0
  104. cash_lib-0.1.1/src/cash/ui/visualizer.py +255 -0
  105. cash_lib-0.1.1/src/cash/utils.py +215 -0
@@ -0,0 +1,198 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Jupyter Notebook
55
+ .ipynb_checkpoints
56
+
57
+ # pyenv
58
+ .python-version
59
+
60
+ # celery beat schedule file
61
+ celerybeat-schedule
62
+
63
+ # SageMath parsed files
64
+ *.sage.py
65
+
66
+ # Environments
67
+ .env
68
+ .venv*
69
+ env/
70
+ venv/
71
+ ENV/
72
+ env.bak/
73
+ venv.bak/
74
+
75
+ # Spyder project settings
76
+ .spyderproject
77
+ .spyproject
78
+
79
+ # Rope project settings
80
+ .ropeproject
81
+
82
+ # mkdocs documentation
83
+ /site
84
+
85
+ # mypy
86
+ .mypy_cache/
87
+ .dmypy.json
88
+ dmypy.json
89
+
90
+ # Pyre type checker
91
+ .pyre/
92
+
93
+ # pytype static type analyzer
94
+ .pytype/
95
+
96
+ # Cython debug symbols
97
+ cython_debug/
98
+
99
+ # IDE
100
+ .idea/
101
+ .vscode/
102
+
103
+ # Debug/reproduction artifacts
104
+ repro_*.py
105
+ reproduce_*.py
106
+ verify_*.py
107
+ inspect_*.py
108
+ debug.log
109
+ *.db
110
+ .cache_test_repro/
111
+ .cash_test/
112
+ repro_cache/
113
+ test_async_cache/
114
+ test_persistence_cache/
115
+
116
+ # Cache directories (runtime artifacts)
117
+ .cash/
118
+ examples/.cash/
119
+ examples/async_cache/
120
+ examples/cascading_cache/
121
+ examples/demo_explorer_cache/
122
+ examples/demo_ipywidgets_cache/
123
+ examples/demo_widget_cache/
124
+ examples/my_cache/
125
+ examples/notebook_cache_demo/
126
+ examples/pipeline_cache/
127
+ examples/test_reproduce_cache/
128
+
129
+ # Large data files (downloaded / synthesized by example notebooks; may land
130
+ # under examples/ or the repo root depending on the notebook's cwd).
131
+ large_financial_data.csv
132
+ /data/
133
+
134
+ # Ad-hoc test outputs written to the repo root by example notebook cells
135
+ # (file_tracking_demo and similar). Pattern is anchored at root so it
136
+ # doesn't catch legitimate fixtures like examples/test_file_dep.csv.
137
+ /test_data.csv
138
+ /test_data.txt
139
+ /test_numpy.txt
140
+ /test_path.txt
141
+
142
+ # Archived examples (development experiments)
143
+ examples/archive/
144
+
145
+ # Desloppify local state
146
+ .desloppify/
147
+
148
+ # Private planning documents
149
+ planning/
150
+
151
+ # Build artifacts
152
+ dist/
153
+ *.egg-info/
154
+
155
+ # Editor / OS artifacts
156
+ .DS_Store
157
+ Thumbs.db
158
+
159
+
160
+
161
+ WORKING_MEMORY.md
162
+
163
+ # Temp output / IDE internals
164
+ test_output.txt
165
+ .claude/
166
+
167
+ # Large example data files (not tracked in git)
168
+ examples/large_scale_projects/data/
169
+ examples/large_scale_projects/examples/
170
+
171
+ /design/
172
+
173
+ # Bench outputs (raw artifacts) — directory contents are gitignored, but the
174
+ # frozen cost-model dataset is committed so the shipped constants are
175
+ # reproducible. Note: ignoring `dir/` blocks descent, so we ignore `dir/*`
176
+ # (everything inside) and then re-include the one file we want.
177
+ benchmarks/results/*
178
+ !benchmarks/results/ser_deser_matrix.frozen.csv
179
+
180
+ # Bench scratch outputs (cost-model fit working files, etc.)
181
+ benchmarks/_*scratch*
182
+
183
+ # Planning / findings docs written by exploratory dev sessions — not part
184
+ # of the published repo (matches the `docs/superpowers/` and `.github/planning/`
185
+ # convention used elsewhere).
186
+ examples/large_scale_projects/FINDINGS.md
187
+ examples/large_scale_projects/PROJECT_PLAN.md
188
+
189
+ # Superpowers working docs (specs/plans/notes; not part of the public repo)
190
+ docs/superpowers/
191
+
192
+ # Integration-test analysis tooling lives in covtools/ (tracked), but its
193
+ # generated artifacts are not version-controlled: covrun/ holds coverage runs,
194
+ # removal lists, and keep/redundant sets; the inventory files are regenerated
195
+ # by analyze_integration_tests.py. Run the tooling to recreate them locally.
196
+ covrun/
197
+ /integration_inventory.json
198
+ /integration_inventory.md
cash_lib-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Cash Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: cash-lib
3
+ Version: 0.1.1
4
+ Summary: Smart caching for Python — automatic dependency tracking, persistent backends, and statement-level Jupyter notebook caching.
5
+ Project-URL: Homepage, https://github.com/galgtonold/cash
6
+ Project-URL: Documentation, https://cash-lib.readthedocs.io/
7
+ Project-URL: Bug Tracker, https://github.com/galgtonold/cash/issues
8
+ Project-URL: Changelog, https://github.com/galgtonold/cash/blob/main/CHANGELOG.md
9
+ Author: Cash Contributors
10
+ License: MIT License
11
+
12
+ Copyright (c) 2025-2026 Cash Contributors
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Keywords: cache,caching,data-science,decorator,dependency-tracking,incremental-computation,ipython,jupyter,machine-learning,memoization,notebook,pandas
33
+ Classifier: Development Status :: 4 - Beta
34
+ Classifier: Framework :: IPython
35
+ Classifier: Framework :: Jupyter
36
+ Classifier: Intended Audience :: Developers
37
+ Classifier: Intended Audience :: Science/Research
38
+ Classifier: License :: OSI Approved :: MIT License
39
+ Classifier: Operating System :: OS Independent
40
+ Classifier: Programming Language :: Python :: 3
41
+ Classifier: Programming Language :: Python :: 3.10
42
+ Classifier: Programming Language :: Python :: 3.11
43
+ Classifier: Programming Language :: Python :: 3.12
44
+ Classifier: Programming Language :: Python :: 3.13
45
+ Classifier: Programming Language :: Python :: 3.14
46
+ Classifier: Topic :: Scientific/Engineering
47
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
48
+ Requires-Python: >=3.10
49
+ Provides-Extra: all
50
+ Requires-Dist: boto3<2,>=1.26; extra == 'all'
51
+ Requires-Dist: cloudpickle<4,>=2.0; extra == 'all'
52
+ Requires-Dist: ipynbname>=0.1; extra == 'all'
53
+ Requires-Dist: ipython<10,>=8.0; extra == 'all'
54
+ Requires-Dist: ipywidgets<9,>=7.0; extra == 'all'
55
+ Requires-Dist: matplotlib<4,>=3.5; extra == 'all'
56
+ Requires-Dist: pandas; extra == 'all'
57
+ Requires-Dist: polars<3,>=1.0; extra == 'all'
58
+ Requires-Dist: psutil<7,>=5.0; extra == 'all'
59
+ Requires-Dist: pyarrow>=13.0; extra == 'all'
60
+ Requires-Dist: redis<6,>=4.0; extra == 'all'
61
+ Provides-Extra: cloudpickle
62
+ Requires-Dist: cloudpickle<4,>=2.0; extra == 'cloudpickle'
63
+ Provides-Extra: dev
64
+ Requires-Dist: ipykernel; extra == 'dev'
65
+ Requires-Dist: jupyter-client; extra == 'dev'
66
+ Requires-Dist: nbclient; extra == 'dev'
67
+ Requires-Dist: nest-asyncio; extra == 'dev'
68
+ Requires-Dist: pandas; extra == 'dev'
69
+ Requires-Dist: pyarrow>=13.0; extra == 'dev'
70
+ Requires-Dist: pyinstrument<6,>=4.6; extra == 'dev'
71
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
72
+ Requires-Dist: pytest-rerunfailures; extra == 'dev'
73
+ Requires-Dist: pytest-subtests; extra == 'dev'
74
+ Requires-Dist: pytest-timeout; extra == 'dev'
75
+ Requires-Dist: pytest-xdist; extra == 'dev'
76
+ Requires-Dist: pytest>=8.0; extra == 'dev'
77
+ Requires-Dist: scipy; extra == 'dev'
78
+ Requires-Dist: traitlets; extra == 'dev'
79
+ Provides-Extra: docs
80
+ Requires-Dist: mkdocs-material>=9.0; extra == 'docs'
81
+ Requires-Dist: mkdocs-mermaid2-plugin>=1.2; extra == 'docs'
82
+ Requires-Dist: mkdocs>=1.5; extra == 'docs'
83
+ Requires-Dist: mkdocstrings[python]>=0.24; extra == 'docs'
84
+ Provides-Extra: docs-test
85
+ Requires-Dist: aiohttp>=3.9; extra == 'docs-test'
86
+ Requires-Dist: boto3>=1.28; extra == 'docs-test'
87
+ Requires-Dist: fakeredis>=2.0; extra == 'docs-test'
88
+ Requires-Dist: redis<6,>=4.0; extra == 'docs-test'
89
+ Provides-Extra: ipynbname
90
+ Requires-Dist: ipynbname>=0.1; extra == 'ipynbname'
91
+ Provides-Extra: memory
92
+ Requires-Dist: psutil<7,>=5.0; extra == 'memory'
93
+ Provides-Extra: notebook
94
+ Requires-Dist: ipython<10,>=8.0; extra == 'notebook'
95
+ Provides-Extra: pandas
96
+ Requires-Dist: pandas; extra == 'pandas'
97
+ Requires-Dist: pyarrow>=13.0; extra == 'pandas'
98
+ Provides-Extra: polars
99
+ Requires-Dist: polars<3,>=1.0; extra == 'polars'
100
+ Provides-Extra: redis
101
+ Requires-Dist: redis<6,>=4.0; extra == 'redis'
102
+ Provides-Extra: s3
103
+ Requires-Dist: boto3<2,>=1.26; extra == 's3'
104
+ Provides-Extra: sqlite
105
+ Provides-Extra: viz
106
+ Requires-Dist: ipywidgets<9,>=7.0; extra == 'viz'
107
+ Requires-Dist: matplotlib<4,>=3.5; extra == 'viz'
108
+ Description-Content-Type: text/markdown
109
+
110
+ # Cash — stop re-running notebooks that haven't changed
111
+
112
+ [![PyPI version](https://img.shields.io/pypi/v/cash-lib.svg)](https://pypi.org/project/cash-lib/)
113
+ [![Downloads](https://img.shields.io/pypi/dm/cash-lib.svg)](https://pypi.org/project/cash-lib/)
114
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://pypi.org/project/cash-lib/)
115
+ [![CI](https://github.com/galgtonold/cash/actions/workflows/ci.yml/badge.svg)](https://github.com/galgtonold/cash/actions/workflows/ci.yml)
116
+ [![Docs](https://readthedocs.org/projects/cash-lib/badge/?version=latest)](https://cash-lib.readthedocs.io/en/latest/)
117
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
118
+ [![Status: Beta](https://img.shields.io/badge/status-beta-orange.svg)](#status)
119
+
120
+ > **Two lines. Zero config. Restart-and-run-all in seconds instead of minutes.**
121
+
122
+ ```python
123
+ import cash
124
+ %cash_on
125
+ ```
126
+
127
+ That's it. The next time you re-run the notebook, every statement that hasn't changed is **restored from cache** instead of recomputed.
128
+
129
+ 📺 **Watch the 90-second demo** — Cash caching a real notebook, end to end:
130
+
131
+ https://github.com/user-attachments/assets/3f376660-aeb5-4794-89cc-532a04f82f32
132
+
133
+ **Or try it live in your browser** — no install:
134
+
135
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/galgtonold/cash/blob/main/examples/try_cash_colab.ipynb) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/galgtonold/cash/main?labpath=examples/try_cash_binder.ipynb)
136
+
137
+ **[Read the docs →](https://cash-lib.readthedocs.io/en/latest/)**
138
+
139
+ ---
140
+
141
+ ## Why Cash is different
142
+
143
+ Most caching tools cache *cells* or *function calls*. Cash caches **statements** — the individual lines inside a cell — and tracks the dependency graph between them.
144
+
145
+ - **Statement-level, not cell-level.** Change one line in a 20-line cell → that line and its dependents recompute. The other 19 stay cached.
146
+ - **Dependency-aware.** Cash builds a lineage graph. Touch `config` → only cells that read `config` (transitively) re-run.
147
+ - **File-aware.** Cash intercepts `pd.read_csv`, `np.load`, `open`, etc. Replace `data.csv` → dependent cells recompute automatically.
148
+ - **Mutation-aware.** `df.append(...)` and `+=` are detected, so you don't get stale reads.
149
+ - **Survives kernel restarts.** The cache lives on disk by default. Restart, run the cell, get the value back instantly.
150
+ - **Zero-config.** `%cash_on` and you're done. No decorators, no config file.
151
+
152
+ Cash saves time on **re-runs** — restoring an unchanged result instead of recomputing it, not speeding the first execution up. The more a statement costs to compute relative to the size of its result, the more a restore saves; `%cash_stats` reports your actual numbers, and says so plainly when caching cost you time. See the [benchmarks](https://cash-lib.readthedocs.io/en/latest/benchmarks/) for how that plays out on real workloads.
153
+
154
+ ---
155
+
156
+ ## Install
157
+
158
+ ```bash
159
+ pip install cash-lib
160
+ ```
161
+
162
+ Optional extras: `pip install "cash-lib[all]"` (pandas, polars, redis, s3, …). See [installation](https://cash-lib.readthedocs.io/en/latest/getting-started/installation/).
163
+
164
+ ## Quick start
165
+
166
+ **Cell 1** — turn it on:
167
+
168
+ ```python
169
+ import cash
170
+ %cash_on
171
+ ```
172
+
173
+ **Cell 2** — your normal code:
174
+
175
+ ```python
176
+ import pandas as pd
177
+ df = pd.read_csv("large_dataset.csv") # tracked: file change → recompute
178
+ summary = df.describe()
179
+ ```
180
+
181
+ Re-run the notebook:
182
+
183
+ - ✅ Nothing changed → restored from cache instantly.
184
+ - 🔄 `large_dataset.csv` changed → the cells that read it recompute.
185
+ - ⚡ Only the analysis changed → the load stays cached, only the analysis recomputes.
186
+
187
+ Cash shows a badge above each cell summarizing what it did — see [Reading the Cash badge](https://cash-lib.readthedocs.io/en/latest/badges/).
188
+
189
+ ## Beyond notebooks
190
+
191
+ `@cash.cache` caches any Python function across processes, with the same dependency- and file-awareness. Impure functions (LLM calls, HTTP, file writes) are flagged by default, since their side effects only run on the first call.
192
+
193
+ ```python
194
+ import cash
195
+
196
+ @cash.cache
197
+ def expensive(x):
198
+ return x ** 2 + sum(range(x))
199
+ ```
200
+
201
+ Full walkthrough in [the decorator guide](https://cash-lib.readthedocs.io/en/latest/decorator/).
202
+
203
+ ---
204
+
205
+ ## Learn more
206
+
207
+ - [Documentation home](https://cash-lib.readthedocs.io/en/latest/) · [Why Cash?](https://cash-lib.readthedocs.io/en/latest/why-cash/) · [Quick start](https://cash-lib.readthedocs.io/en/latest/getting-started/quickstart/)
208
+ - [Reading the badge](https://cash-lib.readthedocs.io/en/latest/badges/) · [Magic commands](https://cash-lib.readthedocs.io/en/latest/magics/) · [Annotations](https://cash-lib.readthedocs.io/en/latest/annotations/)
209
+ - [The decorator](https://cash-lib.readthedocs.io/en/latest/decorator/) · [Backends](https://cash-lib.readthedocs.io/en/latest/api/backends/) · [Command-line interface](https://cash-lib.readthedocs.io/en/latest/cli/)
210
+ - [Known limitations](https://cash-lib.readthedocs.io/en/latest/known-limitations/) · [Benchmarks](https://cash-lib.readthedocs.io/en/latest/benchmarks/) · [Versioning & compatibility](https://cash-lib.readthedocs.io/en/latest/versioning/)
211
+
212
+ ## Status
213
+
214
+ **Beta.** `0.1.1` is the first public release. The public API is stabilizing, but this is a `0.x` release — the cache format may still change between minor versions, so run `%cash_repair --full` after upgrading (see [versioning & compatibility](https://cash-lib.readthedocs.io/en/latest/versioning/)). The [known limitations](https://cash-lib.readthedocs.io/en/latest/known-limitations/) are documented honestly.
215
+
216
+ Bug reports welcome: the badge has a "Report a bug" button, `%cash_feedback` prints how, or open an [issue](https://github.com/galgtonold/cash/issues).
217
+
218
+ ## Contributing
219
+
220
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Good first issues are [tagged on the tracker](https://github.com/galgtonold/cash/issues?q=label%3A%22good+first+issue%22).
221
+
222
+ ## License
223
+
224
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,115 @@
1
+ # Cash — stop re-running notebooks that haven't changed
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/cash-lib.svg)](https://pypi.org/project/cash-lib/)
4
+ [![Downloads](https://img.shields.io/pypi/dm/cash-lib.svg)](https://pypi.org/project/cash-lib/)
5
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://pypi.org/project/cash-lib/)
6
+ [![CI](https://github.com/galgtonold/cash/actions/workflows/ci.yml/badge.svg)](https://github.com/galgtonold/cash/actions/workflows/ci.yml)
7
+ [![Docs](https://readthedocs.org/projects/cash-lib/badge/?version=latest)](https://cash-lib.readthedocs.io/en/latest/)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
9
+ [![Status: Beta](https://img.shields.io/badge/status-beta-orange.svg)](#status)
10
+
11
+ > **Two lines. Zero config. Restart-and-run-all in seconds instead of minutes.**
12
+
13
+ ```python
14
+ import cash
15
+ %cash_on
16
+ ```
17
+
18
+ That's it. The next time you re-run the notebook, every statement that hasn't changed is **restored from cache** instead of recomputed.
19
+
20
+ 📺 **Watch the 90-second demo** — Cash caching a real notebook, end to end:
21
+
22
+ https://github.com/user-attachments/assets/3f376660-aeb5-4794-89cc-532a04f82f32
23
+
24
+ **Or try it live in your browser** — no install:
25
+
26
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/galgtonold/cash/blob/main/examples/try_cash_colab.ipynb) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/galgtonold/cash/main?labpath=examples/try_cash_binder.ipynb)
27
+
28
+ **[Read the docs →](https://cash-lib.readthedocs.io/en/latest/)**
29
+
30
+ ---
31
+
32
+ ## Why Cash is different
33
+
34
+ Most caching tools cache *cells* or *function calls*. Cash caches **statements** — the individual lines inside a cell — and tracks the dependency graph between them.
35
+
36
+ - **Statement-level, not cell-level.** Change one line in a 20-line cell → that line and its dependents recompute. The other 19 stay cached.
37
+ - **Dependency-aware.** Cash builds a lineage graph. Touch `config` → only cells that read `config` (transitively) re-run.
38
+ - **File-aware.** Cash intercepts `pd.read_csv`, `np.load`, `open`, etc. Replace `data.csv` → dependent cells recompute automatically.
39
+ - **Mutation-aware.** `df.append(...)` and `+=` are detected, so you don't get stale reads.
40
+ - **Survives kernel restarts.** The cache lives on disk by default. Restart, run the cell, get the value back instantly.
41
+ - **Zero-config.** `%cash_on` and you're done. No decorators, no config file.
42
+
43
+ Cash saves time on **re-runs** — restoring an unchanged result instead of recomputing it, not speeding the first execution up. The more a statement costs to compute relative to the size of its result, the more a restore saves; `%cash_stats` reports your actual numbers, and says so plainly when caching cost you time. See the [benchmarks](https://cash-lib.readthedocs.io/en/latest/benchmarks/) for how that plays out on real workloads.
44
+
45
+ ---
46
+
47
+ ## Install
48
+
49
+ ```bash
50
+ pip install cash-lib
51
+ ```
52
+
53
+ Optional extras: `pip install "cash-lib[all]"` (pandas, polars, redis, s3, …). See [installation](https://cash-lib.readthedocs.io/en/latest/getting-started/installation/).
54
+
55
+ ## Quick start
56
+
57
+ **Cell 1** — turn it on:
58
+
59
+ ```python
60
+ import cash
61
+ %cash_on
62
+ ```
63
+
64
+ **Cell 2** — your normal code:
65
+
66
+ ```python
67
+ import pandas as pd
68
+ df = pd.read_csv("large_dataset.csv") # tracked: file change → recompute
69
+ summary = df.describe()
70
+ ```
71
+
72
+ Re-run the notebook:
73
+
74
+ - ✅ Nothing changed → restored from cache instantly.
75
+ - 🔄 `large_dataset.csv` changed → the cells that read it recompute.
76
+ - ⚡ Only the analysis changed → the load stays cached, only the analysis recomputes.
77
+
78
+ Cash shows a badge above each cell summarizing what it did — see [Reading the Cash badge](https://cash-lib.readthedocs.io/en/latest/badges/).
79
+
80
+ ## Beyond notebooks
81
+
82
+ `@cash.cache` caches any Python function across processes, with the same dependency- and file-awareness. Impure functions (LLM calls, HTTP, file writes) are flagged by default, since their side effects only run on the first call.
83
+
84
+ ```python
85
+ import cash
86
+
87
+ @cash.cache
88
+ def expensive(x):
89
+ return x ** 2 + sum(range(x))
90
+ ```
91
+
92
+ Full walkthrough in [the decorator guide](https://cash-lib.readthedocs.io/en/latest/decorator/).
93
+
94
+ ---
95
+
96
+ ## Learn more
97
+
98
+ - [Documentation home](https://cash-lib.readthedocs.io/en/latest/) · [Why Cash?](https://cash-lib.readthedocs.io/en/latest/why-cash/) · [Quick start](https://cash-lib.readthedocs.io/en/latest/getting-started/quickstart/)
99
+ - [Reading the badge](https://cash-lib.readthedocs.io/en/latest/badges/) · [Magic commands](https://cash-lib.readthedocs.io/en/latest/magics/) · [Annotations](https://cash-lib.readthedocs.io/en/latest/annotations/)
100
+ - [The decorator](https://cash-lib.readthedocs.io/en/latest/decorator/) · [Backends](https://cash-lib.readthedocs.io/en/latest/api/backends/) · [Command-line interface](https://cash-lib.readthedocs.io/en/latest/cli/)
101
+ - [Known limitations](https://cash-lib.readthedocs.io/en/latest/known-limitations/) · [Benchmarks](https://cash-lib.readthedocs.io/en/latest/benchmarks/) · [Versioning & compatibility](https://cash-lib.readthedocs.io/en/latest/versioning/)
102
+
103
+ ## Status
104
+
105
+ **Beta.** `0.1.1` is the first public release. The public API is stabilizing, but this is a `0.x` release — the cache format may still change between minor versions, so run `%cash_repair --full` after upgrading (see [versioning & compatibility](https://cash-lib.readthedocs.io/en/latest/versioning/)). The [known limitations](https://cash-lib.readthedocs.io/en/latest/known-limitations/) are documented honestly.
106
+
107
+ Bug reports welcome: the badge has a "Report a bug" button, `%cash_feedback` prints how, or open an [issue](https://github.com/galgtonold/cash/issues).
108
+
109
+ ## Contributing
110
+
111
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Good first issues are [tagged on the tracker](https://github.com/galgtonold/cash/issues?q=label%3A%22good+first+issue%22).
112
+
113
+ ## License
114
+
115
+ MIT — see [LICENSE](LICENSE).