Metadata-Version: 2.4
Name: pytradingview
Version: 0.1.0
Summary: A Python client for TradingView WebSocket API. It's a lightweight library capable of providing real-time data on stocks, cryptocurrencies, indices etc.
Home-page: https://github.com/kwesy/pytradingview.git
Author: Onesimus Graves-Sampson
Author-email: Onesimus Graves-Sampson <onesimusgravessampson1@gmail.com>
License-Expression: MIT
Keywords: tradingview,websocket,api,python,forex,stocks,crypto
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: websocket-client>=1.5.1
Dynamic: author
Dynamic: home-page
Dynamic: license-file

# pytradingview

A simple, open-source Python client for connecting to TradingView's WebSocket API.

## Features

- WebSocket connection management
- Simple send/receive interface
- Easy to extend for custom signals and data

## Dependencies
```bash
websocket-client
```

## Installation

```bash
pip install 
```

## Usage
```python
# example.py
from pytradingview import TVclient

# Create the client and chart
client = TVclient()
chart = client.Chart

# Set up the chart
chart.set_up_chart()

# Set the market
chart.set_market("BINANCE:BTCUSD", {
    "timeframe": "1",  # 1-minute chart
    "currency": "USD",
})

# Event: When the symbol data is loaded
chart.on_symbol_loaded(lambda _: print("✅ Market loaded:", chart.get_infos['description']))

# Event: When price data is updated
def handle_update(_):
    if chart.get_periods:
        print(f"🟢 New Price: {chart.get_periods['close']}")

chart.on_update(handle_update)

# Start the WebSocket connection
client.create_connection()
```

## Contributing

Contributions are welcome! Please open issues or PRs to collaborate.
