Skip to main content

API to make request for PWBUS. Developed for the following frameworks Flask, Bottle

Project description

pwbus-request

API to make request for PWBus.

Install:

$ pip3 install pwbus-request

Bootle request

@get('/ping')
def ping():
    print("PING (request)")
    sys.stdout.flush()
    try:
        pwbus = PwbusBootleRequest(
            request=request,
            response=response,
            channel="scarlet-web-channel", 
            task_id="pwbus.Pwbus_ping_task"
        )

        headers = pwbus.getHeaders()

        if pwbus.isRetry():
            payload = {}
        else:
            payload = {'value': 'PING'}

        resp = pwbus.post(payload, headers)
        return json.dumps({'success': True, 'data': resp["data"]})

    except:
        traceback.print_exc()
        sys.stdout.flush()
        return json.dumps({'success': False})

Flask request

TODO

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

pwbus-request-0.1.9.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

pwbus_request-0.1.9-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pwbus-request-0.1.9.tar.gz.

File metadata

  • Download URL: pwbus-request-0.1.9.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for pwbus-request-0.1.9.tar.gz
Algorithm Hash digest
SHA256 140cf770359542473435d97037bb3fc2562effdd6badfb97e012537e352fafc4
MD5 9813d9e6ae2f7ba8c7f4543aa77c29fb
BLAKE2b-256 9011bfc0b12af85c6dc67211394810808f5d9713c122ee5054b17751e7c2d4ae

See more details on using hashes here.

File details

Details for the file pwbus_request-0.1.9-py2.py3-none-any.whl.

File metadata

  • Download URL: pwbus_request-0.1.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for pwbus_request-0.1.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 52191410c3ec8d9308f43fc0729b0d11b325cfdda7c25e67e29aa0cc9d87352a
MD5 d35953a3f4dce23bb30843a24556efa5
BLAKE2b-256 49fb304b912b82ded134ba4244efe7c7f91a88ca17729ab9e5a49c3462a32ec4

See more details on using hashes here.

Supported by

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