Skip to main content

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

Project description

Ocote

Ocote Logo

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


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.1.0.tar.gz (58.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ocote-0.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file ocote-0.1.0.tar.gz.

File metadata

  • Download URL: ocote-0.1.0.tar.gz
  • Upload date:
  • Size: 58.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for ocote-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b96379606dcc1abcd42754a926e304f4e0a85976b3e52d76918d8b0db20136fb
MD5 803808f40ea175e15f32af87418edad0
BLAKE2b-256 d986daba8eccbf913df4014a571c19db90ea61cd3dd25d960edd2f4dc48eb1b2

See more details on using hashes here.

File details

Details for the file ocote-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ocote-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for ocote-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 baad2c064c3be68aed8b668979316b03e86a9d8fb7169e7e57fbe0f167355147
MD5 07ad99ccb08bf9f6812fc94f60ab2b7f
BLAKE2b-256 276212818897cd1c0cfc411e63e9518581b5c1770e678710d7e09613462ecc85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page