Metadata-Version: 2.4
Name: tradinglookup
Version: 0.1.0
Summary: Zero-API-key Python SDK for TradingLookup CC BY 4.0 open financial datasets, REST API endpoints and MCP tools.
Author: TradingLookup
License: MIT
Project-URL: Homepage, https://tradinglookup.com
Project-URL: Documentation, https://tradinglookup.readthedocs.io/
Project-URL: Source, https://github.com/tradinglookup/tradinglookup
Project-URL: OpenAPI, https://tradinglookup.com/openapi.json
Project-URL: Data, https://tradinglookup.com/data/
Keywords: tradinglookup,prop-firms,cfd-loss-rates,economic-calendar,market-hours,crypto-exchanges,india-brokers,open-data,mcp
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: pandas
Requires-Dist: pandas>=2.0; extra == "pandas"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.6; extra == "docs"
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Dynamic: license-file

# tradinglookup

Zero-API-key Python SDK for TradingLookup open financial data, REST endpoints and read-only MCP tools.

- **No API key, no account, no required third-party dependencies** (Python 3.9+ standard library only).
- **Optional pandas support** via `pip install "tradinglookup[pandas]"`.
- **Open data hub:** <https://tradinglookup.com/data/>
- **AI & machine access guide:** <https://tradinglookup.com/for-ai-agents/>
- **Documentation:** <https://tradinglookup.readthedocs.io/>

## Install

```bash
pip install tradinglookup
```

With optional pandas `DataFrame` support:

```bash
pip install "tradinglookup[pandas]"
```

## Quickstart

```python
import tradinglookup as tl

# Discover all CC BY 4.0 datasets
catalog = tl.get_catalog()

# Compare two futures prop firms at $100,000
comparison = tl.compare_prop_firms("ftmo", "fundednext", account_size=100000)

# Look up one prop firm's terms
firm = tl.lookup_prop_firm("topstep", market="futures")

# Fetch retail CFD account loss rates (includes mandatory FCA COBS 22.5 warning)
cfd = tl.get_cfd_loss_rates()
print(cfd["risk_warning"])

# Check live market hours or scheduled central bank / macro releases
hours = tl.get_market_hours(exchange="nyse")
releases = tl.get_economic_releases(currency="USD", impact="high", limit=10)

# Call TradingLookup's read-only MCP endpoint directly
result = tl.mcp_call("is_market_open", {"exchange": "lse"})
```

Using a reusable client instance:

```python
from tradinglookup import TradingLookupClient

client = TradingLookupClient(timeout=15.0)
plans = client.get_prop_plans(market="futures")
changes = client.get_rule_changes("topstep")
```

## Pandas DataFrames

Tabular helpers accept `as_dataframe=True`, returning a `pandas.DataFrame` with `canonical_url`, `last_checked`, `license` (and `risk_warning` for CFD datasets) preserved in `df.attrs`:

```python
import tradinglookup as tl

df = tl.get_cfd_loss_rates(as_dataframe=True)
print(df[["broker", "loss_pct", "regulator"]].head())
print(df.attrs["risk_warning"])
print(df.attrs["canonical_url"])

# Or load any published CSV directly from /data/
csv_df = tl.read_csv("/data/cfd-loss-rates-live.csv", as_dataframe=True)
```

## CFD risk warning (FCA COBS 22.5)

Whenever you display or redistribute retail CFD loss-rate figures from TradingLookup, include the FCA COBS 22.5 risk warning verbatim:

> CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage.

## Licence and attribution (CC BY 4.0)

- **SDK code:** MIT Licence (see [LICENSE](LICENSE)).
- **Data:** Creative Commons Attribution 4.0 International ([CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)). When you publish, display or redistribute figures from TradingLookup, credit **TradingLookup** and link to the canonical dataset or facts page (for example <https://tradinglookup.com/data/>).

Every figure is read from each firm's or official body's own published pages on the date shown. This is reference data, not financial or trading advice.
