Skip to main content

crank4y-connector

  1. A python library that allows you to register python web service to one or more API GATEWAY cranker routers
  2. it is the client endpoint of a API GATEWAY

Dependencies:

  1. python >= 3.6
  2. numpy(optional, for better performance)
  3. requests
  4. yarl
  5. websocket-client == 0.57.0 (pls use this version, do not try higher version, trust me, there are bugs in higher versions)

Usage

  • There are mainly 4 steps:

    1. pip install crank4py-connector
    2. create a web service that hosts al requests on some path prefix, e.g. /service-a/...
    3. start a web service on a random port
    4. construct a Config object and start a connector
  • example

from flask import Flask
from crank4py_connector import Config
from crank4py_connector import create_and_start_connector

router_uris = ["wss://localhost:9070", "wss://localhost:9070"]
my_service_uri = "http://localhost:5000"  
config = Config(my_service_uri, "service-a", router_uris, component_name="service-a-component")
connector = create_and_start_connector(config)

app = Flask(__name__, static_url_path="")
@app.route("/service-a/hello")
def hello():
    return "hello"
app.run(host="localhost", port=5000)

# or you can refer to crank4py_connector
# and then you can query your api gateway to access your server-a. e.g. if your router listens on https://localhost:9000, then you can access  https://localhost:9000/service-a/hello,

Metadata

Release files for crank4py-connector 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crank4py-connector 0.0.5
File Size Uploaded
crank4py_connector-0.0.5.tar.gz 13.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crank4py-connector 0.0.5
File Interpreter ABI Platform
crank4py_connector-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 30.1 kB

Release files / crank4py_connector-0.0.5.tar.gz

Download URL crank4py_connector-0.0.5.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5695428e3b6b6fb5cb22689e0503753fa42f50323b0d2d4a85c1a71fbe422f36
BLAKE2b-256 checksum
How to use checksums
12e5d71f297f8e9602e99016ea8ca46effe2a72297748db2d1443f1bf39bb6e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

Release files / crank4py_connector-0.0.5-py3-none-any.whl

Download URL crank4py_connector-0.0.5-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0eb00a812ae100bbf642f4af70f19ffe9165591a97dcff3a01cd02a15dba0ee0
BLAKE2b-256 checksum
How to use checksums
5c641606ca759f1369da60b9e19ab864ac84401e9869fedfa169e7bb811b9e52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page