A library built on flask allowing for a socket like connection with encryption to a flask sever.
Project description
Ocote
Ocote is a library built on flask allowing for a socket like connection with encryption to a flask sever.
Installation
pip install ocote
Usage
You need to setup a client side and a server side for example:
Client side:
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:
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")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ocote-0.2.0.tar.gz
(62.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
ocote-0.2.0-py3-none-any.whl
(8.4 kB
view details)
File details
Details for the file ocote-0.2.0.tar.gz.
File metadata
- Download URL: ocote-0.2.0.tar.gz
- Upload date:
- Size: 62.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1e7ceab7c12d19347970338691fc0795448520eda6d153f3b7c56650757b306
|
|
| MD5 |
2a5bb6e8027ba5acc353b27b98f22970
|
|
| BLAKE2b-256 |
a5710bfc55ab65d6f45074fcc1f546362637048b4602ae6d920500d24f15d368
|
File details
Details for the file ocote-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ocote-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84953f37d0a799e465fdc0e204f112885cf7d81739c090bc5d58002abf54bce8
|
|
| MD5 |
5f2fa1540e63e1c6dbe44bb81d4e730e
|
|
| BLAKE2b-256 |
b27a61e53604517c09eb57040bce38b9e8eb2cdd47186a744b6d5e4c7ed9e7fc
|