Metadata-Version: 2.4
Name: ocote
Version: 0.2.0
Summary: A library built on flask allowing for a socket like connection with encryption to a flask sever.
Project-URL: Documentation, https://github.com/Okerew/ocote#readme
Project-URL: Issues, https://github.com/Okerew/ocote/issues
Project-URL: Source, https://github.com/Okerew/ocote
Author-email: Okerew <okerewgroup@proton.me>
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.8
Requires-Dist: cryptography==46.0.7
Requires-Dist: flask==3.1.3
Requires-Dist: numpy==2.4.4
Requires-Dist: requests==2.33.1
Description-Content-Type: text/markdown

# Ocote
 <img src="ocote.png" alt="Ocote Logo" />

Ocote is a library built on flask allowing for a socket like connection with encryption to a flask sever.

## Installation

```sh
pip install ocote
```

## Usage

You need to setup a client side and a server side for example:

**Client side:**
```python
import ocote.ocote as ocote

conn = ocote.connect("localhost:8000", "API_KEY")

conn.ping()                        # health check -> True/False
print(conn.func("add", 3, 4).value())     # call with args -> 7
print(conn.variable("my_data").value())   # fetch variable -> {"x": 42}
conn.object("cfg")                 # fetch via pickle -> RemoteResult
add = conn.lazy_func("add")        # get a local callable proxy
print(add(10, 20).value())                # -> 30
```

**Server side:**
```python
import ocote.ocote as ocote

def add(a, b):
    return a + b

my_data = {"x": 42}

class Config:
    debug = True

srv = ocote.server()
srv.expose(
    funcs={"add": add},
    vars={"my_data": my_data},
    objects={"cfg": Config()}
)
srv.post("localhost:8000", api_key="API_KEY")
```
