leancontext 2.0.0__py3-none-any.whl
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.
- leancontext/__init__.py +104 -0
- leancontext/cli.py +36 -0
- leancontext/core.py +214 -0
- leancontext/cost.py +104 -0
- leancontext/fidelity.py +108 -0
- leancontext/integrations/__init__.py +8 -0
- leancontext/integrations/_common.py +62 -0
- leancontext/integrations/anthropic_native.py +83 -0
- leancontext/integrations/clients.py +58 -0
- leancontext/integrations/decorator.py +103 -0
- leancontext/integrations/frameworks.py +58 -0
- leancontext/integrations/litellm.py +80 -0
- leancontext/integrations/mcp_server.py +64 -0
- leancontext/integrations/otel.py +78 -0
- leancontext/integrations/proxy.py +90 -0
- leancontext/messages.py +152 -0
- leancontext/paging.py +104 -0
- leancontext/py.typed +0 -0
- leancontext/reducers/__init__.py +36 -0
- leancontext/reducers/base.py +19 -0
- leancontext/reducers/diff.py +54 -0
- leancontext/reducers/html.py +64 -0
- leancontext/reducers/json_data.py +61 -0
- leancontext/reducers/logs.py +91 -0
- leancontext/reducers/stacktrace.py +59 -0
- leancontext/reducers/table.py +32 -0
- leancontext/tokens.py +79 -0
- leancontext-2.0.0.dist-info/METADATA +224 -0
- leancontext-2.0.0.dist-info/RECORD +32 -0
- leancontext-2.0.0.dist-info/WHEEL +4 -0
- leancontext-2.0.0.dist-info/entry_points.txt +2 -0
- leancontext-2.0.0.dist-info/licenses/LICENSE +190 -0
leancontext/tokens.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""Token counting.
|
|
2
|
+
|
|
3
|
+
By default LeanContext uses the best tokenizer available: if ``tiktoken`` is
|
|
4
|
+
installed it is used automatically for accurate counts, otherwise a fast
|
|
5
|
+
character-based estimate (about 4 characters per token) is used. You can also
|
|
6
|
+
plug in your own counter with ``set_token_counter`` or ``use_tiktoken(model)``.
|
|
7
|
+
|
|
8
|
+
Token counts only affect the reported numbers and the saving threshold, never the
|
|
9
|
+
reduced text, so the reduction is the same whichever tokenizer is active.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import hashlib
|
|
15
|
+
from collections.abc import Callable
|
|
16
|
+
|
|
17
|
+
_counter: Callable[[str], int] | None = None # explicit override, if set
|
|
18
|
+
_auto: Callable[[str], int] | None = None # resolved once, on first use
|
|
19
|
+
_auto_name = "unresolved"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def content_ref(text: str) -> str:
|
|
23
|
+
"""Short, stable content hash used as a handle for caching and paging."""
|
|
24
|
+
return hashlib.sha1(text.encode("utf-8")).hexdigest()[:12]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _heuristic(text: str) -> int:
|
|
28
|
+
return max(1, (len(text) + 3) // 4) # about 4 characters per token
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _resolve_auto() -> None:
|
|
32
|
+
"""Pick the default tokenizer once: tiktoken if present, else the estimate."""
|
|
33
|
+
global _auto, _auto_name
|
|
34
|
+
try:
|
|
35
|
+
import tiktoken
|
|
36
|
+
|
|
37
|
+
enc = tiktoken.get_encoding("cl100k_base")
|
|
38
|
+
|
|
39
|
+
def _tok(text: str) -> int:
|
|
40
|
+
return len(enc.encode(text, disallowed_special=()))
|
|
41
|
+
|
|
42
|
+
_auto, _auto_name = _tok, "tiktoken/cl100k_base"
|
|
43
|
+
except Exception:
|
|
44
|
+
_auto, _auto_name = _heuristic, "heuristic (~4 chars/token)"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def count_tokens(text: str) -> int:
|
|
48
|
+
"""Count the tokens in ``text`` using the active tokenizer."""
|
|
49
|
+
if _counter is not None:
|
|
50
|
+
return _counter(text)
|
|
51
|
+
if _auto is None:
|
|
52
|
+
_resolve_auto()
|
|
53
|
+
return _auto(text) # type: ignore[misc]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def set_token_counter(fn: Callable[[str], int] | None) -> None:
|
|
57
|
+
"""Set a custom token counter, or pass None to fall back to auto-detection."""
|
|
58
|
+
global _counter
|
|
59
|
+
_counter = fn
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def use_tiktoken(model: str = "gpt-4o") -> None:
|
|
63
|
+
"""Count tokens with tiktoken for a specific model. Requires the tiktoken extra."""
|
|
64
|
+
import tiktoken
|
|
65
|
+
|
|
66
|
+
try:
|
|
67
|
+
enc = tiktoken.encoding_for_model(model)
|
|
68
|
+
except KeyError:
|
|
69
|
+
enc = tiktoken.get_encoding("cl100k_base")
|
|
70
|
+
set_token_counter(lambda text: len(enc.encode(text, disallowed_special=())))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def active_tokenizer() -> str:
|
|
74
|
+
"""Name of the tokenizer currently in use."""
|
|
75
|
+
if _counter is not None:
|
|
76
|
+
return "custom"
|
|
77
|
+
if _auto is None:
|
|
78
|
+
_resolve_auto()
|
|
79
|
+
return _auto_name
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: leancontext
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Deterministic, type-aware reduction of agent tool outputs at the source. Cut LLM token cost without making the agent do less.
|
|
5
|
+
Project-URL: Homepage, https://github.com/pankajniet/LeanContext
|
|
6
|
+
Project-URL: Repository, https://github.com/pankajniet/LeanContext
|
|
7
|
+
Project-URL: Issues, https://github.com/pankajniet/LeanContext/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/pankajniet/LeanContext/blob/main/CHANGELOG.md
|
|
9
|
+
Author: Pankaj Pandey
|
|
10
|
+
License: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agents,compression,context,cost,llm,rag,tokens
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Python: >=3.14
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: mypy>=1.19; extra == 'dev'
|
|
23
|
+
Requires-Dist: opentelemetry-sdk>=1.39; extra == 'dev'
|
|
24
|
+
Requires-Dist: pytest-asyncio>=1.3; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-cov>=7; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest>=8.3; extra == 'dev'
|
|
27
|
+
Requires-Dist: ruff>=0.15; extra == 'dev'
|
|
28
|
+
Provides-Extra: integrations
|
|
29
|
+
Requires-Dist: anthropic>=0.87; extra == 'integrations'
|
|
30
|
+
Requires-Dist: fastapi>=0.125; extra == 'integrations'
|
|
31
|
+
Requires-Dist: httpx>=0.28; extra == 'integrations'
|
|
32
|
+
Requires-Dist: litellm>=1.82; extra == 'integrations'
|
|
33
|
+
Requires-Dist: openai>=2.14; extra == 'integrations'
|
|
34
|
+
Requires-Dist: starlette>=0.45; extra == 'integrations'
|
|
35
|
+
Provides-Extra: mcp
|
|
36
|
+
Requires-Dist: mcp>=1.0; extra == 'mcp'
|
|
37
|
+
Provides-Extra: otel
|
|
38
|
+
Requires-Dist: opentelemetry-api>=1.39; extra == 'otel'
|
|
39
|
+
Provides-Extra: tiktoken
|
|
40
|
+
Requires-Dist: tiktoken>=0.12; extra == 'tiktoken'
|
|
41
|
+
Description-Content-Type: text/markdown
|
|
42
|
+
|
|
43
|
+
<p align="center">
|
|
44
|
+
<img src="assets/logo.png" alt="LeanContext" width="460">
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
<p align="center">
|
|
48
|
+
<b>Trim the tool output your AI agent re-sends every turn. Keep the signal, drop the noise.</b>
|
|
49
|
+
</p>
|
|
50
|
+
|
|
51
|
+
<p align="center">
|
|
52
|
+
<a href="https://pypi.org/project/leancontext/"><img alt="PyPI" src="https://img.shields.io/pypi/v/leancontext.svg"></a>
|
|
53
|
+
<a href="LICENSE"><img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache--2.0-blue.svg"></a>
|
|
54
|
+
<img alt="Python 3.14+" src="https://img.shields.io/badge/python-3.14%2B-blue.svg">
|
|
55
|
+
<a href="https://github.com/pankajniet/LeanContext/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/pankajniet/LeanContext/actions/workflows/ci.yml/badge.svg"></a>
|
|
56
|
+
<a href="https://github.com/astral-sh/ruff"><img alt="Ruff" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"></a>
|
|
57
|
+
<img alt="mypy" src="https://img.shields.io/badge/types-mypy-blue.svg">
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
AI agents re-send every tool result (logs, JSON, diffs, stack traces, HTML) to the model on
|
|
63
|
+
every turn, and most of it is redundancy you pay for again and again. LeanContext sits between
|
|
64
|
+
your agent and the model and reduces those payloads to their signal: deterministically, with a
|
|
65
|
+
fidelity score on every reduction, and without ever breaking the agent.
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from leancontext import reduce
|
|
69
|
+
|
|
70
|
+
@reduce
|
|
71
|
+
def search_logs(query: str) -> str:
|
|
72
|
+
return run_log_search(query) # ~10k tokens of logs in, ~1k out, error lines kept
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## See it
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
$ python bench.py
|
|
79
|
+
sample kind before after saved fidelity
|
|
80
|
+
-----------------------------------------------------------------
|
|
81
|
+
log (incident) log 52642 100 100% 100%
|
|
82
|
+
json (RAG chunks) json 1862 1390 25% 100%
|
|
83
|
+
html (web fetch) html 1672 1093 35% 100%
|
|
84
|
+
diff (patch) diff 639 81 87% 100%
|
|
85
|
+
stacktrace stacktrace 896 94 90% 100%
|
|
86
|
+
-----------------------------------------------------------------
|
|
87
|
+
TOTAL 57711 2758 95%
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
A real incident log, before and after:
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
# before (902 lines)
|
|
94
|
+
2026-06-21T09:00:01Z INFO [gateway] req id=a1 path="/v1/render" status=200 ms=12
|
|
95
|
+
... 900 near-identical INFO lines ...
|
|
96
|
+
2026-06-21T09:10:43Z FATAL [render] OOM killed worker=7 doc="deck-8842" root cause
|
|
97
|
+
|
|
98
|
+
# after
|
|
99
|
+
2026-06-21T09:00:01Z INFO [gateway] req id=a1 path="/v1/render" status=200 ms=12 ⟪×900 similar⟫
|
|
100
|
+
2026-06-21T09:10:43Z FATAL [render] OOM killed worker=7 doc="deck-8842" root cause
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The redundant lines collapse to a count. The FATAL line that explains the crash is kept intact.
|
|
104
|
+
|
|
105
|
+
## Why it works
|
|
106
|
+
|
|
107
|
+
The model API is the bulk of an agent's cost, and most of that is *input* tokens. A tool result
|
|
108
|
+
added on one turn is re-sent on every later turn, so the bill grows with the length of the
|
|
109
|
+
conversation, not just the work done. Those payloads are mostly repetition. LeanContext keeps the
|
|
110
|
+
errors, anomalies, and identifiers, and collapses the rest.
|
|
111
|
+
|
|
112
|
+
## How it compares
|
|
113
|
+
|
|
114
|
+
| | LeanContext | LLM-based compressor | Wire-level proxy |
|
|
115
|
+
| -------------------------------- | :---------: | :------------------: | :--------------: |
|
|
116
|
+
| No model in the reduction path | ✓ | ✗ | varies |
|
|
117
|
+
| Deterministic | ✓ | ✗ | varies |
|
|
118
|
+
| Prompt-cache safe | ✓ | often ✗ | often ✗ |
|
|
119
|
+
| Type-aware (keeps error lines) | ✓ | ✗ | ✗ |
|
|
120
|
+
| Fidelity score per reduction | ✓ | ✗ | ✗ |
|
|
121
|
+
| Added latency / cost | none | a model call | a network hop |
|
|
122
|
+
|
|
123
|
+
## Install
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
pip install -e . # core, standard library only
|
|
127
|
+
pip install -e ".[integrations]" # openai, anthropic, litellm, fastapi adapters
|
|
128
|
+
pip install -e ".[otel]" # OpenTelemetry metrics
|
|
129
|
+
pip install -e ".[tiktoken]" # exact token counts (used automatically when present)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Use it
|
|
133
|
+
|
|
134
|
+
Three levels, one core. Every path fails open: if anything goes wrong, you get the original text back.
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
import leancontext
|
|
138
|
+
|
|
139
|
+
clean = leancontext.reduce(tool_output).text # 1) manual
|
|
140
|
+
|
|
141
|
+
@leancontext.reduce # 2) decorator, one line per tool
|
|
142
|
+
def search_logs(q: str) -> str:
|
|
143
|
+
...
|
|
144
|
+
|
|
145
|
+
tools = leancontext.wrap(tools) # 3) wrap all tools, or an SDK client
|
|
146
|
+
client = leancontext.wrap(openai_client) # (wrap_anthropic / wrap_gemini too)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Every reduction is inspectable:
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
r = leancontext.reduce(tool_output)
|
|
153
|
+
r.text # what to send to the model
|
|
154
|
+
r.tokens_before, r.tokens_after
|
|
155
|
+
r.ratio # fraction saved
|
|
156
|
+
r.fidelity # 0..1 signal preserved
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Integrations
|
|
160
|
+
|
|
161
|
+
| Surface | How |
|
|
162
|
+
| --- | --- |
|
|
163
|
+
| Decorator / tools | `@leancontext.reduce`, `leancontext.wrap(tools)` |
|
|
164
|
+
| OpenAI / Anthropic / Gemini SDK | `wrap_openai(c)`, `wrap_anthropic(c)`, `wrap_gemini(c)` |
|
|
165
|
+
| LiteLLM (proxy) | `callbacks: leancontext.integrations.litellm.proxy_handler_instance` |
|
|
166
|
+
| LiteLLM (SDK) | `import leancontext.integrations.litellm as ll; ll.patch()` |
|
|
167
|
+
| Standalone proxy | `from leancontext.integrations.proxy import create_app` (OpenAI-compatible, any language) |
|
|
168
|
+
| Messages | `leancontext.reduce_messages(messages)` (OpenAI, Anthropic, Gemini) |
|
|
169
|
+
| Telemetry | `import leancontext.integrations.otel as o; o.instrument()` |
|
|
170
|
+
| Anthropic native | `wrap_anthropic_native(client, ...)` composes with `clear_tool_uses` context editing |
|
|
171
|
+
| Frameworks | LangChain, LangGraph, Agno via `wrap(tools)`; any framework via `@reduce` on tool functions (sync or async) |
|
|
172
|
+
| MCP server | `python -m leancontext.integrations.mcp_server` — reduce / expand / stats over stdio |
|
|
173
|
+
|
|
174
|
+
## Reducers
|
|
175
|
+
|
|
176
|
+
| Kind | What it does |
|
|
177
|
+
| --- | --- |
|
|
178
|
+
| `log` | Collapse near-identical lines, keep every error, anomaly, and unique line verbatim |
|
|
179
|
+
| `json` | Factor repeated keys out once, lay values out columnar (near-lossless) |
|
|
180
|
+
| `diff` | Keep all change, hunk, and header lines, collapse unchanged context |
|
|
181
|
+
| `stacktrace` | Keep the exception and boundary frames, collapse the deep middle |
|
|
182
|
+
| `html` | Strip tags, scripts, and styles, keep visible text and links |
|
|
183
|
+
|
|
184
|
+
Anything else, or any payload below the size, saving, or fidelity thresholds, passes through unchanged.
|
|
185
|
+
|
|
186
|
+
## How it works
|
|
187
|
+
|
|
188
|
+
Each tool output flows through fail-open gates (hash, size check, type detection, the typed
|
|
189
|
+
reducer, then a saving and fidelity check) and returns either the reduced text or the original.
|
|
190
|
+
Results are cached by content hash, so a payload re-sent across turns is reduced only once.
|
|
191
|
+
See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for diagrams.
|
|
192
|
+
|
|
193
|
+
## Cost and telemetry
|
|
194
|
+
|
|
195
|
+
```python
|
|
196
|
+
from leancontext.cost import CostTracker
|
|
197
|
+
|
|
198
|
+
tracker = CostTracker(model="claude-sonnet-4-6").install()
|
|
199
|
+
# ... run your agent ...
|
|
200
|
+
tracker.report() # {tokens_saved, usd_saved, ratio, cache_safe: True}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Configuration
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
leancontext.disable() # global kill switch (or env LEANCONTEXT_DISABLED=1)
|
|
207
|
+
leancontext.reduce(x, min_saving=0.1, min_fidelity=0.85)
|
|
208
|
+
leancontext.on_reduction(callback) # telemetry hook (composable)
|
|
209
|
+
leancontext.use_tiktoken("gpt-4o") # force a specific model's tokenizer
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Roadmap
|
|
213
|
+
|
|
214
|
+
Accurate provider tokenizers by default, an MCP server, tested LangChain / LlamaIndex / CrewAI
|
|
215
|
+
adapters, broader Anthropic native interop, and a PyPI release.
|
|
216
|
+
|
|
217
|
+
## Contributing
|
|
218
|
+
|
|
219
|
+
Issues and PRs welcome. Run `pytest`. Reducers are pure functions, `str -> (reduced, notes)`,
|
|
220
|
+
and must be deterministic and value-preserving. See [AGENTS.md](AGENTS.md) for the design rules.
|
|
221
|
+
|
|
222
|
+
## License
|
|
223
|
+
|
|
224
|
+
[Apache-2.0](LICENSE)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
leancontext/__init__.py,sha256=pvbacCUBLLWDeV26ndMrtKQzOBI-LR4oPgzvV6Ke0Yw,2467
|
|
2
|
+
leancontext/cli.py,sha256=rloytVoYKMpRgA_HgWKTyAlvWN7G5Px0hkQfhJZiIR0,1355
|
|
3
|
+
leancontext/core.py,sha256=Fm760FGArHAWzBd72OnwOvfsiLHNxWDXh_TEL9mBulQ,7041
|
|
4
|
+
leancontext/cost.py,sha256=DbcQDx6l2-aPC9_DU2Hciu7EJtBpcJCHzKh2PTyMaJM,3831
|
|
5
|
+
leancontext/fidelity.py,sha256=HAFyO_IUn6wCR804C5rK-2Tkie9Ph0YiAj7AjqLPHrg,3593
|
|
6
|
+
leancontext/messages.py,sha256=Td1OylBz3U2BH174xIP7ekjRMVAyzsXrME5YPI8uklE,5650
|
|
7
|
+
leancontext/paging.py,sha256=9KtvTZRYMj3li9K9mVrOSLGGib55ottly45ypL66Qeo,3449
|
|
8
|
+
leancontext/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
leancontext/tokens.py,sha256=gFPSC97Ja44uH3axaKCefmHHsib9CJr_MsCFqZOEaCQ,2540
|
|
10
|
+
leancontext/integrations/__init__.py,sha256=crbtxKoTEMVFXXFiE70wab3UexoLOsZvPJhMy8IWmjQ,282
|
|
11
|
+
leancontext/integrations/_common.py,sha256=EeGbUGbdlkaTdOjXVX7QY-Fdkverumnbb_8dqzhUfZY,1958
|
|
12
|
+
leancontext/integrations/anthropic_native.py,sha256=MIFddBKEMieJzjsCaXpvK4zoidEZO7gs3k8TCoDel5o,3336
|
|
13
|
+
leancontext/integrations/clients.py,sha256=RXE9_4HJRpMsRte2hbtJMz_GT8vn4kztC4P1uKpdB7M,1939
|
|
14
|
+
leancontext/integrations/decorator.py,sha256=1YGxkEYY0R_0jUdYn8e_u4KEvsAa2jSRadDyBmTGd3M,3548
|
|
15
|
+
leancontext/integrations/frameworks.py,sha256=7k1dUAqy4th1kVSKfHQu9vDnKtLftRPK-u4Z6P4sBOA,1959
|
|
16
|
+
leancontext/integrations/litellm.py,sha256=ESpiAWmKkfDPeYFmQAilK15u9mjcc--kxqojWvofO10,2646
|
|
17
|
+
leancontext/integrations/mcp_server.py,sha256=kdbFbjyDuCyGLq383jC08b4_gVu4lC_nymrQm9MChjo,1919
|
|
18
|
+
leancontext/integrations/otel.py,sha256=mGtRHREyg114vJr7iywa_PHCvR-G5sdl9HSLG4ffeIM,3283
|
|
19
|
+
leancontext/integrations/proxy.py,sha256=2ePoAOnb9zzFe4aE_CjZNE77KA-mbSQQ14Eo4y7waio,3585
|
|
20
|
+
leancontext/reducers/__init__.py,sha256=bFF1CNHNZpfS3bokv9VARd1nZXRLs3P0v89--uNh4js,1080
|
|
21
|
+
leancontext/reducers/base.py,sha256=LR4jquQzD7QymT_HORRpZHyVhh68KKNqlD0hnpj5AT4,524
|
|
22
|
+
leancontext/reducers/diff.py,sha256=Q3UftO9Pd3w_NfRR3-8kd8tqxLTlz_lR-05MJCN_ssY,1479
|
|
23
|
+
leancontext/reducers/html.py,sha256=eukvfSpcV9hCatbgpayRDgS9Gm6sxwFTKrTpf9-QC0k,1814
|
|
24
|
+
leancontext/reducers/json_data.py,sha256=077G7NyIYXPsExAg05vbIjleORslIn_3MuQjpSit6GE,2064
|
|
25
|
+
leancontext/reducers/logs.py,sha256=21DRISCYExAW7c6TlP4z_NEWweV-AfItbIRi7_bsWzc,2956
|
|
26
|
+
leancontext/reducers/stacktrace.py,sha256=bOTQHSe_roomtVQO7wUt0hS3cEyWVqaraU4tTlOIia4,1886
|
|
27
|
+
leancontext/reducers/table.py,sha256=TAh2fcWOL6re05gXp8GD6Z0T_wasDaYgKscmXkLmAPQ,1044
|
|
28
|
+
leancontext-2.0.0.dist-info/METADATA,sha256=9mcig1dCBDYVILMFbGEZ3JEabR4takeiVNju2w4mkBo,9817
|
|
29
|
+
leancontext-2.0.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
30
|
+
leancontext-2.0.0.dist-info/entry_points.txt,sha256=F-z6fgKf3HSA4lQF7Z1FF7qI-_eNkjI3iykvx5VdWws,53
|
|
31
|
+
leancontext-2.0.0.dist-info/licenses/LICENSE,sha256=DHwm-PXPugUGVdIXY5VAQtW5LgBB9le5SuYY5Ikr8hI,10575
|
|
32
|
+
leancontext-2.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works.
|
|
111
|
+
|
|
112
|
+
You may add Your own copyright statement to Your modifications and
|
|
113
|
+
may provide additional or different license terms and conditions
|
|
114
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
115
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
116
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
117
|
+
the conditions stated in this License.
|
|
118
|
+
|
|
119
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
120
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
121
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
122
|
+
this License, without any additional terms or conditions.
|
|
123
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
124
|
+
the terms of any separate license agreement you may have executed
|
|
125
|
+
with Licensor regarding such Contributions.
|
|
126
|
+
|
|
127
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
128
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
129
|
+
except as required for reasonable and customary use in describing the
|
|
130
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
131
|
+
|
|
132
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
133
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
134
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
135
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
136
|
+
implied, including, without limitation, any warranties or conditions
|
|
137
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
138
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
139
|
+
appropriateness of using or redistributing the Work and assume any
|
|
140
|
+
risks associated with Your exercise of permissions under this License.
|
|
141
|
+
|
|
142
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
143
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
144
|
+
unless required by applicable law (such as deliberate and grossly
|
|
145
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
146
|
+
liable to You for damages, including any direct, indirect, special,
|
|
147
|
+
incidental, or consequential damages of any character arising as a
|
|
148
|
+
result of this License or out of the use or inability to use the
|
|
149
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
150
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
151
|
+
other commercial damages or losses), even if such Contributor
|
|
152
|
+
has been advised of the possibility of such damages.
|
|
153
|
+
|
|
154
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
155
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
156
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
157
|
+
or other liability obligations and/or rights consistent with this
|
|
158
|
+
License. However, in accepting such obligations, You may act only
|
|
159
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
160
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
161
|
+
defend, and hold each Contributor harmless for any liability
|
|
162
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
163
|
+
of your accepting any such warranty or additional liability.
|
|
164
|
+
|
|
165
|
+
END OF TERMS AND CONDITIONS
|
|
166
|
+
|
|
167
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
168
|
+
|
|
169
|
+
To apply the Apache License to your work, attach the following
|
|
170
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
171
|
+
replaced with your own identifying information. (Don't include
|
|
172
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
173
|
+
comment syntax for the file format. We also recommend that a
|
|
174
|
+
file or class name and description of purpose be included on the
|
|
175
|
+
same "printed page" as the copyright notice for easier
|
|
176
|
+
identification within third-party archives.
|
|
177
|
+
|
|
178
|
+
Copyright 2026 pankajniet
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|