Metadata-Version: 2.4
Name: cfin
Version: 0.1.0
Summary: Python SDK for the hosted cfin CNBC finance data API.
Project-URL: Homepage, https://api.cfin.bluedoor.sh/v1/health
Project-URL: API, https://api.cfin.bluedoor.sh/v1/openapi.json
Project-URL: Documentation, https://github.com/bluedoor-ai/cfin#readme
Project-URL: Source, https://github.com/bluedoor-ai/cfin
Project-URL: Rate Limits, https://github.com/bluedoor-ai/cfin/blob/main/cfin/RATE_LIMIT_RESULTS.md
Author-email: BlueDoor <sam@bluedoor.sh>
License: MIT
Keywords: cfin,cnbc,finance,market-data,stocks
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
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: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: certifi>=2024.2.2
Description-Content-Type: text/markdown

# cfin

Python SDK for the hosted cfin CNBC finance data API.

The hosted API exposes CP2-confirmed public CNBC.com contracts behind a cached,
rate-limited REST surface. It is not affiliated with, endorsed by, or sponsored
by CNBC, Inc.

## Install

```bash
pip install cfin
```

## Quick Start

```python
from cfin import Client

client = Client(contact="you@example.com")

quotes = client.quotes(["AAPL", "MSFT"])
formatted = client.formatted_quotes(["AAPL", "MSFT"])
fair_value = client.fair_value()
options = client.options("AAPL")
financials = client.financials("AAPL", issue_id=36276, statement_type="INC")
results = client.search("apple")
raw = client.raw("cnbc.quote.formatted", params={"symbols": "MSFT"})
```

Convenience wrappers are also available:

```python
import cfin

data = cfin.quote("AAPL")
```

The legacy `cfin_client` import path is still included for compatibility.

## Common Methods

- `Client.endpoints()` and `Client.openapi()` expose discovery metadata.
- `Client.raw(endpoint_id, params=None)` calls any shipped contract by ID.
- `Client.quotes(symbols)` and `Client.formatted_quotes(symbols)` expose CNBC
  quote bundles.
- `Client.quote(symbol, view=None)` defaults to `/v1/quotes`; pass a view for
  `/v1/quote/{symbol}/{view}`.
- `Client.chart()`, `Client.earnings()`, `Client.earnings_trends()`,
  `Client.financials()`, `Client.key_stats()`, `Client.options()`,
  `Client.peers()`, `Client.profile()`, and `Client.range()` wrap the
  high-value quote sub-routes.
- `Client.fair_value()`, `Client.market_movers()`, `Client.market_tables()`,
  and `Client.popular_quotes()` expose CNBC market endpoints.

Set `CFIN_BASE_URL`, `CFIN_CONTACT`, or `CFIN_API_KEY` in the environment to
configure the default client.
