# pyNetSocket
## A simple networking library for python
---
This library uses the in-built `sockets` library
It also uses the most basic client-server model
To initialize a server:
```python
from pyNetSocket import Server
myServer = Server(
IP,
PORT,
FORMAT='utf-8',
HEADER=8
DISCONNECT='!disconnect'
)
def connect(addr, conn):
print(f"({addr}) connected")
def disconnect(addr):
print(f"({addr}) disconnected")
def message(addr, conn, msg):
print("[MESSAGE]", addr, msg)
myServer.onConnect(connect, args=(), kwargs={})
myServer.onMessage(message, args=(), kwargs={})
myServer.onDisconnect(disconnect, args=(), kwargs={})
myServer.start(onThread=True)
```
To initialize a client:
```python
from pyNetSocket import Client
myClient = Client(
IP,
PORT,
FORMAT='utf-8',
HEADER=8
DISCONNECT='!disconnect'
)
myClient.connect(onThread=True)
```
Wiki link [here](https://github.com/DrSparky2k7/PyNetSocket/wiki/)
or try this https://github.com/DrSparky2k7/PyNetSocket/wiki/
You can also view in-built documentation:
```python
import pyNetSocket.docs
```
Raw data
{
"_id": null,
"home_page": "https://github.com/DrSparky2k7/PyNetSocket",
"name": "pyNetSocket",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "networking,sockets,simple networking,simple sockets,pyNetSockets,pyNetSocket",
"author": "AdityaIyer2k7",
"author_email": "adityaiyer2007@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a7/e5/c09e8c47344a48871d9140d6cf287fb7a00f09dbaace19f0da85a92d4667/pyNetSocket-1.1.5.tar.gz",
"platform": null,
"description": "# pyNetSocket\n## A simple networking library for python\n---\nThis library uses the in-built `sockets` library\n\nIt also uses the most basic client-server model\n\nTo initialize a server:\n```python\nfrom pyNetSocket import Server\n\nmyServer = Server(\n IP,\n PORT,\n FORMAT='utf-8',\n HEADER=8\n DISCONNECT='!disconnect'\n)\n\ndef connect(addr, conn):\n print(f\"({addr}) connected\")\n\ndef disconnect(addr):\n print(f\"({addr}) disconnected\")\n\ndef message(addr, conn, msg):\n print(\"[MESSAGE]\", addr, msg)\n\nmyServer.onConnect(connect, args=(), kwargs={})\nmyServer.onMessage(message, args=(), kwargs={})\nmyServer.onDisconnect(disconnect, args=(), kwargs={})\n\nmyServer.start(onThread=True)\n```\n\nTo initialize a client:\n```python\nfrom pyNetSocket import Client\nmyClient = Client(\n IP,\n PORT,\n FORMAT='utf-8',\n HEADER=8\n DISCONNECT='!disconnect'\n)\n\nmyClient.connect(onThread=True)\n```\n\nWiki link [here](https://github.com/DrSparky2k7/PyNetSocket/wiki/)\nor try this https://github.com/DrSparky2k7/PyNetSocket/wiki/\n\nYou can also view in-built documentation:\n```python\nimport pyNetSocket.docs\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "A simple networking library for python",
"version": "1.1.5",
"split_keywords": [
"networking",
"sockets",
"simple networking",
"simple sockets",
"pynetsockets",
"pynetsocket"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d8479eb35f297fd4150895ace35c75bc8638f3c421e54c3067b54f2dfca77520",
"md5": "3f1bb626d14b828b1f13a9df033e2314",
"sha256": "42c267e9baf1d0078873424ae3ba93f5d77adafcc347254e1a4cf562c84d8f45"
},
"downloads": -1,
"filename": "pyNetSocket-1.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3f1bb626d14b828b1f13a9df033e2314",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 6540,
"upload_time": "2023-04-20T07:06:09",
"upload_time_iso_8601": "2023-04-20T07:06:09.136114Z",
"url": "https://files.pythonhosted.org/packages/d8/47/9eb35f297fd4150895ace35c75bc8638f3c421e54c3067b54f2dfca77520/pyNetSocket-1.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a7e5c09e8c47344a48871d9140d6cf287fb7a00f09dbaace19f0da85a92d4667",
"md5": "ee9fc184203366abfb0cdf650dbe1ae7",
"sha256": "8068b101f0eb59e8082d375ec35fc558c8532c20054164e17d24cc0db6eae452"
},
"downloads": -1,
"filename": "pyNetSocket-1.1.5.tar.gz",
"has_sig": false,
"md5_digest": "ee9fc184203366abfb0cdf650dbe1ae7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4884,
"upload_time": "2023-04-20T07:06:11",
"upload_time_iso_8601": "2023-04-20T07:06:11.377955Z",
"url": "https://files.pythonhosted.org/packages/a7/e5/c09e8c47344a48871d9140d6cf287fb7a00f09dbaace19f0da85a92d4667/pyNetSocket-1.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-20 07:06:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "DrSparky2k7",
"github_project": "PyNetSocket",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pynetsocket"
}