ipc-framework 1.0.0__py3-none-any.whl → 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,273 @@
1
+ Metadata-Version: 2.4
2
+ Name: ipc-framework
3
+ Version: 1.1.0
4
+ Summary: Efficient Inter-Process Communication Framework with hierarchical application and channel management
5
+ Home-page: https://github.com/ifesol/ipc-framework
6
+ Author: IPC Framework Team
7
+ Author-email: ifesol <ifesol@example.com>
8
+ Maintainer-email: ifesol <ifesol@example.com>
9
+ License: MIT
10
+ Project-URL: Homepage, https://github.com/ifesol/ipc-framework
11
+ Project-URL: Documentation, https://github.com/ifesol/ipc-framework#readme
12
+ Project-URL: Repository, https://github.com/ifesol/ipc-framework.git
13
+ Project-URL: Bug Tracker, https://github.com/ifesol/ipc-framework/issues
14
+ Keywords: ipc,communication,networking,client-server,messaging
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Topic :: System :: Networking
19
+ Classifier: License :: OSI Approved :: MIT License
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.7
22
+ Classifier: Programming Language :: Python :: 3.8
23
+ Classifier: Programming Language :: Python :: 3.9
24
+ Classifier: Programming Language :: Python :: 3.10
25
+ Classifier: Programming Language :: Python :: 3.11
26
+ Classifier: Programming Language :: Python :: 3.12
27
+ Classifier: Operating System :: OS Independent
28
+ Requires-Python: >=3.7
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Provides-Extra: examples
32
+ Requires-Dist: psutil>=5.8.0; extra == "examples"
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=6.0.0; extra == "dev"
35
+ Requires-Dist: black>=21.0.0; extra == "dev"
36
+ Requires-Dist: flake8>=3.8.0; extra == "dev"
37
+ Requires-Dist: mypy>=0.910; extra == "dev"
38
+ Requires-Dist: isort>=5.0.0; extra == "dev"
39
+ Provides-Extra: all
40
+ Requires-Dist: ipc-framework[dev,examples]; extra == "all"
41
+ Dynamic: author
42
+ Dynamic: home-page
43
+ Dynamic: license-file
44
+ Dynamic: requires-python
45
+
46
+ # IPC Framework - Python Package
47
+
48
+ [![PyPI version](https://badge.fury.io/py/ipc-framework.svg)](https://pypi.org/project/ipc-framework/)
49
+ [![Python versions](https://img.shields.io/pypi/pyversions/ipc-framework.svg)](https://pypi.org/project/ipc-framework/)
50
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
51
+
52
+ **Efficient Inter-Process Communication Framework** with hierarchical application and channel management. Enables seamless **bidirectional communication** between Python servers and JavaScript/TypeScript clients.
53
+
54
+ ## 🚀 Key Features
55
+
56
+ - **🔄 Bidirectional Communication**: Full two-way messaging between Python ↔ JavaScript
57
+ - **🏗️ Hierarchical Organization**: Applications → Channels → Messages
58
+ - **📡 Multiple Patterns**: Request/Response, Pub/Sub, Notifications
59
+ - **🌍 Cross-Language**: Python server + JavaScript/TypeScript clients
60
+ - **⚡ High Performance**: WebSocket-based with optimized binary protocol
61
+ - **🛡️ Built-in Reliability**: Auto-reconnection, timeouts, error handling
62
+ - **📦 Zero Dependencies**: Pure Python implementation
63
+ - **🎯 Thread-Safe**: Safe for multi-threaded applications
64
+
65
+ ## ✨ What's New in v1.1.0
66
+
67
+ 🛠️ **Critical Bug Fixes**:
68
+ - ✅ **Fixed missing `create_response()` method** - Request/response now working
69
+ - ✅ **Fixed socket timeout deadlock** - Stable connections after handshake
70
+ - ✅ **Fixed threading deadlock** - Resolved receive/send blocking issue
71
+ - ✅ **Fully functional bidirectional communication** - Both directions working perfectly
72
+
73
+ ## 📦 Installation
74
+
75
+ ```bash
76
+ pip install ipc-framework
77
+ ```
78
+
79
+ ## 🎯 Quick Start
80
+
81
+ ### Python Server
82
+
83
+ ```python
84
+ from ipc_framework import FrameworkServer, MessageType
85
+ import time
86
+
87
+ # Create server
88
+ server = FrameworkServer(host="localhost", port=8888)
89
+
90
+ # Create application and channel
91
+ app = server.create_application("my_app", "My Application")
92
+ api_channel = app.create_channel("api")
93
+
94
+ # Handle requests
95
+ def handle_request(message):
96
+ if message.payload.get('action') == 'get_time':
97
+ # Use the working create_response() method!
98
+ response = message.create_response({
99
+ 'success': True,
100
+ 'time': time.time(),
101
+ 'message': 'Current server time'
102
+ })
103
+
104
+ connection = server.connection_manager.get_connection(
105
+ message.payload.get('connection_id')
106
+ )
107
+ server.send_to_connection(connection, response)
108
+
109
+ api_channel.set_handler(MessageType.REQUEST, handle_request)
110
+ server.start()
111
+ ```
112
+
113
+ ### Python Client
114
+
115
+ ```python
116
+ from ipc_framework import FrameworkClient
117
+
118
+ # Create and connect client
119
+ client = FrameworkClient("my_app", host="localhost", port=8888)
120
+ client.connect()
121
+
122
+ # Send request and get response
123
+ response = client.send_request("api", {
124
+ "action": "get_time",
125
+ "connection_id": client.connection_id
126
+ })
127
+
128
+ print(f"Server time: {response.payload['time']}")
129
+ client.disconnect()
130
+ ```
131
+
132
+ ### JavaScript Client (Works with Python Server!)
133
+
134
+ ```javascript
135
+ import { IPCClient } from '@ifesol/ipc-framework-js';
136
+
137
+ const client = new IPCClient('my_app', {
138
+ host: 'localhost',
139
+ port: 8888
140
+ });
141
+
142
+ await client.connect();
143
+
144
+ const response = await client.sendRequest('api', {
145
+ action: 'get_time',
146
+ connection_id: client.connectionId
147
+ });
148
+
149
+ console.log('Server time:', response.payload.time);
150
+ ```
151
+
152
+ ## 🔄 Communication Patterns
153
+
154
+ ### 1. Request/Response (Bidirectional)
155
+ ```python
156
+ # Client → Server → Client
157
+ response = client.send_request("api", {"action": "get_users"})
158
+ ```
159
+
160
+ ### 2. Pub/Sub Notifications (Server → Client)
161
+ ```python
162
+ # Server broadcasts to all subscribers
163
+ def notification_handler(message):
164
+ print(f"Notification: {message.payload}")
165
+
166
+ client.subscribe("notifications", notification_handler)
167
+ ```
168
+
169
+ ### 3. Real-time Updates (Both Directions)
170
+ ```python
171
+ # Client can trigger server notifications
172
+ client.request("api", {"action": "trigger_notification"})
173
+ # Server sends real-time updates to all clients
174
+ ```
175
+
176
+ ## 🌍 Cross-Language Architecture
177
+
178
+ ```
179
+ ┌─────────────────┐ WebSocket ┌──────────────────┐
180
+ │ Python Server │ ←──────────────→ │ JavaScript Client│
181
+ │ │ │ (Browser/Node) │
182
+ │ - Applications │ │ - TypeScript │
183
+ │ - Channels │ │ - React/Vue │
184
+ │ - Message Routing │ - Auto-reconnect│
185
+ └─────────────────┘ └──────────────────┘
186
+ ```
187
+
188
+ ## 📊 Performance & Reliability
189
+
190
+ | Feature | Status |
191
+ |---------|---------|
192
+ | **Bidirectional Messaging** | ✅ Working |
193
+ | **Connection Stability** | ✅ Fixed deadlocks |
194
+ | **Request/Response** | ✅ Working |
195
+ | **Pub/Sub** | ✅ Working |
196
+ | **Error Handling** | ✅ Built-in |
197
+ | **Thread Safety** | ✅ Fixed |
198
+ | **Auto-reconnection** | ✅ JS client |
199
+
200
+ ## 🛠️ Command Line Tools
201
+
202
+ The package includes several CLI tools for testing:
203
+
204
+ ```bash
205
+ # Start demo server
206
+ ipc-server
207
+
208
+ # Interactive chat client
209
+ ipc-chat your_username
210
+
211
+ # File sharing demo
212
+ ipc-file
213
+
214
+ # System monitoring
215
+ ipc-monitor
216
+
217
+ # Full framework demo
218
+ ipc-demo
219
+ ```
220
+
221
+ ## 🎯 Use Cases
222
+
223
+ ### Real-time Applications
224
+ - **Chat systems** with multiple channels
225
+ - **Live dashboards** with metric streaming
226
+ - **Collaborative editors** with real-time updates
227
+ - **Gaming** with real-time state sync
228
+
229
+ ### Web Applications
230
+ - **Python backend** ↔ **React frontend**
231
+ - **API servers** with real-time notifications
232
+ - **Microservice communication**
233
+ - **IoT device control**
234
+
235
+ ### Multi-Process Systems
236
+ - **Service-to-service** communication
237
+ - **Background task** coordination
238
+ - **Distributed processing**
239
+ - **Event-driven architectures**
240
+
241
+ ## 📚 Documentation
242
+
243
+ - **[Complete Documentation](./docs/README.md)** - Full guides and examples
244
+ - **[API Reference](./docs/api-reference.md)** - Detailed API documentation
245
+ - **[Integration Guide](./docs/integration-guide.md)** - Framework integration examples
246
+ - **[Examples](./docs/examples.md)** - Real-world usage examples
247
+
248
+ ## 🆚 Why Choose IPC Framework?
249
+
250
+ | Traditional IPC | IPC Framework |
251
+ |----------------|---------------|
252
+ | ❌ Complex setup | ✅ 3-line setup |
253
+ | ❌ Python-only | ✅ Python ↔ JavaScript |
254
+ | ❌ Manual protocols | ✅ Built-in patterns |
255
+ | ❌ No web support | ✅ Direct browser clients |
256
+ | ❌ External dependencies | ✅ Zero dependencies |
257
+
258
+ ## 🔗 Related Packages
259
+
260
+ - **JavaScript Client**: [@ifesol/ipc-framework-js](https://www.npmjs.com/package/@ifesol/ipc-framework-js)
261
+ - **NPM Package**: Full TypeScript support for Node.js and browsers
262
+
263
+ ## 📄 License
264
+
265
+ MIT License - see [LICENSE](LICENSE) file for details.
266
+
267
+ ## 🤝 Contributing
268
+
269
+ Contributions are welcome! Please feel free to submit issues and pull requests.
270
+
271
+ ---
272
+
273
+ **Ready for production use!** 🚀 The framework now provides reliable, bidirectional communication between Python servers and JavaScript clients.
@@ -1,6 +1,6 @@
1
1
  ipc_framework/__init__.py,sha256=7wRyV3ndcZRYGYt00nyteagHNpZUD1Pl2xSplnpAUI8,701
2
- ipc_framework/client.py,sha256=w1M3awriE7w_p52mN2uHGcKfrgQ_-AoDVJoxuc3yJnE,10579
3
- ipc_framework/core.py,sha256=9ZG_Y5GYzRAcOpnegc9sqy2QN-UI0XqPPDkTagcF65s,13050
2
+ ipc_framework/client.py,sha256=MDXQ_V2DpeYeyTt3Asia7yqznC8PZKtHitxEyRvvMW8,10623
3
+ ipc_framework/core.py,sha256=SXYPNmyUUfkdoB6thJpZ0RCYodb8naqeN2EAVcDy_0c,13113
4
4
  ipc_framework/demo.py,sha256=X3dTeY9j4GvzF659iU0uDRLUu_kY-M3Xe1IYLRh0WIo,9633
5
5
  ipc_framework/exceptions.py,sha256=jYrMG1YfSsPjFAga3zekWjUH-026MJW5HJlmb__y0zE,822
6
6
  ipc_framework/py.typed,sha256=AkCw4Xa3uh5k_7ThgLc2Y4Zl3MJmu9M_KkhoSqVmMCY,77
@@ -10,9 +10,9 @@ ipc_framework/examples/basic_server.py,sha256=JagIYvdJzien_D5_ltrLcXV8l2R7tXmfMz
10
10
  ipc_framework/examples/chat_client.py,sha256=I0SklgNfNok_Mxh3sogCRFU0ZPn-h1FK4PGzyiCFyTg,5597
11
11
  ipc_framework/examples/file_client.py,sha256=5-pTSj2ihn9GcMpjNreEc-Pql3cUiSajfmqpFYmd5pw,6699
12
12
  ipc_framework/examples/monitoring_client.py,sha256=P_e_AzAEMi3pYNKwqpnnybwTDJ-JrL6IeJaqLs2paEs,8685
13
- ipc_framework-1.0.0.dist-info/licenses/LICENSE,sha256=TNNfib3sWn_knMftcB1VFB66qVWPO6H6XQgKQUT59QI,1095
14
- ipc_framework-1.0.0.dist-info/METADATA,sha256=D3jq-XkyHOowhQPczbgv59x2ZH1SjBnFAy45gZgsSig,13404
15
- ipc_framework-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- ipc_framework-1.0.0.dist-info/entry_points.txt,sha256=JYQQJs3l0-Rp8drzTljNe9ZTiWmBIdKwuUBwM59D7Hg,269
17
- ipc_framework-1.0.0.dist-info/top_level.txt,sha256=z8_yaAPugqYnekc8wt3hntHtZ5hNqv0hKwQv818yT1o,14
18
- ipc_framework-1.0.0.dist-info/RECORD,,
13
+ ipc_framework-1.1.0.dist-info/licenses/LICENSE,sha256=TNNfib3sWn_knMftcB1VFB66qVWPO6H6XQgKQUT59QI,1095
14
+ ipc_framework-1.1.0.dist-info/METADATA,sha256=7k9O-4TTy_BfcNL1LyOklv-poNxVIz7hYMdg2kLTkRQ,9238
15
+ ipc_framework-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ ipc_framework-1.1.0.dist-info/entry_points.txt,sha256=JYQQJs3l0-Rp8drzTljNe9ZTiWmBIdKwuUBwM59D7Hg,269
17
+ ipc_framework-1.1.0.dist-info/top_level.txt,sha256=z8_yaAPugqYnekc8wt3hntHtZ5hNqv0hKwQv818yT1o,14
18
+ ipc_framework-1.1.0.dist-info/RECORD,,