Metadata-Version: 2.4
Name: connecter
Version: 0.1.2
Summary: Tiny socket server helper with startServer and sendToConnected.
Author: Adit Sharma
License-Expression: MIT
Project-URL: Homepage, https://example.com/connecter
Keywords: socket,server,networking,chat
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# connecter

Tiny Python socket helper.

## Install locally

```powershell
pip install .
```

## Use as a server

```python
import connecter


def got_message(message, address):
    print(f"{address}: {message}")


connecter.startServer(port=5050, on_message=got_message)
connecter.sendToConnected("Server is online")
```

String ports also work:

```python
connecter.startServer("0.0.0.0", "5050")
```

## Use as a client

```python
import connecter

connecter.Connect("127.0.0.1", port=5050)
connecter.sendToServer("hello server")
```

String ports also work:

```python
connecter.Connect("127.0.0.1", "5050")
```

## Open the connecter console

```python
import connecter

connecter.cmd()
```

Console commands: `start`, `connect`, `send`, `clients`, `stop`, `exit`.

## Build for PyPI

```powershell
python -m pip install build twine
python -m build
python -m twine upload dist/*
```
