Metadata-Version: 2.5
Name: adanos-haystack
Version: 0.1.1
Summary: Adanos stock and crypto market sentiment tools for Haystack pipelines and agents
Project-URL: Documentation, https://api.adanos.org/docs
Project-URL: Issues, https://github.com/adanos-software/adanos-haystack/issues
Project-URL: Source, https://github.com/adanos-software/adanos-haystack
Author-email: Adanos <contact@adanos.org>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,crypto,haystack,market-sentiment,stocks
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
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: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.10
Requires-Dist: haystack-ai>=2.15.0
Requires-Dist: httpx>=0.27
Description-Content-Type: text/markdown

# Adanos for Haystack

`adanos-haystack` adds Adanos stock and crypto market sentiment to Haystack pipelines and agents.
It retrieves structured signals from Reddit, X / FinTwit, financial news, and Polymarket without
adding trading or portfolio logic.

## Installation

```bash
pip install adanos-haystack
```

Create an API key at [adanos.org/register](https://adanos.org/register) and provide it through the
`ADANOS_API_KEY` environment variable.

Free, Hobby, and Professional accounts use the same component. Adanos applies the request quota and
historical lookback available to the API key's plan. See [pricing](https://adanos.org/pricing) for the
current limits.

## Component

`AdanosMarketSentiment` supports:

- sentiment for one stock or crypto asset
- trending assets
- aggregate market sentiment
- comparison of multiple assets
- asset search
- dataset statistics

Stocks can use `reddit`, `x`, `news`, or `polymarket`. Crypto sentiment uses `reddit`.

```python
from haystack_integrations.components.tools.adanos import AdanosMarketSentiment

sentiment = AdanosMarketSentiment()
result = sentiment.run(
    operation="sentiment",
    asset_type="stock",
    source="news",
    symbol="NVDA",
    from_date="2026-07-01",
    to_date="2026-07-07",
)

print(result["result"])
```

The component supports synchronous `run` and asynchronous `run_async` calls.

## Pipeline

```python
from haystack import Pipeline
from haystack_integrations.components.tools.adanos import AdanosMarketSentiment

pipeline = Pipeline()
pipeline.add_component("sentiment", AdanosMarketSentiment())

result = pipeline.run(
    {
        "sentiment": {
            "operation": "trending",
            "asset_type": "stock",
            "source": "reddit",
            "limit": 5,
        }
    }
)
print(result["sentiment"]["result"])
```

## Agent Tool

Wrap the component with Haystack's `ComponentTool` so an Agent can choose the appropriate operation
and inputs:

```python
from haystack.tools import ComponentTool
from haystack_integrations.components.tools.adanos import AdanosMarketSentiment

adanos_tool = ComponentTool(
    component=AdanosMarketSentiment(),
    name="market_sentiment",
    description=(
        "Get current and historical stock or crypto market sentiment from Reddit, "
        "X / FinTwit, financial news, and Polymarket."
    ),
)
```

Pass `adanos_tool` to a Haystack `Agent` or a tool-capable Chat Generator.

## Authentication And Errors

The API key is stored as a Haystack `Secret` and sent only in the `X-API-Key` request header. HTTP
errors expose the status code and optional Adanos request ID, but never the API key or upstream
response body.

- API reference: [api.adanos.org/docs](https://api.adanos.org/docs)
- OpenAPI specification: [api.adanos.org/openapi.json](https://api.adanos.org/openapi.json)
- Adanos: [adanos.org](https://adanos.org/)

## Development

```bash
pip install hatch
hatch run fmt-check
hatch run test:all
```

## License

Apache-2.0
