Metadata-Version: 2.1
Name: pureconnection
Version: 4.0.0
Summary: Lightweight realtime database
Home-page: https://github.com/ipungg-junior/pureconnection
Author: Muhammad Thoyfur
Author-email: Ipung Junior <ipungg.id@gmail.com>
Project-URL: Homepage, https://github.com/ipungg-junior/pureconnection
Keywords: connection,database,python
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# WELCOME TO EARTH

`pureconnection` is a OPENSOURCE lightweight realtime database based on client-server!

## Installation

You can install `pureconnection` using `pip`:


```bash
pip install pureconnection
```
Please see official PyPi website to get newer version and feature. ([Click Here](https://pypi.org/project/pureconnection))
## Example
### 1. MemoryStore 
Use this for manage data realtime on your memory
```python
from pureconnection._database import MemoryStore

# Get instance
store = MemoryStore.get_instance()

# Set key-value
store.set('ticket_no', 'SPMC')

print(store.get('ticket_no'))  # return 'SPMMC'
```
### 2. RemoteHost 
If you need data exchange with TCP protocol, you can use this method.
```python
from pureconnection._connection import RemoteHost

def on_msg(msg):
    print("📩 Server:", msg)

RemoteHost.configure("127.0.0.1", 9999)
RemoteHost.receiver_handler(on_msg)
RemoteHost.begin_connection()

# Loop utama
import time
while True:
    RemoteHost.send("PING")
    time.sleep(5)

    # Server Response
    # Server : PONG
```
