Metadata-Version: 2.4
Name: tnl-intelligence
Version: 0.1.0
Summary: Typed synchronous and asynchronous Python SDK for The Neural Ledger intelligence API.
Project-URL: Homepage, https://theneuralledger.com
Project-URL: Repository, https://github.com/bekirdag/tnl-intelligence
Project-URL: Documentation, https://github.com/bekirdag/tnl-intelligence#readme
Project-URL: Issues, https://github.com/bekirdag/tnl-intelligence/issues
Author: The Neural Ledger
License-Expression: MIT
Keywords: api,intelligence,news,research,trading
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.15; extra == 'dev'
Requires-Dist: nbclient<1,>=0.10; extra == 'dev'
Requires-Dist: nbformat<6,>=5.10; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Requires-Dist: ruff>=0.11; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
Provides-Extra: notebooks
Requires-Dist: ipykernel<8,>=6.29; extra == 'notebooks'
Requires-Dist: nbclient<1,>=0.10; extra == 'notebooks'
Requires-Dist: nbformat<6,>=5.10; extra == 'notebooks'
Provides-Extra: quant
Requires-Dist: duckdb<2,>=1.1; extra == 'quant'
Requires-Dist: pandas<4,>=2.2; extra == 'quant'
Requires-Dist: polars<2,>=1.20; extra == 'quant'
Requires-Dist: pyarrow<26,>=18; extra == 'quant'
Requires-Dist: pyyaml<7,>=6; extra == 'quant'
Provides-Extra: quant-arrow
Requires-Dist: pyarrow<26,>=18; extra == 'quant-arrow'
Provides-Extra: quant-cli
Requires-Dist: pyyaml<7,>=6; extra == 'quant-cli'
Provides-Extra: quant-duckdb
Requires-Dist: duckdb<2,>=1.1; extra == 'quant-duckdb'
Provides-Extra: quant-pandas
Requires-Dist: pandas<4,>=2.2; extra == 'quant-pandas'
Provides-Extra: quant-polars
Requires-Dist: polars<2,>=1.20; extra == 'quant-polars'
Description-Content-Type: text/markdown

# tnl-intelligence

Typed synchronous and asynchronous Python clients for The Neural Ledger event and evidence intelligence API.

```python
import os
from tnl_intelligence import TnlClient

with TnlClient(os.environ["TNL_API_KEY"]) as client:
    for story in client.iterate_news(published_since="2026-07-01T00:00:00Z"):
        print(story.title, story.impacted_assets)
```

```python
import os
from tnl_intelligence import AsyncTnlClient

async with AsyncTnlClient(os.environ["TNL_API_KEY"]) as client:
    page = await client.search_news("semiconductor export restrictions")
```

TNL supplies event, claim, source, contradiction, entity, and impact-path intelligence. The `/v1/markets` response is contextual display data, not an execution-grade quote feed.

## Webhook Verification

Verify the exact raw request bytes before parsing JSON:

```python
from tnl_intelligence import verify_webhook

verified = verify_webhook(raw_body, headers, {key_id: webhook_secret})
```

Persist delivery IDs for the replay window before performing consumer side
effects. The helper accepts a mutable delivery-ID set for local tests; production
consumers should use an atomic durable claim.

## Point-in-Time Quant Research

Install optional engines without adding them to the base SDK:

```bash
python -m pip install 'tnl-intelligence[quant,notebooks]'
```

```python
from tnl_intelligence.quant.lake import RevisionLake
from tnl_intelligence.quant.sample import sample_observations
from tnl_intelligence.quant.temporal import parse_utc

lake = RevisionLake("./data/tnl")
lake.ingest(sample_observations())
snapshot = lake.snapshot(as_of=parse_utc("2026-06-08T00:00:00Z"))
```

The toolkit preserves immutable revisions, UTC availability boundaries,
deterministic manifests, leakage findings, optional Parquet/DuckDB/dataframe
adapters, event studies with user-supplied outcomes, and executable synthetic
notebooks. It does not execute or recommend trades. See the
[quantitative research toolkit guide](../../docs/quant-research-toolkit.md).
