Skip to main content

Websockets lib

Project description

pickledsocks

Facilitate connections processes.

Python programs communicate amongst themselves with pickle or json. They must communicate with non-python programs with json, because of course non-python processes cannot use pickle.

Here's the code, an overview of the important functions:

class picklesocks:
    python_make_server = partial(make_server, pickle)
    python_send = partial(send, pickle)

class jsoncks:
    make_server = partial(make_server, json)
    send = partial(send, json)

Simple test program:

import sys

from pickledsocks import jsoncks

is_server = sys.argv[1].strip() == 'y'

def get(data):
    print(f"I got data: {data}")
    return "I got your dataif is_server:

if is_server:
    asyncio.run(jsoncks.make_server(get, 3952))
else:
    asyncio.run(jsoncks.send("Hi server from client!", 3952))

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

pickledsocks-0.1.8.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

pickledsocks-0.1.8-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file pickledsocks-0.1.8.tar.gz.

File metadata

  • Download URL: pickledsocks-0.1.8.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.2

File hashes

Hashes for pickledsocks-0.1.8.tar.gz
Algorithm Hash digest
SHA256 a1100788064a26ae5a83a04fadc494fa04bfdb3e598f36a9a33d455f1638e585
MD5 22f7f1cb3f839e370a7d3c7900353dfa
BLAKE2b-256 9bd5144304d2c5c4a6e5d78c25e495ca3f3935f2c097583b95d715dea15fc993

See more details on using hashes here.

File details

Details for the file pickledsocks-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: pickledsocks-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.2

File hashes

Hashes for pickledsocks-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7b9a28f9ce9aed38ca1fac6bdcf77744924d5e737249f2650a1ead333004cf0b
MD5 0bee62fe7d3d22c78309079615d10cd9
BLAKE2b-256 1467619f9dfac329d9b25a4fb4f5823f250e631d8a38b0b8153ced9559ba4925

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