Skip to content

Commit d0ff5ab

Browse files
committed
Rename package to fcsapi-websocket
1 parent 36316e1 commit d0ff5ab

File tree

3 files changed

+105
-4
lines changed

3 files changed

+105
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Real-time WebSocket client library for **Forex**, **Cryptocurrency**, and **Stoc
44

55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
66
[![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/)
7-
[![PyPI](https://img.shields.io/pypi/v/fcsapi-websocket-python.svg)](https://pypi.org/project/fcsapi-websocket-python/)
7+
[![PyPI](https://img.shields.io/pypi/v/fcsapi-websocket.svg)](https://pypi.org/project/fcsapi-websocket/)
88

99
## Features
1010

@@ -16,7 +16,7 @@ Real-time WebSocket client library for **Forex**, **Cryptocurrency**, and **Stoc
1616
## Installation
1717

1818
```bash
19-
pip install fcsapi-websocket-python
19+
pip install fcsapi-websocket
2020
```
2121

2222
## Examples

SYNC_STATUS.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# FCS WebSocket Library Sync Status
2+
3+
**Last Synced:** 2025-12-24
4+
**JS Version:** fcs-client-lib.js
5+
**PY Version:** fcs_client_lib.py
6+
**Status:** IN_SYNC
7+
8+
---
9+
10+
## Feature Comparison
11+
12+
| Feature | JS | Python | Notes |
13+
|---------|:--:|:------:|-------|
14+
| **Core Connection** |
15+
| connect() ||| |
16+
| disconnect() ||| |
17+
| send() ||| `_send()` in Python |
18+
| **Subscription** |
19+
| join(symbol, timeframe) ||| |
20+
| leave(symbol, timeframe) ||| |
21+
| removeAll() ||| `remove_all()` in Python |
22+
| rejoinAll() ||| `_rejoin_all()` in Python |
23+
| activeSubscriptions ||| `active_subscriptions` in Python |
24+
| **Event Callbacks** |
25+
| onconnected ||| |
26+
| onmessage ||| |
27+
| onclose ||| |
28+
| onerror ||| |
29+
| onreconnect ||| |
30+
| **Reconnection** |
31+
| reconnectDelay ||| `reconnect_delay` in Python |
32+
| reconnectLimit ||| `reconnect_limit` in Python |
33+
| countReconnects ||| `count_reconnects` in Python |
34+
| isReconnect ||| `is_reconnect` in Python |
35+
| Auto-reconnect logic ||| |
36+
| **Heartbeat** |
37+
| startHeartbeat() ||| `_start_heartbeat()` in Python |
38+
| stopHeartbeat() ||| `_stop_heartbeat` flag in Python |
39+
| 25s interval ||| |
40+
| **Logging** |
41+
| showLogs ||| Controls console output |
42+
| **Message Handling** |
43+
| ping/pong ||| |
44+
| welcome message ||| |
45+
| joined_room confirmation ||| |
46+
| **Browser-Only (Not in Python)** |
47+
| focusTimeout ||| Browser tab visibility - N/A for Python |
48+
| initVisibilityHandling() ||| Browser only |
49+
| handleTabHidden() ||| Browser only |
50+
| handleTabVisible() ||| Browser only |
51+
| clearVisibilityTimeout() ||| Browser only |
52+
| **Python-Only Extras** |
53+
| run_forever(blocking) ||| Python threading support |
54+
| Decorator callbacks ||| @client.on_message pattern |
55+
| create_client() helper ||| Factory function |
56+
57+
---
58+
59+
## Properties Mapping
60+
61+
| JavaScript | Python |
62+
|------------|--------|
63+
| `this.url` | `self.url` |
64+
| `this.apiKey` | `self.api_key` |
65+
| `this.socket` | `self.socket` |
66+
| `this.activeSubscriptions` | `self.active_subscriptions` |
67+
| `this.heartbeat` | `self._heartbeat_thread` |
68+
| `this.reconnectDelay` | `self.reconnect_delay` |
69+
| `this.manualClose` | `self.manual_close` |
70+
| `this.isConnected` | `self.is_connected` |
71+
| `this.showLogs` | `self.show_logs` |
72+
| `this.countreconnects` | `self.count_reconnects` |
73+
| `this.reconnectlimit` | `self.reconnect_limit` |
74+
| `this.isreconnect` | `self.is_reconnect` |
75+
76+
---
77+
78+
## Sync Instructions
79+
80+
When updating JS file, update Python file with these rules:
81+
82+
1. **New property added in JS** → Add to Python `__init__` with snake_case
83+
2. **New method added in JS** → Add to Python class with snake_case
84+
3. **Property removed in JS** → Remove from Python
85+
4. **Method removed in JS** → Remove from Python
86+
5. **Logic changed in JS** → Update corresponding Python logic
87+
88+
**Ignore these JS features (browser-only):**
89+
- Tab visibility handling (`focusTimeout`, `initVisibilityHandling`, etc.)
90+
- `WebSocketImpl` browser detection (Python always uses websocket-client)
91+
92+
---
93+
94+
## Change Log
95+
96+
### 2025-12-24 - Initial Sync
97+
- Added `show_logs` property to Python `__init__`
98+
- Updated all print statements to respect `show_logs` flag
99+
- All core features synced
100+
- Browser-only features excluded (not applicable to Python backend)
101+

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ requires = ["setuptools>=61.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "fcsapi-websocket-python"
7-
version = "4.0.1"
6+
name = "fcsapi-websocket"
7+
version = "4.0.0"
88
description = "Real-time WebSocket client for Python library for Forex, Cryptocurrency, and Stock market data from FCS API"
99
readme = "README.md"
1010
license = {text = "MIT"}

0 commit comments

Comments
 (0)