ipc-framework 1.0.0__py3-none-any.whl → 1.1.2__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.2
4
+ Summary: Python IPC server for high-performance communication with Node.js applications using TCP sockets
5
+ Home-page: https://github.com/ifesol/ipc-framework
6
+ Author: IPC Framework Team
7
+ Author-email: IPC Framework Team <ifesol@example.com>
8
+ Maintainer-email: IPC Framework Team <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,inter-process-communication,tcp,sockets,nodejs,python,server,microservices,real-time,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 - Inter-Process Communication
47
+
48
+ [![NPM companion](https://img.shields.io/badge/Node.js%20Package-v1.1.3-green.svg)](https://www.npmjs.com/package/@ifesol/ipc-framework-nodejs)
49
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
50
+
51
+ **Efficient Inter-Process Communication Framework** for **Python ↔ Node.js** backend integration. This is the **Python server package** that enables seamless **bidirectional communication** with Node.js applications using TCP sockets.
52
+
53
+ ## 🐍 **Python Server Package**
54
+
55
+ This package provides the **Python IPC server** for communication with Node.js clients.
56
+
57
+ **✅ Production Ready Features:**
58
+ - ✅ TCP socket server (high-performance, low-latency)
59
+ - ✅ Hierarchical application and channel management
60
+ - ✅ Request/response and publish/subscribe patterns
61
+ - ✅ Connection pooling and auto-reconnection support
62
+ - ✅ Thread-safe operation with robust error handling
63
+
64
+ ## 🚀 **Quick Start**
65
+
66
+ ### **Installation**
67
+
68
+ ```bash
69
+ # Install Python IPC server
70
+ pip install ipc-framework
71
+
72
+ # Install Node.js client (separate package)
73
+ npm install @ifesol/ipc-framework-nodejs
74
+ ```
75
+
76
+ ### **Python Server Usage**
77
+
78
+ ```python
79
+ from ipc_framework import FrameworkServer, MessageType
80
+ import time
81
+
82
+ # Create server
83
+ server = FrameworkServer(host="localhost", port=8888)
84
+
85
+ # Create application and channel
86
+ app = server.create_application("my_app", "My Application")
87
+ api_channel = app.create_channel("api")
88
+
89
+ # Handle requests from Node.js clients
90
+ def handle_request(message):
91
+ action = message.payload.get('action')
92
+
93
+ if action == 'get_data':
94
+ response = message.create_response({
95
+ 'success': True,
96
+ 'data': {'timestamp': time.time(), 'message': 'Hello from Python!'},
97
+ 'server': 'Python IPC Framework'
98
+ })
99
+
100
+ connection = server.connection_manager.get_connection(
101
+ message.payload.get('connection_id')
102
+ )
103
+ server.send_to_connection(connection, response)
104
+
105
+ api_channel.set_handler(MessageType.REQUEST, handle_request)
106
+
107
+ print("🐍 Python IPC Server starting on localhost:8888")
108
+ server.start()
109
+ ```
110
+
111
+ ### **Node.js Client Usage**
112
+
113
+ ```javascript
114
+ const { IPCClient } = require('@ifesol/ipc-framework-nodejs');
115
+
116
+ async function main() {
117
+ const client = new IPCClient('my_app', {
118
+ host: 'localhost',
119
+ port: 8888
120
+ });
121
+
122
+ try {
123
+ await client.connect();
124
+ console.log('✅ Connected to Python server!');
125
+
126
+ const response = await client.sendRequest('api', {
127
+ action: 'get_data'
128
+ });
129
+
130
+ console.log('📨 Response from Python:', response.payload);
131
+ } catch (error) {
132
+ console.error('❌ Error:', error.message);
133
+ } finally {
134
+ client.disconnect();
135
+ }
136
+ }
137
+
138
+ main();
139
+ ```
140
+
141
+ ## 🎯 **Architecture Features**
142
+
143
+ ### **✅ Production-Ready Server:**
144
+ - **High-performance TCP sockets** for low-latency communication
145
+ - **Hierarchical structure** with applications and channels
146
+ - **Message routing** and automatic connection management
147
+ - **Thread-safe operations** with robust error handling
148
+
149
+ ### **✅ Communication Patterns:**
150
+ - **Request/Response** - Direct client-server communication
151
+ - **Publish/Subscribe** - Real-time notifications and broadcasts
152
+ - **Channel-based routing** - Organized message handling
153
+ - **Connection pooling** - Efficient resource management
154
+
155
+ ## 🏗️ **Integration with Node.js**
156
+
157
+ This Python server works seamlessly with Node.js applications. Here's how to connect an Express.js app:
158
+
159
+ **Node.js Express.js Integration:**
160
+ ```javascript
161
+ const express = require('express');
162
+ const { IPCClient } = require('@ifesol/ipc-framework-nodejs');
163
+
164
+ const app = express();
165
+ const pythonClient = new IPCClient('web_api');
166
+
167
+ app.use(express.json());
168
+
169
+ // Initialize connection to Python IPC server
170
+ pythonClient.connect().then(() => {
171
+ console.log('🔗 Connected to Python IPC server');
172
+ });
173
+
174
+ // API endpoint proxying to Python backend
175
+ app.post('/api/process', async (req, res) => {
176
+ try {
177
+ const result = await pythonClient.sendRequest('processing', {
178
+ action: 'process_user_data',
179
+ data: req.body,
180
+ connection_id: pythonClient.connectionId
181
+ });
182
+
183
+ res.json(result.payload);
184
+ } catch (error) {
185
+ res.status(500).json({ error: error.message });
186
+ }
187
+ });
188
+
189
+ app.listen(3000, () => {
190
+ console.log('🌐 Express server running on port 3000');
191
+ console.log('📡 Proxying requests to Python IPC server');
192
+ });
193
+ ```
194
+
195
+ ## 📊 **Performance Characteristics**
196
+
197
+ | Feature | Performance | Details |
198
+ |---------|-------------|---------|
199
+ | **Connection Handling** | Sub-millisecond | Fast TCP connection establishment |
200
+ | **Message Processing** | <1ms latency | Direct socket communication |
201
+ | **Concurrent Connections** | 100+ clients | Thread-safe connection management |
202
+ | **Message Throughput** | High-volume | Efficient message routing |
203
+ | **Memory Usage** | Low footprint | Optimized Python implementation |
204
+ | **Error Recovery** | Automatic | Robust connection cleanup |
205
+
206
+ ## 🎯 **Use Cases**
207
+
208
+ This Python IPC server enables powerful hybrid architectures:
209
+
210
+ ### **Backend Services**
211
+ - **AI/ML model serving** - Host machine learning models and serve predictions to Node.js frontends
212
+ - **Data processing pipelines** - Heavy computational tasks handled by Python, coordinated with Node.js
213
+ - **Real-time analytics** - Python analytics engines feeding real-time dashboards
214
+ - **Scientific computing** - NumPy/SciPy computations accessible from Node.js applications
215
+
216
+ ### **Microservice Architecture**
217
+ - **Polyglot microservices** - Python services integrated with Node.js API gateways
218
+ - **Event-driven architecture** - Python services publishing events to Node.js consumers
219
+ - **Service mesh integration** - Python backend services in cloud-native environments
220
+ - **Legacy system integration** - Bridge existing Python systems with modern Node.js frontends
221
+
222
+ ### **Hybrid Applications**
223
+ - **E-commerce platforms** - Python inventory/pricing engines with Node.js storefronts
224
+ - **Financial services** - Python quantitative analysis with Node.js trading interfaces
225
+ - **IoT platforms** - Python device controllers with Node.js monitoring dashboards
226
+ - **Chat applications** - Python NLP processing with Node.js real-time messaging
227
+
228
+ ## 🆚 **Why Choose IPC over HTTP?**
229
+
230
+ | HTTP API Approach | IPC Framework |
231
+ |-------------------|---------------|
232
+ | ❌ High latency overhead | ✅ Direct TCP communication |
233
+ | ❌ Request/response only | ✅ Request/response + pub/sub |
234
+ | ❌ Manual connection management | ✅ Automatic reconnection |
235
+ | ❌ Complex error handling | ✅ Built-in fault tolerance |
236
+ | ❌ No real-time capabilities | ✅ Live notifications |
237
+ | ❌ Stateless limitations | ✅ Persistent connections |
238
+
239
+ ## 🔗 **Companion Packages**
240
+
241
+ This Python server works with the Node.js client package:
242
+
243
+ - **Node.js Client**: [@ifesol/ipc-framework-nodejs](https://www.npmjs.com/package/@ifesol/ipc-framework-nodejs) - Production-ready TCP client
244
+ - **Installation**: `npm install @ifesol/ipc-framework-nodejs`
245
+ - **Documentation**: [Node.js Package Docs](https://www.npmjs.com/package/@ifesol/ipc-framework-nodejs)
246
+
247
+ ## 🚀 **Getting Started**
248
+
249
+ 1. **Install the Python server:**
250
+ ```bash
251
+ pip install ipc-framework
252
+ ```
253
+
254
+ 2. **Install the Node.js client:**
255
+ ```bash
256
+ npm install @ifesol/ipc-framework-nodejs
257
+ ```
258
+
259
+ 3. **Run the examples above** to see the integration in action!
260
+
261
+ ## 📚 **Documentation**
262
+
263
+ - [Python API Reference](https://github.com/ifesol/ipc-framework#python-api)
264
+ - [Node.js Client Usage](https://www.npmjs.com/package/@ifesol/ipc-framework-nodejs)
265
+ - [Integration Examples](https://github.com/ifesol/ipc-framework/tree/main/examples)
266
+
267
+ ## 📄 License
268
+
269
+ MIT License - see [LICENSE](LICENSE) file for details.
270
+
271
+ ## 🤝 Contributing
272
+
273
+ Contributions welcome! Help us improve the Python ↔ Node.js IPC communication experience.
@@ -1,6 +1,6 @@
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
1
+ ipc_framework/__init__.py,sha256=bxe--vOgaHlO5JIu4V9DEfLk9cU11OgpDwaqqOqbkxw,701
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.2.dist-info/licenses/LICENSE,sha256=TNNfib3sWn_knMftcB1VFB66qVWPO6H6XQgKQUT59QI,1095
14
+ ipc_framework-1.1.2.dist-info/METADATA,sha256=to5LcA26fgvboCfqXXO1pJYli9SSabgSinpnrT8_5aQ,10199
15
+ ipc_framework-1.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ ipc_framework-1.1.2.dist-info/entry_points.txt,sha256=JYQQJs3l0-Rp8drzTljNe9ZTiWmBIdKwuUBwM59D7Hg,269
17
+ ipc_framework-1.1.2.dist-info/top_level.txt,sha256=z8_yaAPugqYnekc8wt3hntHtZ5hNqv0hKwQv818yT1o,14
18
+ ipc_framework-1.1.2.dist-info/RECORD,,